{"id":34456605,"url":"https://github.com/shanemcd/ai-cmd","last_synced_at":"2025-12-27T01:52:36.388Z","repository":{"id":328360231,"uuid":"1114656998","full_name":"shanemcd/ai-cmd","owner":"shanemcd","description":"Zsh plugin to generate shell commands from natural language using local LLMs via ollama","archived":false,"fork":false,"pushed_at":"2025-12-12T16:00:31.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-14T07:13:45.711Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/shanemcd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-12-11T17:31:42.000Z","updated_at":"2025-12-12T16:00:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/shanemcd/ai-cmd","commit_stats":null,"previous_names":["shanemcd/ai-cmd"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/shanemcd/ai-cmd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanemcd%2Fai-cmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanemcd%2Fai-cmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanemcd%2Fai-cmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanemcd%2Fai-cmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shanemcd","download_url":"https://codeload.github.com/shanemcd/ai-cmd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanemcd%2Fai-cmd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27978257,"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","status":"online","status_checked_at":"2025-12-23T02:00:07.087Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-12-22T23:00:21.266Z","updated_at":"2025-12-23T14:01:09.230Z","avatar_url":"https://github.com/shanemcd.png","language":"Shell","readme":"# ai-cmd\n\nZsh plugin to generate shell commands from natural language using LLMs via [Claude Code](https://docs.anthropic.com/en/docs/claude-code) or [Ollama](https://ollama.ai/).\n\n## Installation\n\n### Oh My Zsh\n\n```bash\ngit clone https://github.com/shanemcd/ai-cmd.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/ai-cmd\n```\n\nAdd `ai-cmd` to your plugins in `~/.zshrc`:\n\n```bash\nplugins=(... ai-cmd)\n```\n\n### Manual\n\nClone the repo and source the plugin in your `~/.zshrc`:\n\n```bash\ngit clone https://github.com/shanemcd/ai-cmd.git ~/.zsh/ai-cmd\necho 'source ~/.zsh/ai-cmd/ai-cmd.plugin.zsh' \u003e\u003e ~/.zshrc\n```\n\n## Configuration\n\nSet these environment variables **before** the plugin loads (before `source $ZSH/oh-my-zsh.sh`):\n\n```bash\n# Backend to use: \"ollama\" or \"claude\" (default: \"ollama\")\nexport AI_CMD_BACKEND=\"ollama\"\nexport AI_CMD_BACKEND=\"claude\"\n\n# Ollama configuration\nexport AI_CMD_OLLAMA_CMD=\"ollama\"                          # default\nexport AI_CMD_OLLAMA_CMD=\"podman exec systemd-ollama ollama\"  # containerized\nexport AI_CMD_OLLAMA_CMD=\"ssh server ollama\"               # remote\nexport AI_CMD_OLLAMA_MODEL=\"rnj-1:8b\"                      # default\nexport AI_CMD_OLLAMA_MODEL=\"llama3.2:3b\"\n\n# Claude configuration\nexport AI_CMD_CLAUDE_CMD=\"claude\"                          # default\nexport AI_CMD_CLAUDE_MODEL=\"sonnet\"                        # optional\nexport AI_CMD_CLAUDE_MODEL=\"opus\"\n\n# Keybinding for ai-insert widget (default: \"^[a\" / Alt+a)\nexport AI_CMD_KEYBINDING=\"^[a\"   # Alt+a\nexport AI_CMD_KEYBINDING=\"^xa\"   # Ctrl+x, a\nexport AI_CMD_KEYBINDING=\"\"      # Disable keybinding\n\n# Custom system prompt (optional)\nexport AI_CMD_SYSTEM_PROMPT=\"Your custom prompt here...\"\n```\n\n## Usage\n\n### `ai` function\n\nGenerate a command from natural language:\n\n```bash\n# With arguments\nai list all docker containers sorted by size\n\n# Interactive prompt\nai\n# Then type: \"find all .py files modified in the last week\"\n```\n\nThe command is printed to stdout, so you can:\n\n```bash\n# Just see the suggestion\nai show disk usage by directory\n\n# Execute directly (use with caution!)\n$(ai show disk usage by directory)\n\n# Copy to clipboard\nai show disk usage by directory | xclip -selection clipboard\n```\n\n### `ai-insert` widget (Alt+a)\n\n1. Type your natural language prompt: `find large files over 100mb`\n2. Press `Alt+a` (or your configured keybinding)\n3. Your text is replaced with the generated command\n4. Edit if needed, then press Enter to execute\n\n## Requirements\n\nOne of the following:\n\n- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated (`claude` CLI)\n- [Ollama](https://ollama.ai/) running locally or accessible via your configured command, with a model pulled (e.g., `ollama pull qwen2.5:7b`)\n\nThe plugin defaults to Ollama. Set `AI_CMD_BACKEND=claude` to use Claude Code instead.\n\n## License\n\nMIT\n","funding_links":[],"categories":["Plugins"],"sub_categories":["ZSH on Windows"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanemcd%2Fai-cmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshanemcd%2Fai-cmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanemcd%2Fai-cmd/lists"}