Skip to content

AI-Terminal is an advanced AI-powered CLI that enhances terminal workflows through AI-driven automation and optimization.

License

Notifications You must be signed in to change notification settings

coding-hui/ai-terminal

Repository files navigation

AI-Terminal

πŸ‡ΊπŸ‡Έ English | πŸ‡¨πŸ‡³ δΈ­ζ–‡ | πŸ‡―πŸ‡΅ ζ—₯本θͺž

Your intelligent command-line companion that transforms terminal workflows with AI-powered automation

AI-Terminal is an advanced command-line interface enhanced with artificial intelligence to help developers work smarter, not harder. It provides context-aware assistance, intelligent automation, and powerful code generation capabilities right in your terminal.

✨ Key Features

πŸ€– Interactive Coding Sessions

  • Multi-mode Interface: Switch between chat (/ask), coding (/coding), and execution (/exec) modes
  • File Context Management: Load files with /add command for context-aware operations
  • Real-time Code Editing: Apply AI-generated code changes directly to your files
  • Auto-commit Integration: Automatically commit changes after code generation

πŸ“ Intelligent Commit Automation

  • Multi-stage Analysis: Code review β†’ Title generation β†’ Prefix determination β†’ Message creation
  • Language Support: Generate commit messages in English, Chinese, Japanese, Portuguese, and Brazilian Portuguese
  • Conventional Commits: Automatic prefix detection (feat, fix, docs, style, refactor, test, chore)
  • Flexible Attribution: Configurable author/committer attribution for AI-generated changes

πŸ”§ Smart Command Execution

  • OS-Aware Suggestions: Commands tailored to your operating system and architecture
  • Safety First: Built-in confirmation prompts and [noexec] responses for unsafe operations
  • Context Integration: Leverages current user, OS info, and directory context

πŸ’¬ Advanced File & Context Management

  • Pattern Matching: Support for glob patterns and directory recursion
  • Remote Content: Load and analyze content from URLs
  • Session Persistence: Save and restore conversation contexts across sessions
  • Batch Operations: Process multiple files and directories efficiently

πŸš€ Quick Start

Prerequisites

  • Go 1.22.0 or later (if building from source)
  • Git installed and configured
  • Terminal/Command Prompt access
  • API access to supported AI providers

Installation

Homebrew (Recommended):

brew install coding-hui/tap/ai-terminal

Download Pre-built Binaries: Visit our [releases page][releases] to download binaries for:

  • Linux (x86_64, arm64)
  • macOS (Intel, Apple Silicon)
  • Windows

Build from Source:

git clone https://github.com/coding-hui/ai-terminal.git
cd ai-terminal
make build

Initial Configuration

ai configure

This interactive setup will guide you through API key configuration and personal preferences.

πŸ“– Usage Examples

Interactive Coding Session

# Start interactive coding
ai coder

# In the session:
/add *.go                    # Add all Go files
/add https://example.com/api-spec.json  # Add remote content
/coding "Refactor these functions to use interfaces"
/commit                     # Auto-commit the changes

Smart Commit Messages

# Stage your changes
git add .

# Generate commit with specific language and prefix
ai commit --lang zh-cn --prefix fix

# Preview before committing
ai commit --preview --no-confirm

# Amend previous commit
ai commit --amend

Command Assistance & Execution

# Get command suggestions
ai exec "find all recently modified Go files and count lines"

# Execute with auto-confirmation
ai exec --yes "list all Docker containers and their status"

# Safe rejection for destructive operations
ai exec "rm -rf /"  # Returns [noexec] with reason

File Analysis & Q&A

# Load files and ask questions
ai coder
/add package.json
/add src/
/ask "What dependencies are outdated and what are the alternatives?"

Design & Architecture

ai coder
/add current-architecture.md
/design "Design a microservices architecture for this monolith"

βš™οΈ Configuration

API Setup

Configure multiple AI providers in your config file:

apis:
  openai:
    api-key: sk-...
    base-url: https://api.openai.com/v1
  localai:
    api-key: ""
    base-url: http://localhost:8080/v1

Auto-coder Settings

auto-coder:
  coding-model: gpt-4
  design-model: gpt-4
  auto-commit: true
  commit-prefix: feat
  coding-fences: ["```", "```"]

πŸ—οΈ Advanced Features

Session Management

# Save current context
/save session-name

# List available sessions
/sessions

# Clear current conversation
/clear

Diff and Apply Operations

# View formatted diffs
/diff

# Apply edit blocks directly
/apply "
<<<<<<< SEARCH
old code

About

AI-Terminal is an advanced AI-powered CLI that enhances terminal workflows through AI-driven automation and optimization.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5