{"id":13782696,"url":"https://github.com/noahp/nocli","last_synced_at":"2025-12-26T09:16:32.143Z","repository":{"id":150640437,"uuid":"77239596","full_name":"noahp/nocli","owner":"noahp","description":"Command-line interpreter for embedded systems","archived":false,"fork":false,"pushed_at":"2023-01-06T16:33:43.000Z","size":86,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-03T18:16:47.229Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","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/noahp.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-12-23T17:04:46.000Z","updated_at":"2021-10-18T22:23:44.000Z","dependencies_parsed_at":"2023-05-26T22:45:17.492Z","dependency_job_id":null,"html_url":"https://github.com/noahp/nocli","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/noahp%2Fnocli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahp%2Fnocli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahp%2Fnocli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahp%2Fnocli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noahp","download_url":"https://codeload.github.com/noahp/nocli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225068726,"owners_count":17416123,"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-08-03T18:01:41.968Z","updated_at":"2025-12-26T09:16:32.137Z","avatar_url":"https://github.com/noahp.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# no-cli\n\n[![GitHub](https://img.shields.io/badge/GitHub-noahp%2Fnocli-8da0cb?style=for-the-badge\u0026logo=github)](https://github.com/noahp/nocli)\n\n[![Build Status](https://img.shields.io/travis/noahp/nocli.svg?style=for-the-badge)](https://travis-ci.org/noahp/nocli)\n[![Codecov](https://img.shields.io/codecov/c/github/noahp/nocli.svg?style=for-the-badge)](https://codecov.io/gh/noahp/nocli)\n[![C99](https://img.shields.io/badge/language-C99-blue.svg?style=for-the-badge)](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf)\n\nCheesy command line interpreter designed for tiny memory-constrained systems.\nMinimal dependencies: just string.h.\n\n## Features\n\n- low footprint; the library is \\~**600 bytes** `.text` (\\~**335 bytes** under\n  minimal configuration), and uses a (configurable) 128 byte buffer (`.bss`) and\n  24 byte (`.data`) context structure.\n\n  ```bash\n  ❯ arm-none-eabi-gcc -DNOCLI_RUNTIME_ECHO_CONTROL=0 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -Os -Itest -c nocli.c -o nocli.o\n  ❯ arm-none-eabi-size nocli.o\n      text    data     bss     dec     hex filename\n      546       0       0     546     222 nocli.o\n  ```\n\n- incremental parsing of input stream\n- static memory usage\n- supports doubly- and singly- quoted args (can be disabled to save ~100 bytes)\n- 100% test coverage\n- fuzz tested via LibFuzzer\n\nPossible future features, if I need them:\n\n- UNIMPLEMENTED optional tab completion or history?\n\n## Usage\n\n### Example\n\nSee [`test/example.c`](test/example.c) for an example that runs on host.\n\nYou can try the example by building it and running it:\n\n```bash\n# build\n❯ make -f test/Makefile\nCompiling nocli.c\nCompiling test/example.c\nLinking build/example/example\n\n# run\n❯ ./build/example/example\n\nnocli$ help\n\n?\nhelp\ncount-args      print number of args passed\nchange-prompt   set prompt to new string\nnocli$ count-args 1 2 3\nArg count: 3\n\nnocli$\n```\n\n### Integration\n\nAPI is documented in [`nocli.h`](nocli.h). There's only two functions used:\n\n1. initialize the library: `void Nocli_Init(struct Nocli *nocli);`\n   \u003e this includes a callback for outputting data and the table of commands.\n2. pass any amount of data: `void Nocli_Feed(struct Nocli *nocli, const char *input, size_t length);`\n   \u003e commands are executed within this function, so be sure to call it in a safe context\n\n## libfuzzer crashes\n\nRun libfuzzer with `make -f test/Makefile fuzz`; it will run continuously until\na crash occurs (`AddressSanitizer` and `UndefinedBehaviorSanitizer` are enabled\non the fuzz build)\n\nCrashes that libfuzzer finds are saved in [test/corpus](test/corpus), which are\nrun through the library in ci to catch regressions.\n\n## License\n\nWTFPL (http://www.wtfpl.net/) or public domain, whichever you prefer.\n\n---\n\n## Alternatives!\n\nThis library conflates two operations:\n\n- line editing\n- command line argument parsing\n\nThere are a LOT of alternatives. Here's some commonly used ones:\n\n### Line editing\n\n- readline\n- linenoise\n\n### Argument parsing\n\n- getopt\n- argp\n- argparse3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoahp%2Fnocli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoahp%2Fnocli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoahp%2Fnocli/lists"}