AI-powered shell assistant that helps you execute commands and file operations through natural language.
aish is an intelligent command-line assistant that uses Large Language Models (LLMs) to understand your natural language requests and execute shell commands and file operations safely and interactively.
- π€ AI-Powered: Uses LLMs to understand natural language and execute tasks
- π Security First: Built-in security features with path validation, operation permissions, and whitelist support
- π― Interactive: Beautiful CLI interface with approval prompts for each operation
- π¬ Conversation Mode: Keep conversations open with
-iflag for continuous interaction - π§ Context Aware: Automatically detects workspace context including:
- Programming languages and versions (Node.js, Python, Java, Rust, Go, PHP, Ruby, .NET)
- Package managers and build tools
- Web and backend frameworks
- Testing frameworks and linters
- Docker, Kubernetes, and container registries
- CI/CD platforms (GitHub Actions, GitLab CI, Jenkins, etc.)
- Cloud providers (AWS, GCP, Azure)
- Infrastructure as Code tools (Terraform, Pulumi, CDK)
- Databases and development tools
- π§ Flexible: Supports multiple LLM providers (OpenAI, OpenRouter, Custom)
- π File Operations: Read, write, create directories, and list files
- π Shell Commands: Execute shell commands with real-time output
- βοΈ Configurable: Easy-to-use configuration system with interactive wizard
git clone https://github.com/sammwyy/aish.git
cd aish
cargo build --releaseThe binary will be available at target/release/aish.
- Rust 1.70 or later
- An API key from an LLM provider (OpenAI, OpenRouter, etc.)
-
Initialize configuration:
aish init
This will guide you through setting up your LLM provider, API key, and preferences.
-
Start using aish:
aish "list all Python files in the current directory" -
Try interactive mode:
aish -i "show me disk usage"This starts an interactive session where you can continue the conversation.
-
View configuration:
aish config
# Execute a simple task
aish "show me disk usage"
# File operations
aish "create a new directory called 'projects'"
# Complex workflows
aish "find all .log files older than 30 days and delete them"
# Auto-approve all operations (use with caution)
aish --accept-all "run tests and commit if they pass"Interactive mode (-i or --interactive) keeps the conversation open, allowing you to have a continuous dialogue with the AI assistant. The full conversation history is maintained, enabling references to previous commands and results.
# Start interactive mode (prompts for commands)
aish -i
# Start interactive mode with an initial command
aish -i "list all Python files"
# Interactive mode with auto-approve
aish -i --accept-all "run tests"
# Exit interactive mode by typing 'quit' or 'exit', or press Ctrl+CFeatures:
- Full conversation history maintained across all prompts
- Type
quitorexitto end the session - Press
Ctrl+Cto exit at any time - Empty prompts are ignored (allows you to skip)
- Errors don't terminate the session, allowing you to continue
# View all configuration
aish config
# Get a specific value
aish config llm.model
# Set a configuration value
aish config llm.max_tokens 8192
aish config security.allow_absolute_paths true
# View the current system prompt (with placeholders replaced)
aish showsystem
# Regenerate the system prompt template
aish regenConfiguration is stored in ~/.aish/config.toml and API keys in ~/.aish/tokens.env.
[llm]
provider = "OpenAI"
api_url = "https://api.openai.com/v1"
model = "gpt-4"
max_tokens = 4096Supported Providers:
- OpenAI
- OpenRouter
- Custom (any OpenAI-compatible API)
[security]
allow_absolute_paths = false
allow_config_path_access = false
blocked_extensions = [".env"]
[security.allowed_operations]
"fs.makedir" = true
"fs.makefile" = true
"fs.writefile" = true
"fs.readfile" = true
"fs.listdir" = true
shell = trueThe whitelist is used for auto-execution when --accept-all is enabled. Commands matching whitelist patterns will be automatically approved.
whitelist = [
"^ls.*",
"^cat.*\\.txt$",
"^git status$"
]Note: The whitelist only applies when using --accept-all. When running normally, all operations require user approval regardless of whitelist status.
Create a .aishignore file in ~/.aish/ to block access to specific file patterns (similar to .gitignore):
*.env
*.key
secrets/*
.git/*
node_modules/*
# Create pro
ect structure
aish "create a Python project with src, tests, and docs folders"
# Read and analyze files
aish "read all Python files in src/ and summarize the code structure"
# Batch operations
aish "rename all .txt files to .md in the current directory"# System information
aish "show me disk usage and the top 5 largest directories"
# Development tasks
aish "run the tests and if they pass, commit with message 'fix: tests passing'"
# Media processing
aish "convert all .mov files to .mp4 with H.264 encoding"# Data analysis
aish "analyze server.log, find errors in the last hour, and create a summary"
# Deployment
aish "backup the database, build the Docker image, and push to registry"
# Cleanup
aish "find and delete all .log files older than 30 days"- Approval Required: Every operation requires explicit approval (unless whitelisted with
--accept-all) - Path Validation: Prevents access to config directory and absolute paths by default
- Extension Blocking: Blocks sensitive file extensions like
.env - Operation Permissions: Granular control over what operations are allowed
- Pattern Matching:
.aishignorefile prevents access to sensitive patterns - Whitelist: Auto-approve specific command patterns (only with
--accept-all)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Sammwy
- GitHub: @sammwyy
This tool executes shell commands and file operations based on AI interpretation. Always review proposed operations before approval. Use --accept-all with extreme caution and only with trusted whitelisted commands.