{"id":20085503,"url":"https://github.com/smarthome-go/commander","last_synced_at":"2026-04-29T12:42:03.785Z","repository":{"id":110493835,"uuid":"512528159","full_name":"smarthome-go/commander","owner":"smarthome-go","description":"Microservice for executing shell commands via API requests","archived":false,"fork":false,"pushed_at":"2024-08-07T01:02:33.000Z","size":2228,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-02T14:26:41.165Z","etag":null,"topics":["linux","remote-execution","remote-shell","shell","smarthome-api"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smarthome-go.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-07-10T20:02:28.000Z","updated_at":"2024-08-07T01:02:37.000Z","dependencies_parsed_at":"2024-02-11T01:23:51.482Z","dependency_job_id":"9840f352-aa76-4599-a1c3-3ad6511d8240","html_url":"https://github.com/smarthome-go/commander","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/smarthome-go/commander","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Fcommander","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Fcommander/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Fcommander/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Fcommander/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smarthome-go","download_url":"https://codeload.github.com/smarthome-go/commander/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Fcommander/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32426588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T12:24:25.982Z","status":"ssl_error","status_checked_at":"2026-04-29T12:24:24.439Z","response_time":110,"last_error":"SSL_read: 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":["linux","remote-execution","remote-shell","shell","smarthome-api"],"created_at":"2024-11-13T15:56:15.933Z","updated_at":"2026-04-29T12:42:03.752Z","avatar_url":"https://github.com/smarthome-go.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Commander\nMicroservice for executing commands via API requests\n\n## Introduction\nCommander acts like a scripting interface to any Linux computer.\nThe service is able to receive commands via its built-in API server in order to execute them.\nThe main purpose of this software is to be used alongside Smarthome-server in order to allow Homescript to control remote computers.\n\n**Warning**: Even though access requires a token,  running commander comes at your own risk because it opens up a potent entrance for possible attackers to use.\n\n## API Usage\nTo execute an arbitrary command, issue a `POST` request using following parameters.\n\n| Key     | Value                            |\n|---------|----------------------------------|\n| Method  | `POST`                           |\n| URL     | `http://ip/exec`                 |\n| Header1 | `Token: your_token`              |\n| Header2 | `Content-Type: application/json` |\n| Body    | `{ command: \"ls\"}` (*as JSON*)   |\n\n### Usage from Smarthome via Homescript\n**Note**: This example uses Smarthome-server `v0.0.47` (which uses Homescript `v0.15.1`).\n\nTo test this code, execute `your_id` using the `command` argument with your command as its value.\n```python\n# Calling `your_id` from outside\nexec(\n    'your_id',\n    pair('command', \"ls\")\n)\n\n# This is the beginning of `your_id`\nhttp(\n    'http://computer.box/exec',\n    'POST',\n    concat('{', '\"command\":\"', getArg('command'), '\"}'),\n    pair('Content-Type', 'application/json'),\n    pair('Token', 'test'),\n)\n```\n\n## Installation\n### Manual installation\n#### Cloning\n```bash\ngit clone git@github.com:smarthome-go/commander\ncd commander\n```\n#### Installation\n```bash\nmake install\n```\n\n#### Installing a Systemd Service (Optional)\n```bash\nsudo cp commander@.service /etc/systemd/system/\nsudo systemctl daemon-reload\nsudo systemctl start commander@$USER\n```\n\n##### Additional configuration\n**Note**: Modifying the `.service` file is not recommended (*except for environment variables*)\n\nWhen using Systemd, the service is configured using environment variables.\nThe most important configuration parameters are explained below.\n\n| Parameter         | Explanation                                                       |\n|-------------------|-------------------------------------------------------------------|\n| `ROCKET_PORT`     | The port on which commander listens on                            |\n| `COMMANDER_TOKEN` | Unencrypted user authentication token                             |\n\n\nRepresentation in the `.service` file (which is located at `/etc/systemd/system/commander@.service`)\n```bash\n# Environment variables for the service\nEnvironment=ROCKET_PORT=7070\nEnvironment=COMMANDER_TOKEN=test\n```\n\nIn some cases, you might want to start applications with a GUI or which depend on audio.\nOn those occasions, the command might fail due to missing environment variables.\nYou can feel free to include the missing variables under the `# Put user environment variables here` marker.\nWhen you don't want to take on the hassle of figuring our which missing environment variable is causing the issue, you can inclue *all* your current variables in the file.\nThe command for listing your environment variables on Unix is `env`.\nBut don't forget to run `sudo systemctl daemon-reload` after writing modifications to the service file.\n\n**Note**: It is not recommended to include *all* of your environment variables in the service file.\n\n\n\n### Arch Linux\nIf using Arch Linux, the most convenient way of installing *commander* is via the AUR (*Arch Linux User Repository*).\nFor this, an AUR helper like `paru` or `yay` is used.\n\n**Note**: This method automatically installs a Systemd service, however it is not enabled by default.\n\n```bash\nparu -S commander\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarthome-go%2Fcommander","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmarthome-go%2Fcommander","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarthome-go%2Fcommander/lists"}