{"id":13423327,"url":"https://github.com/rudihorn/light-cli","last_synced_at":"2025-03-15T17:31:39.866Z","repository":{"id":62442221,"uuid":"133220329","full_name":"rudihorn/light-cli","owner":"rudihorn","description":"A simple heapless command line interface parser for embedded devices","archived":false,"fork":false,"pushed_at":"2019-03-15T14:53:57.000Z","size":2710,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T15:03:12.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rudihorn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-13T08:51:47.000Z","updated_at":"2023-02-27T17:38:35.000Z","dependencies_parsed_at":"2022-11-01T22:02:06.706Z","dependency_job_id":null,"html_url":"https://github.com/rudihorn/light-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudihorn%2Flight-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudihorn%2Flight-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudihorn%2Flight-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudihorn%2Flight-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rudihorn","download_url":"https://codeload.github.com/rudihorn/light-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243766788,"owners_count":20344812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-07-31T00:00:30.977Z","updated_at":"2025-03-15T17:31:39.265Z","avatar_url":"https://github.com/rudihorn.png","language":"Rust","readme":"# `light-cli`\r\n\r\nA lightweight and heapless command line interface / command passing tool. Probably more useful for machine to machine communication.\r\n\r\n## [Documentation](https://rudihorn.github.io/light-cli/light_cli/)\r\n\r\n## [Example]\r\n\r\nThe following definition allows for the commands:\r\n* `HELLO Name=\u003cName\u003e`: Set the name to `\u003cName\u003e`\r\n* `EHLO`: Return the name\r\n\r\n```\r\nlightcli!(cl_in, cl_out, cmd, key, val, [\r\n  \"HELLO\" =\u003e [\r\n    \"Name\" =\u003e name = String::from(val)\r\n  ] =\u003e { writeln!(cl_out, \"Name set\").unwrap(); };\r\n  \"EHLO\" =\u003e [\r\n  ] =\u003e { writeln!(cl_out, \"EHLO Name={}\", name.as_str()).unwrap(); }\r\n]);\r\n```\r\n\r\nA typical serial communication could look like:\r\n\r\n```\r\n\u003e\u003e EHLO\r\n\u003c\u003c EHLO Name=\r\n\u003e\u003e HELLO Name=Johnson\r\n\u003c\u003c Name set\r\n\u003e\u003e EHLO\r\n\u003c\u003c EHLO Name=Johnson\r\n```\r\n\r\nIt is recommended to use this in conjunction with the program [`rlwrap`](https://linux.die.net/man/1/rlwrap).\r\n\r\n[Complete Example](https://github.com/rudihorn/light-cli/tree/master/examples/)\r\n\r\n## What works\r\n\r\n- Read key value style commands in the form:\r\n  `COMMAND KEY=VALUE`\r\n- UTF-8 encoding.\r\n- Specify the heapless string length.\r\n- Partial command evaluation as data is received through the serial connection.\r\n\r\n## TODO\r\n\r\n- [X] Writing to output\r\n- [ ] Improve UTF-8 error detection / code.\r\n- [ ] Any form of autocompletion / backspaces etc.\r\n\r\n## License\r\n\r\nLicensed under either of\r\n\r\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\r\n  http://www.apache.org/licenses/LICENSE-2.0)\r\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\r\n  at your option.\r\n\r\n### Contribution\r\n\r\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the\r\nwork by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\r\nadditional terms or conditions.\r\n\r\n","funding_links":[],"categories":["no-std crates"],"sub_categories":["WIP"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudihorn%2Flight-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frudihorn%2Flight-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudihorn%2Flight-cli/lists"}