{"id":17526982,"url":"https://github.com/dave1010/clipea","last_synced_at":"2025-04-05T17:07:51.194Z","repository":{"id":195862093,"uuid":"692451045","full_name":"dave1010/clipea","owner":"dave1010","description":"📎🟢 Like Clippy but for the CLI. A blazing fast AI helper for your command line","archived":false,"fork":false,"pushed_at":"2024-01-31T17:10:53.000Z","size":63,"stargazers_count":284,"open_issues_count":11,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-03-14T22:10:27.802Z","etag":null,"topics":["ai","hacktoberfest","llm","terminal","zsh"],"latest_commit_sha":null,"homepage":"","language":"Python","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/dave1010.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}},"created_at":"2023-09-16T14:16:17.000Z","updated_at":"2024-03-10T05:48:26.000Z","dependencies_parsed_at":"2023-11-08T23:25:07.634Z","dependency_job_id":"d3d4f76e-85fa-464b-8a5a-d71be9bc39b5","html_url":"https://github.com/dave1010/clipea","commit_stats":null,"previous_names":["dave1010/clipea"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave1010%2Fclipea","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave1010%2Fclipea/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave1010%2Fclipea/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dave1010%2Fclipea/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dave1010","download_url":"https://codeload.github.com/dave1010/clipea/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369952,"owners_count":20927928,"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":["ai","hacktoberfest","llm","terminal","zsh"],"created_at":"2024-10-20T15:02:41.077Z","updated_at":"2025-04-05T17:07:51.177Z","avatar_url":"https://github.com/dave1010.png","language":"Python","readme":"# Clipea 📎🟢\n\n[![Install with pip](https://img.shields.io/badge/Install_with-pip-blue)](https://pypi.org/project/clipea-cli/)\n[![PyPI](https://img.shields.io/pypi/v/clipea-cli.svg)](https://pypi.org/project/clipea-cli/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/clipea-cli)](https://pypi.org/project/clipea-cli/)\n[![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/dave1010/clipea/python-app.yml)](https://github.com/dave1010/clipea/actions)\n\n\n**Like Clippy but for the CLI. A blazing fast AI helper for your command line.**\n\nClipea is a streamlined, cheap and hackable tool that integrates GPT with your console.\nIt's like Github's [Copilot for CLI](https://githubnext.com/projects/copilot-cli) but it's cheaper, faster and doesn't get in your way.\n\nTell Clipea what you want to do and it'll give you a shell command, asking you if you want to run it. Clipea works even better with Zsh, as it adds the shell command to your console as a pending command, just as if you had typed it yourself!\n\n![clipea-gif](https://github.com/dave1010/clipea/assets/50682/9aae6c64-2d09-4e7f-9d86-4d82dd4bc076)\n\nClipea was born out of [Hubcap](https://github.com/dave1010/hubcap), an experimental autonomous agent.\nClipea is less dangerous and actually designed to be a usable productivity tool, rather than just a tech demo.\n\nAdvantages over copying and pasting from ChatGPT:\n\n* Speed. No need to switch to your browser and back\n* Shell integration, like filename completion\n* Automatically knows things like your shell and OS\n\n\u003e [!CAUTION]\n\u003e AI isn't perfect. Clipea might suggest a dangerous command. Be careful.\n\n## 🚀 Quick Start\n\n    pipx install clipea-cli\n    clipea setup\n    clipea alias\n\n## 🪄 Usage\n\nOnce installed, just ask Clipea for a command:\n\n    clipea convert test.mp4 to a gif\n\nType `y\u003center\u003e` to run the command. Anything else or `\u003cctrl-c\u003e` to cancel.\n\nOr, if you have the Zsh integration (highly recommended), it's even easier:\n\n    ?? how many gig free do i have\n\nJust press `\u003center\u003e` to run the command or `\u003cbackspace\u003e` if you want to edit it.\n\nClipea works best when you give it a task to complete, rather than a question: LLMs love explaining things whenever you're not sure.\n\n### ❓❓ Using the Zsh shell integration (recommended)\n\nThe Zsh integration is more than just a quick alias.\nIt allows Clipea to put the command in your input buffer, ready to run, just as if you'd typed it yourself.\n\n    # setup\n    clipea alias\n\n    # usage\n    ?? how many gig free do i have\n\nBenefits:\n\n* Quicker to type\n* Shows up in your shell history\n* Allows editing with normal shell commands like `\u003cctrl-c\u003e` to cancel or `\u003cctrl-a\u003e` to go to the start of the line\n* Runs the command as a child process of your shell, rather than a child of Clipea\n\nBehind the scenes this is using zsh's [`print -z`](https://gist.github.com/YumaInaura/2a1a915b848728b34eacf4e674ca61eb#print--z).\n\n### 🧙 Advanced usage and tips\n\n#### GPT-4 mode\n\nJust start the query with a \"4\". Remember that OpenAI charge lots more for GPT-4.\nGenerally the standard GPT-3.5 is fine for commandline stuff.\n\n    ?? 4 create a text file explaining quantum mechanics in a haiku in the style of a pirate\n\n#### Getting data from stdin\n\nYou can also send in data via stdin. Clipea limits you to 8192 bytes, so the LLM isn't overwhelmed.\n\n    ls -F | ?? explain this project setup\n\nMost of the time it's best to give Clipea a filename to create a command for, rather than the actual file contents.\n\n    cat package.json | ?? how many packages here     # GPT isn't great at counting\n    ?? count how many packages are in package.json   # GPT is good at suggesting commands\n\n#### Environment\n\nClipea gets given some environment limited information like your OS, shell and path.\nThis allows it to give better responses.\n\n    ?? wheres my shell config\n    ?? install curl\n    ?? compare README.md to my clipboard\n\n#### Custom Prompt\n\nYou can customize your prompt by creating a prompt file in your home directory.\n\n    ~/.config/clipea/system-prompt.txt\n\nYou might wanna start by copying the default prompt:\n\n    cp $(dirname $(readlink -f $(which clipea)))/system-prompt.txt ~/.config/clipea/system-prompt.txt\n\nThen edit `~/.config/clipea/system-prompt.txt` to your liking, but be aware that environment info is always added to the end of the prompt.\n\n### ⤴️ Feedback and editing\n\nJust use your shell history by pressing the `\u003cup\u003e` arrow key. Your cursor will be at the end of\nthe last line, ready to edit it.\n\nFor example: typing `?? list js files recursively` may give\n\n    $ find . -name \"*.js\"\n\nThen to edit, press `\u003cup\u003e` then ` ignore node modules` to get something like\n\n    $ find . -name \"*.js\" -not -path \"./node_modules/*\"\n\nClipea doesn't have any context of what it said before, though this may be added in the future if there's use cases it helps with.\n\n### More examples\n\n#### System Operations\n\n    ?? open my shell login script in my editor\n    ?? Extract package.tar.gz\n    ?? Install something that converts pdf to text\n    ?? Make a 30 char password\n\n#### File Operations\n\n    ?? Find files bigger than 10mb\n    ?? Rename all txt files space to underscore\n    ?? Convert file.avi to gif\n    ?? Decrypt data.txt.gpg\n\n#### Text Files and Coding\n\n    ?? Highlight URLs in index.html\n    ?? Show me just the headings from README.md\n    ?? count loc recursively\n    ?? Find replace all PHP files in project that call eval function with safe_eval\n    ?? git fetch, rebase master, safely force push\n    ?? turn orders.csv into sqlite\n    ?? count payments in orders.db\n\n#### Web and Network Tasks\n\n    ?? open bbc news\n    ?? check the spf record for example.com\n    ?? What port is my webserver listening on\n    ?? Check cors headers for api.example.com\n    ?? Where is nginx writing logs\n    ?? Quick http server\n\n## 📦 Installation and setup\n\n### Manual installation\n\nPython \u003e=3.10 is required.\n\nYou can use the provided `setup.py`. ([setuptools docs](https://setuptools.pypa.io/en/latest/deprecated/easy_install.html))\n\nYou can install it quickly like so:\n\n    python3 setup.py sdist\n    pip install dist/clipea-{version}.tar.gz\n\nOr development mode:\n\n    pip install -e .\n\n### With PyPi\n\n    pipx install clipea-cli\n\n### Zsh Shell integration and Alias\n\n\u003e [!TIP]\n\u003e The `??` shell alias is highly recommended if you use zsh\n\n    clipea alias\n\n## Internals\n\nClipea is written in Python (3.10+).\n\nClipea uses [llm](https://github.com/simonw/llm) to interact with large language models.\n\nBy default it will use OpenAI's GPT-3.5 model but can be configured to other models, such as Llama.\nRunning `clipea setup` will talk you through getting OpenAI keys.\n\n## ❗ Warnings\n\n### Safety\n\n\u003e [!CAUTION]\n\u003e Always read and check what Clipea suggests before accepting it.\n\n![destroy all humans](https://github.com/dave1010/clipea/assets/50682/afa819bd-a8cc-4968-973f-9b99ceaab5b4)\n\n### Privacy\n\nClipea uses OpenAI's APIs by default, though can be set to use any LLM that `llm` supports.\n\nOnly very basic environment info like your OS and editor is sent to the LLM.\nRun `clipea env` to see the data the LLM gets.\n\n### Cost\n\nAs a very rough example, using the default GPT-3.5, 100 Clipea queries to OpenAI cost $0.02.\nSet a quota and keep an eye on costs to make sure.\n\n## Acknowledgements\n\nBig thanks to @edouard-sn for the port to Python.\n\n## Contributors\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/dave1010\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/50682?v=4?s=100\" width=\"100px;\" alt=\"Dave Hulbert\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDave Hulbert\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#code-dave1010\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-dave1010\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"#maintenance-dave1010\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/edouard-sn\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/58398928?v=4?s=100\" width=\"100px;\" alt=\"Edouard SENGEISSEN\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eEdouard SENGEISSEN\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#code-edouard-sn\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-edouard-sn\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"#maintenance-edouard-sn\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"#platform-edouard-sn\" title=\"Packaging/porting to new platform\"\u003e📦\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/b-boehne\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/53817118?v=4?s=100\" width=\"100px;\" alt=\"b-boehne\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eb-boehne\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#code-b-boehne\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-b-boehne\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/antwxne\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/59999873?v=4?s=100\" width=\"100px;\" alt=\"Antoine D.\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAntoine D.\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#review-antwxne\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/lucaspar\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7535699?v=4?s=100\" width=\"100px;\" alt=\"Lucas Parzianello\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLucas Parzianello\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#doc-lucaspar\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://darkstarsystems.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/139975?v=4?s=100\" width=\"100px;\" alt=\"Gary Oberbrunner\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGary Oberbrunner\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#code-garyo\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/vividfog\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/75913791?v=4?s=100\" width=\"100px;\" alt=\"vividfog\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003evividfog\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#userTesting-vividfog\" title=\"User Testing\"\u003e📓\u003c/a\u003e \u003ca href=\"#ideas-vividfog\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## License\n\nMIT License\n\nCopyright (c) 2023 Dave Hulbert\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdave1010%2Fclipea","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdave1010%2Fclipea","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdave1010%2Fclipea/lists"}