{"id":13903058,"url":"https://github.com/DieTime/cli-autocomplete","last_synced_at":"2025-07-18T00:33:08.900Z","repository":{"id":139648769,"uuid":"283278493","full_name":"DieTime/cli-autocomplete","owner":"DieTime","description":"Cross-platform flexible autocomplete library for your cli applications.","archived":false,"fork":false,"pushed_at":"2021-09-26T13:10:01.000Z","size":9368,"stargazers_count":36,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-07T22:35:38.423Z","etag":null,"topics":["autocomplete","autocompletion","cli","cli-applications","console","cross-platform","crossplatform","hint","library","prompt","terminal"],"latest_commit_sha":null,"homepage":"","language":"C","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/DieTime.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2020-07-28T17:13:03.000Z","updated_at":"2024-05-14T18:10:54.000Z","dependencies_parsed_at":"2024-01-16T22:18:07.067Z","dependency_job_id":"c6ffe5eb-30d6-49bb-8487-c5e3a2e55e42","html_url":"https://github.com/DieTime/cli-autocomplete","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DieTime%2Fcli-autocomplete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DieTime%2Fcli-autocomplete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DieTime%2Fcli-autocomplete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DieTime%2Fcli-autocomplete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DieTime","download_url":"https://codeload.github.com/DieTime/cli-autocomplete/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226320870,"owners_count":17606370,"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":["autocomplete","autocompletion","cli","cli-applications","console","cross-platform","crossplatform","hint","library","prompt","terminal"],"created_at":"2024-08-06T22:01:35.597Z","updated_at":"2024-11-25T11:31:14.157Z","avatar_url":"https://github.com/DieTime.png","language":"C","funding_links":["https://www.buymeacoffee.com/glazzkoff"],"categories":["cli"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.ibb.co/41pL50L/Group-1.png\" width=\"400\" alt=\"logo\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/version-2.0.1-b.svg\" alt=\"version\"\u003e\n\u003c/p\u003e\n\n### About\nCross-platform flexible autocomplete library for your CLI applications\n\n\u003cimg src=\"assets/preview.gif\" alt=\"preview gif\" width=\"500\"\u003e\n\n### Features\n- Cross-platform: `MacOS`, `Linux`, `Windows`\n- Write your own autocomplete rules\n- Setup your own highlight colors\n- `single header` version of the library\n- `static` and `dynamic` versions of the library\n\n### Config Example\n1. After `git` may follow: `config`, `init`, `clone`\n2. After `config` may follow: `--global`, `user.name`, `user.email`\n3. After `--global` may follow: `user.name`, `user.email`\n4. After `user.name` may follow optional value: `\"[name]\"`\n5. `...`\n```\ngit\n    config\n        --global\n            user.name\n                \"[name]\"\n            user.email\n                \"[email]\"\n        user.name\n            \"[name]\"\n        user.email\n            \"[email]\"\n    init\n        [repository_name]\n    clone\n        [url]\n```\n\n### Simple Example\n\u003e More complex example with: `color settings`, `handling optional values` and `line title configuration` [you will find here](examples/custom_input.c)\n```cpp\n#include \u003cstdio.h\u003e\n\n#include \"../include/autocomplete.h\"\n\nint main() {\n    // Parsing the configuration file\n    Tree* rules = tree_create(\"../example.config\");\n\n    fprintf(\n        stderr,\n        \"Attention! Please run the executable file only\\n\"\n        \"           through the command line!\\n\\n\"\n\n        \"- To switch the prompts press UP or DOWN arrow.\\n\"\n        \"- To move cursor press LEFT or RIGHT arrow.\\n\"\n        \"- To edit input press DELETE or BACKSPACE key.\\n\"\n        \"- To apply current prompt press TAB key.\\n\\n\"\n    );\n\n    // Listening process\n    while (1) {\n        // Get user input\n        char* str = input(rules);\n        printf(\"\\n%s\\n\", str);\n\n        // Stop listening if user need\n        if (strcmp(str, \"\") == 0) {\n            free(str);\n            break;\n        }\n\n        // Free user input string\n        free(str);\n    }\n\n    // Free rules\n    tree_free(rules);\n\n    return 0;\n}\n```\n\n### How to start\n```bash\ngit clone https://github.com/DieTime/CLI-AutoComplete.git\ncd CLI-AutoComplete/\n\ncmake -DCMAKE_BUILD_TYPE=Release -S . -B ./cmake-build\ncmake --build ./cmake-build --config Release\n\n----------------------- RUN EXAMPLE ---------------------\n\n# Unix\ncd builds/examples/unix/Release\n./custom_example\n\n# MinGW\ncd builds/examples/mingw/Release\ncustom_example.exe\n\n# MSVC\ncd builds/examples/msvc/Release\ncustom_example.exe\n```\n\n### Linking a shared library [[Releases]](https://github.com/DieTime/CLI-Autocomplete/releases/tag/v2.0.0-shared)\n\n##### Unix\n```bash\ngcc -o \u003cexecutable\u003e \u003cpaths/of/source/files\u003e -L\u003cpath/to/shared/lib/folder\u003e -I\u003cpath/to/include/folder\u003e -lcliac -Wl,-rpath,\u003cpath/to/shared/lib/folder\u003e\n```\n\n##### Windows MSVC from VS Command Prompt\n```cmd\ncl /EHsc \u003cpaths/of/source/files\u003e /Fe\u003cexecutable\u003e.exe /I\u003cpath/to/include/folder\u003e /link \u003cpath/to/shared/lib/file(.lib)\u003e\n```\n\n##### Windows MinGW\n```cmd\ngcc -o \u003cexecutable\u003e.exe \u003cpaths/of/source/files\u003e -L\u003cpath/to/shared/lib/folder\u003e -I\u003cpath/to/include/folder\u003e -lcliac\n```\n\n### Linking a static library [[Releases]](https://github.com/DieTime/CLI-Autocomplete/releases/tag/v2.0.0-static)\n\n##### Unix\n```bash\ngcc -o \u003cexecutable\u003e \u003cpaths/of/source/files\u003e -L\u003cpath/to/static/lib/folder\u003e -I\u003cpath/to/include/folder\u003e -lcliac\n```\n\n##### Windows MSVC from VS Command Prompt\n```cmd\ncl /EHsc \u003cpaths/of/source/files\u003e /Fe\u003cexecutable\u003e.exe /I\u003cpath/to/include/folder\u003e /link \u003cpath/to/static/lib/file(.lib)\u003e\n```\n\n##### Windows MinGW\n```cmd\ngcc -o \u003cexecutable\u003e.exe \u003cpaths/of/source/files\u003e -L\u003cpath/to/static/lib/folder\u003e -I\u003cpath/to/include/folder\u003e -lcliac\n```\n\n### About changes\n\u003e A detailed description of the changes can be found in [CHANGELOG.md](CHANGELOG.md)\n\n### Support the author\nYou can support me so that there will be more good open source projects in the future\n\u003cp align=\"center\" style=\"padding: 10px 0 20px 0\"\u003e\n  \u003ca href=\"https://www.buymeacoffee.com/glazzkoff\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"50\" width=\"220\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDieTime%2Fcli-autocomplete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDieTime%2Fcli-autocomplete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDieTime%2Fcli-autocomplete/lists"}