Skip to content

Anuar-boop/ai-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

ai-shell

AI-powered shell command generator. Describe what you want to do in natural language, get the command.

npm install -g ai-shell-cmd

Quick Start

ai-shell "find all JS files larger than 1MB"
# $ find . -name "*.js" -size +1M

ai-shell "compress this directory into a tar.gz"
# $ tar -czf archive.tar.gz .

ai-shell "show disk usage sorted by size"
# $ du -sh * | sort -rh

ai-shell "kill the process on port 3000"
# $ lsof -ti:3000 | xargs kill

How It Works

  1. You describe what you want in plain English
  2. AI generates the exact shell command
  3. You review and confirm (or edit) before executing
$ ai-shell "list docker containers with their sizes"

  $ docker ps -as --format "table {{.Names}}\t{{.Size}}\t{{.Status}}"

  Run this command? [Y/n/e(dit)]

Providers

Provider Models Setup
OpenAI (default) gpt-4o-mini, gpt-4o ai-shell config --openai-key sk-...
Anthropic Claude Haiku, Sonnet ai-shell config --anthropic-key sk-ant-...
Ollama (local) llama3.2, codellama ai-shell config --provider ollama

Configuration

ai-shell config                              # Show config
ai-shell config --provider anthropic         # Switch provider
ai-shell config --model gpt-4o              # Set model
ai-shell config --openai-key sk-xxx         # Set API key
ai-shell config --ollama-host http://...    # Set Ollama URL

Config stored at ~/.ai-shell.json.

Options

Flag Description
--explain Also explain what the command does
--no-confirm Execute without confirmation prompt

Features

  • Natural language to shell commands
  • Interactive confirmation before execution
  • Edit command before running
  • Multiple AI providers (OpenAI, Anthropic, Ollama)
  • OS and shell-aware (adapts commands to your system)
  • Zero dependencies (pure Node.js + curl)

License

MIT

About

AI-powered shell command generator. Describe what you want, get the command. OpenAI/Anthropic/Ollama.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors