{"id":30872317,"url":"https://github.com/brainexe/ai","last_synced_at":"2026-06-19T01:31:57.999Z","repository":{"id":313309802,"uuid":"1050670636","full_name":"brainexe/ai","owner":"brainexe","description":"AI-powered CLI tool that converts natural language descriptions into executable shell commands","archived":false,"fork":false,"pushed_at":"2026-03-22T18:27:44.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-27T00:08:06.426Z","etag":null,"topics":["ai","go"],"latest_commit_sha":null,"homepage":"","language":"Go","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/brainexe.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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-09-04T18:58:31.000Z","updated_at":"2026-03-22T18:27:47.000Z","dependencies_parsed_at":"2025-09-05T08:29:13.603Z","dependency_job_id":"5911ee6c-ef18-43d9-90a7-8be4a3cc4911","html_url":"https://github.com/brainexe/ai","commit_stats":null,"previous_names":["brainexe/ai"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/brainexe/ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainexe%2Fai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainexe%2Fai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainexe%2Fai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainexe%2Fai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brainexe","download_url":"https://codeload.github.com/brainexe/ai/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainexe%2Fai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34514282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"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":["ai","go"],"created_at":"2025-09-07T22:06:13.723Z","updated_at":"2026-06-19T01:31:57.985Z","avatar_url":"https://github.com/brainexe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI CLI\n\nA command-line tool that generates shell commands from natural language descriptions using OpenAI's API.\n\n## Features\n\n- 🤖 Natural language to shell command conversion\n- 🔄 Concurrent API calls for better performance\n- 🛡️ Safety-first approach with read-only preferences\n- 📊 Verbose mode with detailed API response information\n- 🎯 Interactive command selection\n- 🔧 Cross-platform support (Linux, macOS, windows etc)\n\n## Installation\n\n### Prerequisites\n\n- Go 1.26 or later\n- OpenAI API token\n\n### Option 1: Install with go install (Recommended)\n\n```bash\ngo install github.com/brainexe/ai@latest\n```\n\n### Option 2: Build from Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/brainexe/ai.git\ncd ai-cli\n\nmake build\n```\n\n## Setup\n\n1. Set your OpenAI API token:\n```bash\nexport OPENAI_TOKEN=\"your-openai-token-here\"\n```\n\n## Usage\n\n### Examples\n\n```bash\nai \"find biggest file here\"\nSelect a command:\n  1) find . -type f -exec ls -la {} + | sort -k5 -nr | head -1\n  2) du -ah . | sort -rh | head -1\n  3) ls -lah | sort -k5 -nr | head -1\nEnter number: 1\n```\n\n```bash\nai \"search for TODO in all files\"\nSelect a command:\n  1) grep -r \"TODO\" .\n  2) find . -name \"*.go\" -exec grep -l \"TODO\" {} +\n  3) grep -rn \"TODO\" .\nEnter number: 1\n```\n\n```bash\nai \"show files modified in last 24 hours\"\nSelect a command:\n  1) find . -type f -mtime -1\n  2) ls -lt | head -10\n  3) find . -type f -newermt \"1 day ago\"\nEnter number: 1\n```\n\n```bash\nai bpftrace trace all page faults, show pid, application name\nSelect a command:\n  1) sudo bpftrace -e 'tracepoint:exceptions:page_fault_user { printf(\"%d %s\\n\", pid, comm); }'\n  2) sudo bpftrace -e 'tracepoint:exceptions:page_fault_user { printf(\"%d %s %s\\n\", pid, comm, str(args-\u003eaddress)); }'\n  3) sudo bpftrace -e 'tracepoint:exceptions:page_fault_user { printf(\"%d %s %s\\n\", pid, comm, args-\u003emessage ? args-\u003emessage : \"\"); }'\n```\n\n```bash\nai \"count lines in all go files\"\nSelect a command:\n  1) find . -name \"*.go\" -exec wc -l {} +\n  2) cloc .\n  3) find . -name \"*.go\" | xargs wc -l\nEnter number: 1\n```\n\n```bash\nai \"find all TODO comments in source code\"\nSelect a command:\n  1) grep -r \"TODO\" .\n  2) find . -name \"*.go\" -exec grep -n \"TODO\" {} +\n  3) grep -rn \"TODO\" .\nEnter number: 1\n```\n\n```bash\nai \"replace tabs with spaces in all files\"\nSelect a command:\n  1) find . -name \"*.go\" -exec sed -i 's/\\t/    /g' {} +\n  2) find . -type f -name \"*.go\" -exec expand -t 4 {} \\; -exec mv {}.exp {} \\;\n  3) sed -i 's/\\t/    /g' *.go\nEnter number: 1\n```\n\n```bash\nai \"check if port 8080 is open\"\nSelect a command:\n  1) netstat -tuln | grep 8080\n  2) lsof -i :8080\n  3) ss -tuln | grep 8080\nEnter number: 1\n```\n\n### Command Options\n\n#### Verbose Mode\n\nUse the `-v` flag to see detailed information about API calls and generated commands:\n\n#### Number of Commands\n\nUse the `-n` flag to specify how many commands to generate (default: 3):\n\n```bash\n# Generate 5 command options\nai -n 5 \"find large files\"\n\n# Combine with verbose mode\nai -v -n 2 \"show disk usage\"\n```\n\nVerbose mode displays:\n- Number of commands generated\n- API request timing information\n- All generated command options\n- Raw API responses (pretty-printed JSON)\n\n### Interactive Selection\n\nWhen multiple commands are generated, you'll be prompted to select one:\n\n```\nai -n 5 \"find large files\"\nSelect a command:\n  1) find . -type f -size +100M\n  2) du -ah . | sort -rh | head -10\n  3) find . -type f -exec ls -lh {} + | awk '$5 ~ /[0-9]+M/'\n  4) ls -lah | sort -k5 -hr | head -10\n  5) find . -type f -size +50M -exec ls -lh {} +\nEnter number: 1\n```\n\n## Safety Features\n\n- **Read-only preference**: Prioritizes non-destructive commands\n- **Destructive action warnings**: Avoids `rm -rf`, `chmod -R`, `sudo` unless explicitly requested\n- **Single command output**: Ensures only one safe command per response\n- **Path safety**: Properly quotes paths containing spaces\n- **Command sanitization**: Removes code blocks and extra formatting\n\n## Development\n\n### Build Commands\n\n```bash\n# build the \"ai\" binary\nmake build\n\n# Run linter\nmake lint\n```\n\n## Examples\n\n```bash\n# File operations\nai \"show files modified in last 24 hours\"\nai \"count lines in all go files\"\n\n# System information\nai \"show memory usage\"\nai \"list running processes\"\n\n# Text processing\nai \"find all TODO comments in source code\"\nai \"replace tabs with spaces in all files\"\n\n# Network operations\nai \"check if port 8080 is open\"\nai \"show network connections\"\n```\n\n## Configuration\n\nThe tool uses the following environment variables:\n\n- `OPENAI_TOKEN`: Your OpenAI API token in env vars (required)\n\n## License\n\nThis project is licensed under MIT License, see the LICENSE file.\n\n### Common Issues\n\n**\"OPENAI_TOKEN not set\" error**\n- Ensure you've exported your OpenAI API token as an environment variable\n\n**\"No commands generated\" error**\n- Try rephrasing your request more clearly\n- Check your internet connection\n- Verify your OpenAI API token is valid\n\n**Command not found**\n- Make sure the binary is in your PATH or use the full path `ai`\n- Verify the binary has execute permissions\n\n### Verbose Mode for Debugging\n\nUse the `-v` flag to see detailed information about what's happening:\n\n```bash\nai -v \"your command description\"\n```\n\nThis will show API response times, generated commands, and raw API responses to help diagnose issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainexe%2Fai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrainexe%2Fai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainexe%2Fai/lists"}