Skip to content

ruandada/aish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AISH Screenshot

AISH

An Intelligent Shell with AI-Powered Assistance

GitHub License Go Version


πŸš€ 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)

go install github.com/ruandada/aish/cmd/aish@latest

Option 2: Donwload prebuild binaries

See releases

βš™οΈ Configuration

Before using AISH, configure your OpenAI API settings:

# Create or edit your configuration file
vim ~/.aishrc

Add your OpenAI configuration:

# Set your OpenAI API key
aiset openai.api_key "<your-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

# Interactive mode
aish

# Single command execution
aish -c "what day is today?"

# Execute from script file
aish ./story.sh

Basic Usage Examples

# 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

# 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:

#!/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:

chmod +x ./random_story.sh
./random_story.sh

Random Story Example

πŸ—οΈ 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 - Customize AI prompts to create specialized agents
  • Custom Tools - 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.

# 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).

# 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 <key> <value> Set configuration values
aiget <key> Get specific configuration value
aiget Display all configuration values

System Prompt Management

Command Description
aiprompt <prompt> 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: <command> Execute in auto mode (mode unchanged)
ai: <command> Execute in AI mode (mode unchanged)
user: <command> or :: <command> Execute in user mode (mode unchanged)

πŸ§ͺ Development

Building

# 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 file for details.

πŸ™ Acknowledgments

  • Shell Engine: Built with mvdan.cc/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 QR Code

Alipay

WeChat QR Code

WeChat

Scan to donate


Made with ❀️ by @ruandada

Report Bug Β· Request Feature Β· View on GitHub

About

AISH - An Intelligent Shell with AI-Powered Assistance

Topics

Resources

License

Stars

Watchers

Forks