{"id":29480969,"url":"https://github.com/diegodev2/cmdr.ai","last_synced_at":"2026-05-17T01:45:01.752Z","repository":{"id":303870909,"uuid":"1016917564","full_name":"DiegoDev2/cmdr.ai","owner":"DiegoDev2","description":"cmdr.ai is a smart terminal assistant that catches command errors and gives instant AI-powered solutions—making debugging fast and effortless.","archived":false,"fork":false,"pushed_at":"2025-07-09T23:06:00.000Z","size":7684,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-10T06:49:53.600Z","etag":null,"topics":["ai","cli","copilot","debugging","developer-experience","dx","errors","go","golang","gpt","logs","terminal"],"latest_commit_sha":null,"homepage":"","language":"Go","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/DiegoDev2.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}},"created_at":"2025-07-09T18:18:55.000Z","updated_at":"2025-07-09T23:06:04.000Z","dependencies_parsed_at":"2025-07-10T06:50:07.772Z","dependency_job_id":"bf186a27-df23-4ded-959a-cb25d7e880d5","html_url":"https://github.com/DiegoDev2/cmdr.ai","commit_stats":null,"previous_names":["diegodev2/cmdr.ai"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/DiegoDev2/cmdr.ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoDev2%2Fcmdr.ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoDev2%2Fcmdr.ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoDev2%2Fcmdr.ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoDev2%2Fcmdr.ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DiegoDev2","download_url":"https://codeload.github.com/DiegoDev2/cmdr.ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoDev2%2Fcmdr.ai/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265375446,"owners_count":23755234,"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","cli","copilot","debugging","developer-experience","dx","errors","go","golang","gpt","logs","terminal"],"created_at":"2025-07-14T23:55:13.440Z","updated_at":"2026-05-17T01:45:01.713Z","avatar_url":"https://github.com/DiegoDev2.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Cmdr](https://github.com/user-attachments/assets/3ba9909a-021f-4d5b-bef7-320b62357cf0)\n\n\n**cmdr.ai** is an AI-powered terminal copilot that automatically detects failed shell commands, analyzes errors using AI (OpenAI, OpenRouter, Ollama, etc.), and suggests practical fixes directly in your terminal. It is designed for developers and power users who want instant, actionable help when commands fail.\n\n\u003ca href=\"https://www.producthunt.com/products/cmdr-ai?embed=true\u0026utm_source=badge-featured\u0026utm_medium=badge\u0026utm_source=badge-cmdr\u0026#0045;ai\" target=\"_blank\"\u003e\u003cimg src=\"https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=990735\u0026theme=light\u0026t=1752098202344\" alt=\"cmdr\u0026#0046;ai - AI\u0026#0045;powered\u0026#0032;terminal\u0026#0032;copilot\u0026#0058;\u0026#0032;instant\u0026#0032;error\u0026#0032;fixes | Product Hunt\" style=\"width: 250px; height: 54px;\" width=\"250\" height=\"54\" /\u003e\u003c/a\u003e\n\n\nhttps://github.com/user-attachments/assets/5b845023-ace1-442c-bc43-a7afc44855de\n\n\n\n---\n\n## 🚀 Features\n\n- **Automatic error detection**: No need to wrap commands; integrates with your shell to detect failures.\n- **AI-powered suggestions**: Uses GPT or other models to analyze errors and provide concise, actionable solutions.\n- **Persistent logging**: Saves command logs (stdout, stderr, exit code, timestamp) in `./cmdr/` for auditing and review.\n- **Multi-provider support**: Works with OpenAI, OpenRouter, Ollama, and more.\n- **Flexible configuration**: Configure via `.cmdrconfig` or environment variables.\n- **Beautiful terminal output**: Colorful, clear suggestions and a loading spinner while waiting for AI.\n- **Extensible**: Modular design for adding new AI providers, shells, or features.\n\n---\n\n## 📦 Installation\n\n### 1. Install on Brew\nMacOS\n```sh\n  brew tap diegodev2/cmdr\n  brew install cmdr-ai\n```\n\n### 2. Clone and Build\n\n```sh\ngit clone https://github.com/youruser/cmdr.ai.git\ncd cmdr.ai\ngo build -o cmdr.ai main.go\n```\n\n### 2. (Optional) Install globally\n\n```sh\nsudo cp cmdr.ai /usr/local/bin/\n```\n\n---\n\n## ⚙️ Configuration\n\nYou can configure cmdr.ai using a `.cmdrconfig` file (recommended) or environment variables.\n\n### a) Using `.cmdrconfig`\nCreate a file named `.cmdrconfig` in your home directory (`~/.cmdrconfig`) or in your project root:\n\n```\napi_key=sk-...your_openai_key...\nmodel=gpt-4o-mini\nprovider=openai\nenabled=1\nlog_dir=./cmdr\n```\n\n- **api_key**: Your OpenAI or provider API key\n- **model**: Model to use (e.g., `gpt-4o-mini`, `gpt-3.5-turbo`)\n- **provider**: `openai`, `openrouter`, `ollama`, etc.\n- **enabled**: `1` or `true` to enable integration\n- **log_dir**: Directory for logs\n\n### b) Using environment variables\n\n```sh\nexport CMDRAI_API_KEY=sk-...your_openai_key...\nexport CMDRAI_MODEL=gpt-4o-mini\nexport CMDRAI_PROVIDER=openai\nexport CMDRAI_ENABLED=1\nexport CMDRAI_LOG_DIR=./cmdr\n```\n\n\u003e **Note:** `.cmdrconfig` takes precedence over environment variables if both are present.\n\n---\n\n## 🖥️ Shell Integration (Automatic Suggestions)\n\ncmdr.ai can automatically analyze failed commands and suggest fixes without manual invocation.\n\n### 1. Zsh (Recommended)\n\nRun:\n```sh\n./cmdr.ai init\n```\nThis will add the integration to your `~/.zshrc` automatically.\n\nOr, add manually to your `~/.zshrc`:\n```sh\nsource /absolute/path/to/cmdr.ai/shell/zsh.sh\n```\n\nThen reload your shell:\n```sh\nsource ~/.zshrc\n```\n\n### 2. Bash\n\nAdd to your `~/.bashrc`:\n```sh\nsource /absolute/path/to/cmdr.ai/shell/bash.sh\n```\nThen reload:\n```sh\nsource ~/.bashrc\n```\n\n---\n\n## 🛠️ Usage\n\n### Manual (for testing)\n```sh\n./cmdr.ai \u003cyour_command\u003e\n```\nExample:\n```sh\n./cmdr.ai ls /nonexistent\n```\n\n### Automatic (recommended)\nJust use your terminal as usual. When a command fails, cmdr.ai will analyze the error and print a suggestion automatically.\n\n---\n\n## 📑 Logging\n\n- All failed commands are logged in the `./cmdr/` directory (or as configured).\n- Each log file contains: command, stdout, stderr, exit code, timestamp, and the AI suggestion.\n\n---\n\n## 🔌 Extensibility\n\n- **AI Providers**: Add new providers in `internal/ai/` and update `.cmdrconfig`.\n- **Shells**: Add new shell hooks in `shell/`.\n- **Config**: Extend `.cmdrconfig` for more options.\n\n---\n\n## 🐞 Troubleshooting\n\n- **No suggestion from AI**: Check your API key, model, and quota. Try with `gpt-3.5-turbo` if `gpt-4o-mini` is unavailable.\n- **No output after command failure**: Ensure the shell integration is sourced and the binary is in your `$PATH`.\n- **Debugging**: Set `export CMDRAI_DEBUG=1` to print raw API responses.\n- **Permission denied**: Make sure `cmdr.ai` is executable: `chmod +x cmdr.ai`\n\n---\n\n## 📝 Example `.cmdrconfig`\n\n```\napi_key=sk-...your_openai_key...\nmodel=gpt-4o-mini\nprovider=openai\nenabled=1\nlog_dir=./cmdr\n```\n\n---\n\n\n![Frame 11](https://github.com/user-attachments/assets/ce43f7c8-aa17-4ab4-a8f2-ff17ddd70bd1)\n\n## 📄 License\n\nMIT License. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegodev2%2Fcmdr.ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiegodev2%2Fcmdr.ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegodev2%2Fcmdr.ai/lists"}