https://github.com/ruandada/aish
AISH - An Intelligent Shell with AI-Powered Assistance
https://github.com/ruandada/aish
ai intelligence shell
Last synced: 6 months ago
JSON representation
AISH - An Intelligent Shell with AI-Powered Assistance
- Host: GitHub
- URL: https://github.com/ruandada/aish
- Owner: ruandada
- License: mit
- Created: 2025-07-09T10:15:27.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-28T03:52:12.000Z (11 months ago)
- Last Synced: 2025-07-28T05:29:00.752Z (11 months ago)
- Topics: ai, intelligence, shell
- Language: Go
- Homepage: https://github.com/ruandada/aish
- Size: 1.8 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
---
## ๐ Overview
AISH is an intelligent shell that seamlessly combines traditional UNIX shell functionality with AI-powered assistance. It provides an enhanced command-line experience where you can use natural language to interact with your system while maintaining full compatibility with standard shell operations.
## โจ Key Features
- **๐ค Natural Language Commands** - Execute system operations using plain English
- **๐ป Full Shell Compatibility** - Complete POSIX shell support with readline and autocompletion
- **โ๏ธ Flexible AI Configuration** - Customize OpenAI API settings, models, and system prompts
- **๐ง Custom Tool Integration** - Extend functionality with your own local executables
- **๐จ Beautiful Interface** - Enjoy colorful, informative prompts with system information
- **๐ Workspace Support** - Project-specific configurations via `.aishrc` files
## ๐ฆ Installation
### Prerequisites
- **OpenAI API key**
- **Go** 1.23.0 or later (if build from source)
### Option 1: Build and Install from Source (Recommended)
```bash
go install github.com/ruandada/aish/cmd/aish@latest
```
### Option 2: Donwload prebuild binaries
See [releases](https://github.com/ruandada/aish/releases)
## โ๏ธ Configuration
Before using AISH, configure your OpenAI API settings:
```bash
# Create or edit your configuration file
vim ~/.aishrc
```
Add your OpenAI configuration:
```bash
# Set your OpenAI API key
aiset openai.api_key ""
# Optionally customize the model (default: gpt-4o-mini)
aiset openai.model "gpt-4o-mini"
# Set custom base URL for alternative providers
aiset openai.base_url "https://api.openai.com/v1"
```
## ๐ฏ Quick Start
### Launch AISH
```bash
# Interactive mode
aish
# Single command execution
aish -c "what day is today?"
# Execute from script file
aish ./story.sh
```
### Basic Usage Examples
```bash
# Execute native shell commands directly
uname -a
# > Darwin macbook.local 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:39:07 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6000 arm64
# Use natural language for AI interaction
tell me a joke
# > Why do programmers prefer dark mode?
# > Because light attracts bugs!
# Use quotes for explicit AI mode (useful when command conflicts with built-ins)
"what day is today"
# > Today is Sunday, July 27, 2025.
# Or use the "ai:" prefix for explicit AI commands
ai: what is the time
# > The current time is Sun Jul 27 10:24:29 CST 2025.
```
## ๐ง Advanced Usage
### Complex Command Patterns
```bash
# Subcommands with shell expansion
get my ip addr: $(ifconfig)
generate a report: $(df -h)
# Multi-step operations
create a new react project here && launch that project
# Piping with AI commands
"count from 1 to 100" | grep 0
# Output redirection
"generate a poem about computers" > ./poem.txt
```
### AI-Powered Shell Scripts
AISH supports full shell script syntax, allowing you to create scripts using natural language. Here's an example of a story generator script:
```bash
#!/usr/bin/env aish
# Color definitions
CYAN='\033[0;36m'
NC='\033[0m' # No Color
print_banner() {
echo -e "${CYAN}"
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
echo "โ ๐ญ Epic Story Generator ๐ญ โ"
echo "โ AI-Powered AISH Script โ"
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
echo -e "${NC}"
}
generate_story() {
"tell me a random story"
}
print_banner
generate_story
```
Make it executable and run:
```bash
chmod +x ./random_story.sh
./random_story.sh
```

## ๐๏ธ Workspace Configuration
AISH automatically reads `.aishrc` files in the current directory, enabling project-specific configurations:
- Define custom AI tools
- Set project-specific system prompts
- Configure specialized LLM models
### Example Configurations
Explore our examples for advanced usage:
- **[Emoji Agent](docs/examples/emoji/README.md)** - Customize AI prompts to create specialized agents
- **[Custom Tools](docs/examples/tools/README.md)** - Expose local executables as AI tools
## ๐๏ธ Shell Modes
AISH operates in three distinct modes:
### Auto Mode (Default)
Automatically detects whether input is a shell command or AI conversation.
### AI Mode
All input is processed by the AI assistant.
```bash
# Force AI mode for single command
ai: write an essay about GitHub
# Switch to AI mode
ai:
# Direct AI interaction
write an essay about GitHub
```
### User Mode
All input is processed by the traditional shell interpreter (no AI).
```bash
# Force user mode for single command
user: ifconfig
# Shortcut
:: ifconfig
# Switch to user mode
::
# Direct shell execution
ifconfig
```
## ๐ ๏ธ Built-in Commands
### Configuration Management
| Command | Description |
| --------------------- | -------------------------------- |
| `aiset ` | Set configuration values |
| `aiget ` | Get specific configuration value |
| `aiget` | Display all configuration values |
### System Prompt Management
| Command | Description |
| ------------------- | ------------------------------- |
| `aiprompt ` | Append custom system prompts |
| `aiprompt reset` | Reset to default system prompts |
| `aiprompt` | View current system prompt |
### Mode Control
| Command | Description |
| ----------------------------------- | ------------------------------------- |
| `auto:` | Switch to auto mode |
| `ai:` | Switch to AI mode |
| `user:` or `::` | Switch to user mode |
| `auto: ` | Execute in auto mode (mode unchanged) |
| `ai: ` | Execute in AI mode (mode unchanged) |
| `user: ` or `:: ` | Execute in user mode (mode unchanged) |
## ๐งช Development
### Building
```bash
# Build the application
make
# Test local development
go run ./cmd/aish
```
### Project Structure
```
aish/
โโโ cmd/aish/ # Main application entry point
โโโ internal/ # Core implementation
โ โโโ base/ # Base shell functionality
โ โโโ plugins/ # AI and extension plugins
โโโ docs/ # Documentation and examples
โโโ Makefile # Build configuration
```
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ Acknowledgments
- **Shell Engine**: Built with [mvdan.cc/sh](https://github.com/mvdan/sh) for POSIX compatibility
- **AI Integration**: Powered by OpenAI's GPT models
- **Inspiration**: Modern shell experiences and AI-assisted development tools
## โ๏ธ Buy Me a Coffee
If you find AISH helpful and would like to support its development, consider buying me a coffee! Your support helps keep this project alive and enables me to continue improving it.
Alipay
WeChat
Scan to donate
---