NAME
aish — AI-powered shell assistant that helps you execute commands and file operations through natural language.
SYNOPSIS
INFO
DESCRIPTION
AI-powered shell assistant that helps you execute commands and file operations through natural language.
README
AISH
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.
Features
- 🤖 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
Installation
From Source
git clone https://github.com/sammwyy/aish.git
cd aish
cargo build --release
The binary will be available at target/release/aish.
Requirements
- Rust 1.70 or later
- An API key from an LLM provider (OpenAI, OpenRouter, etc.)
Quick Start
Initialize configuration:
aish initThis 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
Usage
Basic Commands
# 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
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 -iStart 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+C
Features:
- 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
Configuration Commands
# View all configuration aish configGet 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 regen
Configuration
Configuration is stored in ~/.aish/config.toml and API keys in ~/.aish/tokens.env.
LLM Configuration
[llm]
provider = "OpenAI"
api_url = "https://api.openai.com/v1"
model = "gpt-4"
max_tokens = 4096
Supported Providers:
- OpenAI
- OpenRouter
- Custom (any OpenAI-compatible API)
Security Configuration
[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 = true
Whitelist
The 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.
.aishignore
Create a .aishignore file in ~/.aish/ to block access to specific file patterns (similar to .gitignore):
*.env
*.key
secrets/*
.git/*
node_modules/*
Examples
File Operations
# 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"
Shell Commands
# 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"
Complex Workflows
# 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"
Security Features
- 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)
Contributing
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
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Sammwy
- GitHub: @sammwyy
Acknowledgments
Disclaimer
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.