{"id":26326298,"url":"https://github.com/harehare/cnip","last_synced_at":"2026-02-28T15:01:32.022Z","repository":{"id":198892363,"uuid":"701757332","full_name":"harehare/cnip","owner":"harehare","description":"cnip is a simple command-line snippet management tool.","archived":false,"fork":false,"pushed_at":"2025-07-12T10:57:14.000Z","size":3409,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T15:40:01.799Z","etag":null,"topics":["cli","command-line","command-line-tool","fuzzy-search","rescript","snippets"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cnip-snippet","language":"ReScript","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/harehare.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-07T13:19:17.000Z","updated_at":"2025-07-12T10:57:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"8900ef36-f086-4b9c-a858-f912552e429c","html_url":"https://github.com/harehare/cnip","commit_stats":null,"previous_names":["harehare/cnip"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/harehare/cnip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fcnip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fcnip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fcnip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fcnip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harehare","download_url":"https://codeload.github.com/harehare/cnip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fcnip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29938968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:49:17.081Z","status":"ssl_error","status_checked_at":"2026-02-28T13:48:50.396Z","response_time":90,"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":["cli","command-line","command-line-tool","fuzzy-search","rescript","snippets"],"created_at":"2025-03-15T19:36:19.727Z","updated_at":"2026-02-28T15:01:32.009Z","avatar_url":"https://github.com/harehare.png","language":"ReScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cnip - Command-line Snippet CLI Manager\n\ncnip manages shell command snippets from the command line.\n\n![image](./assets/demo.gif)\n\n## Install\n\n```bash\n$ npm i -g cnip-snippet\n```\n\n## Usage\n\n```\nUSAGE:\n    cnip [COMMAND]\n\nAVAILABLE COMMANDS:\n    list                     Show all snippets\n    add                      Add a new snippet\n    edit                     Edit snippet\n    del                      Delete snippet\n    import                   Import snippets\n    sync                     Sync snippets\n    version                  Print version\n\nOPTIONS:\n    -c                       Copy selected command to clipboard\n    --snippet [STRING]       snippet file (default is $HOME/./config/cnip/snippet.json)\n    --input [STRING]         Reads the specified text file into the command list (e.g. $HISTFILE, etc.)\n    --tag [STRING]           Specify the tag to be selected for initial display\n    --select [STRING]        Display aliases and commands that match the specified text\n    --pet-snippet [STRING]   Read Pet snippet file\n    -h                       Print Help\n```\n\n## Features\n\n- Store shell command snippets\n- Fuzzy search with edit, delete and clipboard copy\n- Tag-based organization\n- Import from shell history, Pet snippets, and Navi cheatsheets\n- GitHub Gist synchronization\n\n### Shell commands\n\n#### bash\n\n```bash\nfunction cmd-select() {\n  if [ \"$READLINE_LINE\" = \"\" ]; then\n    BUFFER=$(cnip --input $HISTFILE -s usage-count --query \"$READLINE_LINE\")\n  else\n    BUFFER=$(cnip --input $HISTFILE -s usage-count)\n  fi\n  READLINE_LINE=\"$BUFFER\"\n  READLINE_POINT=${#BUFFER}\n}\nbind -x '\"\\C-r\": cmd-select'\n```\n\n#### zsh\n\n```bash\nfunction cmd-select() {\n  if [[ \"$LBUFFER\" == \"\" ]] then\n    BUFFER=$(cnip --input \"$HISTFILE\" -s \"usage-count\")\n  else\n    BUFFER=$(cnip --input \"$HISTFILE\" -s \"usage-count\" --query \"$LBUFFER\")\n  fi\n\n  CURSOR=$#BUFFER\n  zle redisplay\n}\n\nfunction cmd-expand() {\n  if [[ \"$LBUFFER\" != \"\" ]] then\n    BUFFER=$(cnip --select \"$LBUFFER\")\n  fi\n\n  CURSOR=$#BUFFER\n  zle redisplay\n}\n\nzle -N cmd-select\nzle -N cmd-expand\nbindkey '^r' cmd-select\nbindkey '^e' cmd-expand\n```\n\n### Sync to Gist\n\nRequires a GitHub access token with \"gist\" scope.\n\nSet the `CNIP_GITHUB_GIST_ACCESS_TOKEN` environment variable to your token.\n\n## Customization\n\nConfigure display colors with these environment variables:\n\n```bash\nCNIP_HIGHLIGHT_COLOR=\"#FFBC00\"\nCNIP_CURRENT_LINE_COLOR=\"#FFBC00\"\nCNIP_PROMPT_COLOR=\"#6E4BEC\"\nCNIP_TEXT_COLOR=\"#D4D7DC\"\nCNIP_SELECTED_COLOR=\"#008000\"\nCNIP_SELECTED_TAB_COLOR=\"#6E4BEC\"\nCNIP_TAB_COLOR=\"#A9A9A9\"\nCNIP_POINTER_COLOR=\"#6E4BEC\"\nCNIP_BORDER_COLOR=\"#ADADAD\"\nCNIP_DESCRIPTION_COLOR=\"#3BBFBF\"\nCNIP_CURRENT_LINE_COLOR=\"#6E4BEC\"\nCNIP_SHOW_ICONS=\"1\"\n```\n\n## Build\n\n- Build: `npm run build`\n- Clean: `npm run clean`\n- Build \u0026 watch: `npm run dev`\n\n## Run\n\n```sh\nnode src/Index.bs.js\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharehare%2Fcnip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharehare%2Fcnip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharehare%2Fcnip/lists"}