Skip to content

Repository files navigation

AIM - AI Model Manager

License: MITGo VersionPRs Welcome

A unified CLI tool for managing multiple AI tools and model providers

English | 简体中文

📖 Overview

AIM (AI Model Manager) is a powerful command-line tool designed to simplify the management of multiple AI CLI tools (like Claude Code) and their model providers. It provides a unified interface for switching between AI models, managing API keys, and configuring your development environment.

Why AIM?

  • 🔄 Unified Management: Switch between different AI models with a single command
  • 🔐 Secure Key Management: Safely store and manage API keys for multiple providers
  • ⚙️ Flexible Configuration: Support for global and project-level configurations
  • 🐚 Shell Integration: Native support for Bash, Zsh, and Fish shells
  • 🚀 Fast & Lightweight: Built with Go for optimal performance

Current Status

Design phase completed. The project is now in active development. See V2 Design Documentation for details.

💭 Foreword

After many years in software development, the pace of AI development in recent years has consistently exceeded my imagination. I never thought years ago that AI would so profoundly change our development methods and lifestyles.

This is a project almost entirely completed (99%) with AI assistance—I'm responsible for communicating requirements with AI, architectural design, and code review, while AI serves as my development partner, handling most of the coding work. This entirely new collaboration model has given me a deep appreciation that we're entering a new era of co-creation between developers and AI.

Welcome to experience this tool completed through human "manual labor" and AI "mental labor" :)

🚀 Quick Start

Installation

One-line install:

curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash

User installation (no sudo):

curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash -s -- --user

Basic Usage

# Initialize configuration (creates ~/.config/aim/config.yaml)
aim init
# Validate your configuration
aim config validate
# Run AI tool with default account
aim run cc
# Run AI tool with specific account
aim run cc -a deepseek
aim run codex -a glm
# Show resolved configuration for an account
aim config show -a deepseek
# Edit configuration file
aim config edit
# Launch TUI (Terminal UI)
aim tui

📋 Commands

Core Commands

CommandStatusDescription
aim initInitialize configuration with built-in vendors
aim run <tool>Run AI tool with environment configured
aim config showDisplay configuration for all accounts or specific account
aim config editEdit configuration in $EDITOR
aim config validateValidate configuration file
aim tui🚧Terminal UI (5/6 tabs implemented)
aim extension list🚧List installed extensions (basic)
aim migrate🚧v1 to v2 migration (planned)

Run Command Options

aim run <tool> [flags] [-- <args>...]
Flags:
-a, --account string Account to use
-m, --model string Model to use (override)
--dry-run Show what would be executed
--native Run without env injection
Examples:
aim run cc -a deepseek
aim run codex -a glm -- file.txt
aim run cc -a deepseek --dry-run

Config Show Command

Display configuration. When no account is specified, shows summary and detailed configuration for all accounts:

# Show all accounts configuration
aim config show
# Show configuration for specific account
aim config show -a deepseek

Output includes:

  • Configuration summary (account count, vendor count, key count, default account)
  • For each account:
    • Account name and referenced key
    • Vendor information
    • Resolved API key (masked for security)
    • Available endpoints for each protocol
    • Model overrides (if any)

⚙️ Configuration

AIM uses a provider-centric v2 configuration system:

version: "2"# Tool protocol mappingstools:
cc:
protocol: anthropiccodex:
protocol: openai# Vendor definitionsvendors:
deepseek:
endpoints:
openai:
url: https://api.deepseek.com/v1default_model: deepseek-chatanthropic:
url: https://api.deepseek.com/anthropic# API keyskeys:
deepseek-main:
value: ${DEEPSEEK_API_KEY}vendor: deepseek# Accounts reference keysaccounts:
deepseek:
key: deepseek-main# Global settingssettings:
default_account: deepseekcommand_timeout: 5m

Key Features

  • Environment Variables: Use ${VAR_NAME} syntax for secure key storage
  • Base64 Encoding: Use base64:ENCODED_STRING for obfuscated storage
  • Protocol Adaptation: One account serves multiple CLI tools via automatic protocol mapping
  • Endpoint Overrides: Customize endpoints per account or key

✨ Features

Implemented ✅

  • ⚙️ Provider-Centric Configuration - Unified account and vendor management
  • 🔑 Secure Key Management - Environment variables, base64 encoding support
  • 🔄 Protocol Adaptation - One account serves multiple CLI tools
  • ⏱️ Timeout & Signal Handling - Configurable command timeouts
  • 🎨 TUI Interface - Interactive terminal UI with Tokyo Night theme
  • 📊 Config Validation - Comprehensive validation with helpful error messages
  • 🛠️ Development Environment - Makefile commands, isolated testing
  • 🐚 Fish Shell Integration - Native Fish function support

