{"id":24935319,"url":"https://github.com/abakermi/nlsh","last_synced_at":"2026-01-31T20:00:54.238Z","repository":{"id":273873542,"uuid":"921148371","full_name":"abakermi/nlsh","owner":"abakermi","description":"A command-line tool that converts natural language instructions into shell commands using LLM model. ","archived":false,"fork":false,"pushed_at":"2025-02-12T07:29:38.000Z","size":827,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-30T20:43:09.824Z","etag":null,"topics":["ai","llm","shell"],"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/abakermi.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}},"created_at":"2025-01-23T12:34:37.000Z","updated_at":"2025-08-28T17:02:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f7304cb-61b1-4a64-8e9a-536ef72b01a3","html_url":"https://github.com/abakermi/nlsh","commit_stats":null,"previous_names":["abakermi/nlsh"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/abakermi/nlsh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abakermi%2Fnlsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abakermi%2Fnlsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abakermi%2Fnlsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abakermi%2Fnlsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abakermi","download_url":"https://codeload.github.com/abakermi/nlsh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abakermi%2Fnlsh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28952577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["ai","llm","shell"],"created_at":"2025-02-02T15:36:34.844Z","updated_at":"2026-01-31T20:00:54.233Z","avatar_url":"https://github.com/abakermi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Natural Language Shell (nlsh)\n\n[![Build Status](https://github.com/abakermi/nlsh/actions/workflows/release.yml/badge.svg)](https://github.com/abakermi/nlsh/actions/workflows/release.yml)\n[![Release](https://img.shields.io/github/v/release/abakermi/nlsh)](https://github.com/abakermi/nlsh/releases/latest)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/abakermi/nlsh)](https://github.com/abakermi/nlsh)\n\n\u003cimg src=\"./resources//play.gif\" width=\"500\" /\u003e\n\nA command-line tool that converts natural language instructions into shell commands using AI. Simply describe what you want to do in plain English, and nlsh will generate and execute the appropriate shell command.\n\n## Features\n\n- 🧠 Natural language to shell command conversion\n- 🤖 Multiple AI backends: OpenAI GPT and Google Gemini\n- 🛡️ Built-in safety checks for dangerous commands\n- ⚙️ Configurable settings via `.nlshrc`\n- 🎨 Colored output for better readability\n- 📝 Command history and context awareness\n- 🔄 Interactive and single command modes\n- 🔒 Confirmation for potentially dangerous operations\n\n## Prerequisites\n\n- Go 1.24 or later\n- OpenAI API key or Google Gemini API key\n\n## Installation\n\n### Option 1: Quick Install\n\nInstall directly using curl:\n```bash\ncurl -fsSL https://raw.githubusercontent.com/abakermi/nlsh/master/install.sh | bash\n```\n\n### Option 2: Go Install\n\n```bash\ngo install github.com/abakermi/nlsh@latest\n```\n\n### Option 3: Manual Installation\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/abakermi/nlsh.git\n   cd nlsh\n   ```\n2. Set your API key as an environment variable:\n   ```bash\n   export OPENAI_API_KEY='your-api-key-here'\n   # or\n   export GEMINI_API_KEY='your-api-key-here'\n   ```\n3. Run the installation script:\n   ```bash\n   ./install.sh\n   ```\n4. Restart your terminal or source your shell configuration:\n   ```bash\n   source ~/.zshrc  # or source ~/.bashrc\n   ```\n\n## Usage\n\n### Set your API key:\n\n```bash\n# For OpenAI\nexport OPENAI_API_KEY='your-api-key-here'\n\n# For Gemini\nexport GEMINI_API_KEY='your-api-key-here'\n```\n\n### Interactive Mode\n\n```bash\nnlsh\n```\n\n### Single Command Mode\n```bash\nnlsh \"list all files in current directory\"\n```\n\n## Examples\n```bash\n# List files\nnlsh \"show me all hidden files\"\n\n# Git operations\nnlsh \"commit all changes with message 'update readme'\"\n\n# Docker operations\nnlsh \"show all running containers\"\n```\n\n## Configuration\n\nYou can customize nlsh's behavior by creating a `.nlshrc` file in your home directory. The configuration file supports TOML format.\n\n### Switching Between Backends\n\nSet the `backend` option to choose your AI provider:\n\n```toml\n# Backend to use: \"openai\" or \"gemini\"\nbackend = \"gemini\"\n```\n\n### Local / Self-Hosted Models (Ollama, vLLM, etc.)\n\nYou can use local models compatible with the OpenAI API by configuring `base_url`:\n\n```toml\n[openai]\nmodel = \"llama3\" # Replace with your local model name\nbase_url = \"http://localhost:11434/v1\" # Example for Ollama\n```\n\nIf `base_url` is set, `OPENAI_API_KEY` is not required.\n\n### Full Configuration Example\n\n```toml\n# Backend to use: \"openai\" or \"gemini\"\nbackend = \"openai\"\n\n[openai]\nmodel = \"gpt-4-turbo-preview\"\ntemperature = 0.7\n\n[gemini]\nmodel = \"gemini-2.0-flash\"\ntemperature = 0.7\n\n[safety]\nconfirm_execution = true\nallowed_commands = [\n    \"ls *\",\n    \"touch *\",\n    \"mkdir *\",\n    \"echo *\",\n    \"cat *\",\n    \"cp *\",\n    \"mv *\",\n    \"git *\",\n    \"docker *\",\n    \"code *\",\n    \"vim *\",\n    \"nano *\"\n]\ndenied_commands = [\n    \"rm -rf /*\",\n    \"rm -rf /\",\n    \"dd if=/dev/*\",\n    \"mkfs.*\",\n    \"\u003e /dev/*\",\n    \"shutdown *\",\n    \"reboot *\",\n    \"halt *\",\n    \"*--no-preserve-root*\"\n]\n```\n\n## Safety Features\n\n- Command confirmation before execution\n- Configurable allowed/denied commands\n- Pattern-based command filtering\n- Protection against dangerous operations\n\n## License\n\nThis project is open source and available under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabakermi%2Fnlsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabakermi%2Fnlsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabakermi%2Fnlsh/lists"}