{"id":23480457,"url":"https://github.com/qtoggle/qtoggleserver-cmdline","last_synced_at":"2026-04-23T03:33:08.743Z","repository":{"id":77604612,"uuid":"274755172","full_name":"qtoggle/qtoggleserver-cmdline","owner":"qtoggle","description":"A driver for ports whose values are backed by system commands","archived":false,"fork":false,"pushed_at":"2025-11-09T08:54:30.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-09T10:21:46.309Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qtoggle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-06-24T19:42:52.000Z","updated_at":"2025-11-09T08:54:35.000Z","dependencies_parsed_at":"2026-01-22T01:03:04.617Z","dependency_job_id":null,"html_url":"https://github.com/qtoggle/qtoggleserver-cmdline","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/qtoggle/qtoggleserver-cmdline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtoggle%2Fqtoggleserver-cmdline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtoggle%2Fqtoggleserver-cmdline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtoggle%2Fqtoggleserver-cmdline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtoggle%2Fqtoggleserver-cmdline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qtoggle","download_url":"https://codeload.github.com/qtoggle/qtoggleserver-cmdline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtoggle%2Fqtoggleserver-cmdline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32165062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T02:19:40.750Z","status":"ssl_error","status_checked_at":"2026-04-23T02:17:55.737Z","response_time":53,"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":[],"created_at":"2024-12-24T20:13:27.672Z","updated_at":"2026-04-23T03:33:08.728Z","avatar_url":"https://github.com/qtoggle.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About\n\nThis is an addon for [qToggleServer](https://github.com/qtoggle/qtoggleserver).\n\nIt provides a driver for ports whose values are backed by system commands.\n\n\n## Install\n\nInstall using pip:\n\n    pip install qtoggleserver-cmdline\n\n\n## Usage\n\n##### `qtoggleserver.conf:`\n``` ini\n...\nperipherals = [\n    ...\n    {\n        driver = \"qtoggleserver.cmdline.CommandLine\"\n        name = \"my_command\"\n        output_regexp = \"^some (value1) and some other (value2)$\"\n        read_command = \"/path/to/command with args\"\n        write_command = \"echo ${my_port1} ${my_port2}\"\n        ports = [\n            {id = \"my_port1\", type = \"boolean\"}\n            {id = \"my_port2\", type = \"number\"}\n            ...\n        ]\n        port = {\n            id = \"my_port\"\n            type = \"boolean\"\n        }\n        timeout = 5\n    },\n    ...\n]\n...\n```\n\n`name` is an optional name that will be used as a prefix for all ports.\n\n`read_command` sets a command to be executed to determine the value of ports. If this parameter is not specified, no\npolling is done and the values will only be set to what is written to the ports.\n\nIf `output_regexp` is specified, output of `read_command` is parsed against it as a regular expression. Following rules\napply:\n\n * If output does not match the regular expression, all port values will be set to `null`.\n * The port values will be determined in order of the indicated groups. If no group is defined, the entire output will\nbe used to determine the value of all ports.\n * For boolean ports, text `true` (case-insensitive) or any other non-zero decimal number represents `true`.\n * For number ports, matched group content will be converted to float. \n\nIf `output_regexp` is not specified, exit code of `read_command` will be used to determine port values. An exit code of\n`0` represents `true` for all boolean ports, while any other exit code represents `false`. All number ports will use\nexit code as their value.\n\nThe `write_command` parameter, if specified, sets a command that will be called whenever the port value changes. The new\nport values will be supplied in environment variables with names corresponding to port ids. Any dots in port ids will be\nconverted to underscores. Boolean values will be transmitted as `0` and `1`. All port values will be available,\nregardless of which one has changed.\n\nIf `write_command` is not specified, all ports will be read-only.\n\n`ports` is a list of ports to be exposed. If you only need one port, use the `port` shortcut parameter.\n\nUse the `timeout` parameter to set a timeout when waiting for the commands to complete, in seconds.\n\nAlthough using blocking commands will not block the server, it is recommended that you supply commands that don't block.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqtoggle%2Fqtoggleserver-cmdline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqtoggle%2Fqtoggleserver-cmdline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqtoggle%2Fqtoggleserver-cmdline/lists"}