In Development 🚧

  • 🌍 Internationalization - Multi-language support (English, Chinese)
  • 🛣️ Routes Tab - Traffic routing chain visualization
  • 📊 Usage Tab - API usage statistics and charts
  • 📝 Enhanced Logs - Advanced log filtering
  • 🔌 Extension System - Local YAML extensions for custom vendors
  • 🔧 Migration Tools - v1 to v2 configuration migration

🖥️ TUI (Terminal UI)

The TUI provides an interactive way to manage your AIM configuration:

aim tui # Launch the TUI

Features:

  • 📑 Multi-Tab Navigation: Config, Status, Routes, Usage, Logs tabs
  • 📐 Responsive Layout:
    • Split Mode (≥80 cols): Side-by-side list and preview panels
    • Single Mode (40-79 cols): Tab-switched compact view
    • Minimum: 40×10 terminal size
  • 🎨 Tokyo Night Theme: Beautiful dark theme
  • ⌨️ Keyboard Navigation:
    • Tab / Shift+Tab - Switch between tabs
    • ↑↓ / jk - Navigate lists
    • Enter - Select / Confirm
    • n - New account
    • e - Edit selected item
    • d - Delete selected item
    • q / Ctrl+C - Quit

📚 Documentation

V2 Design Documentation

General Documentation

🎯 Supported Providers

  • DeepSeek - High-performance reasoning models
  • GLM (Zhipu AI) - Chinese AI models
  • KIMI (Moonshot AI) - Long-context AI models
  • Qwen (Alibaba Cloud) - Qwen series models
  • Continuously expanding

🧪 Compatibility Testing

Operating System Support

Operating SystemArchitectureTest StatusNotes
macOSARM64✅ TestedPrimary development platform
macOSIntel⏳ PendingPlanned for future releases
Linuxx86_64⏳ PendingPlanned for future releases
LinuxARM64⏳ PendingPlanned for future releases
Windowsx86_64⏳ PendingPlanned for future releases

LLM Provider Testing

ProviderTest StatusNotes
DeepSeek✅ TestedAPI connection working
GLM✅ TestedAPI connection working
KIMI✅ TestedAPI connection working
Qwen✅ TestedAPI connection working

💡 Note: If you encounter issues, please submit an Issue.

🏗️ Local Development

# Clone repository
git clone https://github.com/fakecore/aim.git
cd aim
# Build and install
make build
make install
# Load development environmentsource test/local-dev-setup/dev-setup.sh # Bash/Zshsource test/local-dev-setup/dev-setup.fish # Fish# Run tests
make test# Run TUI for testing
aim tui

🗺️ Roadmap

V2 Implementation Status

  • Phase 1: Core Foundation

    • Config parsing and validation
    • Basic aim run command
    • Built-in vendors (deepseek, glm, kimi, qwen)
  • Phase 2: CLI Commands

    • Config management commands
    • Error handling with structured codes
    • Config validation
  • Phase 3: TUI MVP ✅ (Partial)

    • Basic layout and navigation
    • Config tab (Account list + Preview)
    • Status tab (Basic health check)
    • 🚧 Settings, Routes, Usage tabs planned
  • Phase 4: Extensions 🚧

    • Local YAML extensions
    • Extension registry
  • Phase 5: Migration

    • v1 to v2 config migration
  • Phase 6: Polish

    • Documentation
    • Performance optimization

Future Enhancements

  • TUI mouse support
  • TUI accessibility (screen readers)

Supported CLI Tools

Currently supported AI CLI tools:

ToolCommandProtocolStatus
Claude Codeaim run ccanthropic✅ Available
Codexaim run codexopenai✅ Available
OpenCodeaim run opencodeopenai✅ Available

Planned CLI Tools

ToolProtocolStatus
Gemini CLIopenai⏳ Planned

🤝 Contributing

We welcome contributions! Please see our Development Guide for details.

  1. Fork this repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Commit your changes (git commit -m "feat: add amazing feature")
  5. Push to your fork (git push origin feature/amazing-feature)
  6. Create a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

📞 Contact & Support

⬆ Back to Top

Made with ❤️ by fakecore

About

A unified CLI tool for managing multiple AI tools (claude-code,codex,opencode) and model providers

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages