{"id":36995825,"url":"https://github.com/maximgrynykha/winkill","last_synced_at":"2026-01-13T23:48:10.112Z","repository":{"id":45096296,"uuid":"359189935","full_name":"maximgrynykha/winkill","owner":"maximgrynykha","description":"⚙️ Scan \u0026 Kill Windows processes in PHP","archived":false,"fork":false,"pushed_at":"2024-05-18T18:26:51.000Z","size":110,"stargazers_count":5,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-11T03:52:27.401Z","etag":null,"topics":["kill","operating-system","os","php","process","processes","scan","tasklist","terminate","windows","winkill"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maximgrynykha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-18T16:01:35.000Z","updated_at":"2024-05-18T18:23:25.000Z","dependencies_parsed_at":"2023-10-05T05:17:37.980Z","dependency_job_id":"afc4ba70-480c-48bb-80e1-a0d71beb419e","html_url":"https://github.com/maximgrynykha/winkill","commit_stats":{"total_commits":61,"total_committers":4,"mean_commits":15.25,"dds":0.4590163934426229,"last_synced_commit":"5ff8b15f7c18d4102643b36a630b352b20d2e830"},"previous_names":["mxgy/winkill","maximgrynykha/winkill"],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/maximgrynykha/winkill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximgrynykha%2Fwinkill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximgrynykha%2Fwinkill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximgrynykha%2Fwinkill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximgrynykha%2Fwinkill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximgrynykha","download_url":"https://codeload.github.com/maximgrynykha/winkill/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximgrynykha%2Fwinkill/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kill","operating-system","os","php","process","processes","scan","tasklist","terminate","windows","winkill"],"created_at":"2026-01-13T23:48:10.048Z","updated_at":"2026-01-13T23:48:10.104Z","avatar_url":"https://github.com/maximgrynykha.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build Status](https://img.shields.io/github/actions/workflow/status/maximgrynykha/winkill/main.yml?style=for-the-badge\u0026logo=github\u0026logoColor=white\u0026label=build)\n\n# __Winkill__\n\nWork with processes as objects. Find specific ones by attributes and kill them.\n\n## ⚙️ Installation\n\nTo install this library - run the command below in your terminal:\n\n```shell\ncomposer require maximgrynykha/winkill\n```\n\n## Usage  \n\n```php\n\u003c?php\n\nuse Winkill\\Winkill;\n\nrequire_once 'vendor/autoload.php';\n\ntry {\n    $winkill = new Winkill();\n    $processes = $winkill-\u003escan();\n```\n\n```php\n    // Get scanned processes\n    $scanned = $processes-\u003eget();\n \n    dd($scanned);\n```\n\n```php\n    // Select specific process(es)\n    $selected = $processes-\u003ewhere(\n        attribute: 'process_name',\n        compareAs: '=',\n        value: 'phpstorm64.exe'\n    )-\u003eget();\n\n    dd($selected);\n```\n\n```php\n    // Kill specific process(es)\n    $killed = $processes-\u003ewhere(\n        attribute: 'process_id',\n        compareAs: '=',\n        value: 11492\n    )-\u003ekill();  \n\n    // Note: If the processes have been killed or not found \n    // by the where-condition then returns an empty array.\n    dd($killed);\n```\n\n```php\n} catch (\\Winkill\\Kernel\\Interface\\Exception|\\Throwable $throwable) {\n    die($throwable-\u003egetMessage());\n}\n```\n\n### API (based on 'tasklist' command)\n| Attribute name    | Attribute value                 | Example    | Compare operator                          |\n|:------------------|:--------------------------------|:-----------|:------------------------------------------|\n| `process_name`    | [string]: name with ext         | chrome.exe | [string]: `=`, `!=`                       |\n|                   | [string]: name                  | chrome     | [string]: `=`, `!=`                       |\n|                   | [string]: ext                   | .exe       | [string]: `=`, `!=`                       |\n| `process_id`      | [int]: number of the ID         |            | [string]: `=`, `!=`                       |\n| `session_name`    | [string]: Console / Services    |            | [string]: `=`, `!=`                       |\n| `session_number`  | [int]: number in range of {0-1} |            | [string]: `=`, `!=`                       |\n| `consumed_memory` | [int]: number in Kb (kilobytes) |            | [string]: `\u003e`, `\u003c`, `=`, `\u003e=`, `\u003c=`, `!=` |\n\n### Select processes\n\n```php\n$processes-\u003ewhere('process_name', '=', 'chrome')-\u003eget();\n\n$processes-\u003ewhere('process_id', '=', 11455)-\u003eget();\n\n$processes-\u003ewhere('session_name', '=', 'console')-\u003eget();\n\n$processes-\u003ewhere('session_number', '=', 1)-\u003eget();\n\n// ⚠️ Note: consumed memory is estimated in Kb(kilobytes)\n$processes-\u003ewhere('consumed_memory', '=', 128920)-\u003eget(); \n```\n\n### Terminate processes\n\n```php\n$processes-\u003ewhere('process_name', '=', 'chrome')-\u003ekill();\n\n$processes-\u003ewhere('process_id', '=', 11455)-\u003ekill();\n\n//❗Alert: killing process(es) by attribute [session_name]\n// may break you 🤯 and/or your computer 💥. Use it only \n// if you are 100% confident at the ending result.\n$processes-\u003ewhere('session_name', '=', 'console')-\u003ekill();\n\n//❗Alert: killing process(es) by attribute [session_number] \n// is the same danger as was said previously about attribute \n// [session_name], so be warned about using it at your risk.\n$processes-\u003ewhere('session_number', '=', 1)-\u003ekill();\n\n// ⚠️ Note: consumed memory is estimated in Kb(kilobytes)\n$processes-\u003ewhere('consumed_memory', '=', 128920)-\u003ekill(); \n```\n\n### 🧱 Snippets\n\n```php\n// Terminate processes by an array of process names (all names are an example)\narray_walk($processes_names = ['chrome', 'firefox', 'slack'],\n    static fn(string $process_name): Process =\u003e \n        $processes-\u003ewhere('process_name', '=', $process_name)-\u003ekill(),\n);\n\n// Terminate processes by an array of process ids (all ids are an example)\narray_walk($processes_ids = [1000, 5595, 17820],\n    static fn(string $process_id): Process =\u003e \n        $processes-\u003ewhere('process_id', '=', $process_id)-\u003ekill(),\n);\n\n// You can switch between array_walk and array_map for your needs.\n// [Confusing in difference?](https://stackoverflow.com/a/3432266/11591375)\n```\n\n```php\n$processes = $processes-\u003ewhere('consumed_memory', '\u003c', 1000)-\u003eget();\n\n// Sort processes on consumed memory by ASC\nusort($processes, static fn(Process $process, Process $_process): int =\u003e\n    $process-\u003econsumed_memory \u003c=\u003e $_process-\u003econsumed_memory\n);\n\n// Sort processes on consumed memory by DESC\nusort($processes, static fn(Process $process, Process $_process): int =\u003e\n    $_process-\u003econsumed_memory \u003c=\u003e $process-\u003econsumed_memory\n);\n```\n\n## 📝 Footnotes\n\n_The project utilizes `DRY` and `SOLID` principles. Used `Design Patterns` are listed below._\n\n| Creational                                                                      | Structural                                                  | Behavioral                                                      | Others*                                                                 |\n|---------------------------------------------------------------------------------|:------------------------------------------------------------|:----------------------------------------------------------------|:------------------------------------------------------------------------|\n| [`Abstract Factory`](https://refactoring.guru/design-patterns/abstract-factory) | [`Facade`](https://refactoring.guru/design-patterns/facade) | [`Strategy`](https://refactoring.guru/design-patterns/strategy) | [`Composition Root`](https://blog.ploeh.dk/2011/07/28/CompositionRoot/) |\n| [`Factory Method`](https://refactoring.guru/design-patterns/factory-method)     | [`Proxy`](https://refactoring.guru/design-patterns/proxy)   | [`Command`](https://refactoring.guru/design-patterns/command)   |                                                                         |\n| [`Builder`](https://refactoring.guru/design-patterns/builder)                   |                                                             |                                                                 |                                                                         |\n\n\n## 🤝 Contributing\n\nIf you have a problem that cannot be solved using this library, please write your solution, and if you want to help \nother developers who also use this library (or if you want to keep your solution working after a new version is \nreleased, which will be in the package manager dependencies) — create a pull-request. I will be happy to add your \nexcellent code to the library!\n\n🐞 Report any bugs or issues you find on the [GitHub issues](https://github.com/MaximGrynykha/winkill/issues).\n\n## 📃 License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximgrynykha%2Fwinkill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximgrynykha%2Fwinkill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximgrynykha%2Fwinkill/lists"}