diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index d3f9c4d..51ca8bb 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -1,66 +1,66 @@ name: PR Check on: - pull_request: - branches: [main] - types: [opened, synchronize, reopened] + pull_request: + # branches: + types: [opened, synchronize, reopened] jobs: - check: - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 + check: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: "1.25.1" + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.25.1" - - name: Cache Go modules - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + - name: Cache Go modules + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - - name: Download dependencies - run: make mod + - name: Download dependencies + run: make mod - - name: Run tests - run: make test + - name: Run tests + run: make test - - name: Run checks - run: make check + - name: Run checks + run: make check - - name: Check for breaking changes - run: | - # Check if there are changes to internal packages or cmd - if git diff --name-only origin/main...HEAD | grep -E "^(internal/|cmd/)"; then - echo "⚠️ Potential breaking changes detected in internal/ or cmd/ directories" - echo "Please review these changes carefully:" - git diff --name-only origin/main...HEAD | grep -E "^(internal/|cmd/)" - fi + - name: Check for breaking changes + run: | + # Check if there are changes to internal packages or cmd + if git diff --name-only origin/main...HEAD | grep -E "^(internal/|cmd/)"; then + echo "⚠️ Potential breaking changes detected in internal/ or cmd/ directories" + echo "Please review these changes carefully:" + git diff --name-only origin/main...HEAD | grep -E "^(internal/|cmd/)" + fi - - name: Check commit messages - run: | - # Get all commits in the PR - commits=$(git log --format=%s origin/main..HEAD) + - name: Check commit messages + run: | + # Get all commits in the PR + commits=$(git log --format=%s origin/main..HEAD) - # Check if commits follow conventional commit format - for commit in $commits; do - if [[ ! "$commit" =~ ^(feat|fix|docs|style|refactor|test|chore)(\(.+\))?: .+ ]]; then - echo "⚠️ Commit message does not follow conventional commit format: $commit" - echo "Expected format: [optional scope]: " - echo "Types: feat, fix, docs, style, refactor, test, chore" - fi - done + # Check if commits follow conventional commit format + for commit in $commits; do + if [[ ! "$commit" =~ ^(feat|fix|docs|style|refactor|test|chore)(\(.+\))?: .+ ]]; then + echo "⚠️ Commit message does not follow conventional commit format: $commit" + echo "Expected format: [optional scope]: " + echo "Types: feat, fix, docs, style, refactor, test, chore" + fi + done - - name: Build - run: make build + - name: Build + run: make build diff --git a/README.md b/README.md index e10cb2c..0bcd221 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,6 @@ English | [简体中文](README_CN.md) ---- - ## 📖 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. @@ -38,20 +36,18 @@ This is a project almost entirely completed (99%) with AI assistance—I'm respo Welcome to experience this tool completed through human "manual labor" and AI "mental labor" :) ---- - ## 🚀 Quick Start ### Installation **One-line install:** ```bash -curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash +curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash -s -- --version v1.1.0-rc1|curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash -s -- --version v1.1.0-rc1 ``` **User installation (no sudo):** ```bash -curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash -s -- --user +curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash -s -- --version v1.1.0-rc1|curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash -s -- --version v1.1.0-rc1 --user ``` ### Basic Usage @@ -71,8 +67,6 @@ aim run cc --key mykey aim run codex --key another-key ``` ---- - ## ✨ Features ### Implemented ✅ @@ -89,25 +83,19 @@ aim run codex --key another-key - **🔧 Tool Management** - Tool installation and updates, version management - **🎨 TUI Interface** - Interactive model selection, visual configuration editor ---- - ## 📚 Documentation - **[CI/CD Complete Guide](docs/cicd/CI_CD_EN.md)** - Continuous integration and deployment reference - **[Local Development Setup](docs/development-guide/LOCAL_DEV_EN.md)** - Local development environment configuration guide - **[TUI Interface Design](docs/tui-interface/TUI_DESIGN_EN.md)** - Terminal user interface design 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 -- **Claude (Anthropic)** - Claude official API - ---- +- **Continuously expanding** ## 🧪 Compatibility Testing @@ -127,14 +115,11 @@ aim run codex --key another-key |----------|-------------|-------| | DeepSeek | ✅ Tested | API connection and basic functionality working | | GLM | ✅ Tested | API connection and basic functionality working | -| KIMI | ⏳ Pending | Planned for testing in future releases | -| Qwen | ⏳ Pending | Planned for testing in future releases | -| Claude | ⏳ Pending | Planned for testing in future releases | +| KIMI | ✅ Tested | API connection and basic functionality working | +| Qwen | ✅ Tested | API connection and basic functionality working | > 💡 **Note**: If you encounter issues on other operating systems or with untested providers, please submit an [Issue](https://github.com/fakecore/aim/issues) to help us improve compatibility. ---- - ## 🏗️ Local Development ```bash @@ -151,8 +136,6 @@ source test/local-dev-setup/dev-setup.sh # Bash/Zsh source test/local-dev-setup/dev-setup.fish # Fish ``` ---- - ## 🗺️ Roadmap - [x] Project basic functionality development @@ -165,8 +148,6 @@ source test/local-dev-setup/dev-setup.fish # Fish - [ ] Local MCP support - [ ] IDE plugin configuration support ---- - ## 🤝 Contributing We welcome contributions! Please see our [Development Guide](docs/development-guide/LOCAL_DEV_EN.md) for details. @@ -178,22 +159,16 @@ We welcome contributions! Please see our [Development Guide](docs/development-gu 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](LICENSE) file for details. ---- - ## 📞 Contact & Support - **Issue Feedback**: [GitHub Issues](https://github.com/fakecore/aim/issues) - **Discussions**: [GitHub Discussions](https://github.com/fakecore/aim/discussions) - **Documentation**: [docs/](docs/) ---- -
**[⬆ Back to Top](#aim---ai-model-manager)** diff --git a/README_CN.md b/README_CN.md index 06d2e66..26c01c0 100644 --- a/README_CN.md +++ b/README_CN.md @@ -42,13 +42,13 @@ AIM (AI Model Manager) 是一个强大的命令行工具,旨在简化多个 AI **一行命令安装:** ```bash -curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash +curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash -s -- --version v1.1.0-rc1|curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash -s -- --version v1.1.0-rc1| bash ``` **用户目录安装(无需 sudo):** ```bash -curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash -s -- --user +curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash -s -- --version v1.1.0-rc1|curl -fsSL https://raw.githubusercontent.com/fakecore/aim/main/scripts/setup-tool.sh | bash -s -- --version v1.1.0-rc1| bash -s -- --user ``` ### 基础用法 @@ -96,7 +96,7 @@ aim run codex --key another-key - **GLM (智谱清言)** - 中文 AI 模型 - **KIMI (月之暗面)** - 长上下文 AI 模型 - **Qwen (通义千问)** - 通义千问系列模型 -- **Claude (Anthropic)** - Claude 官方 API +- **持续增加** ## 🧪 兼容性测试 @@ -116,9 +116,8 @@ aim run codex --key another-key |--------|----------|------| | DeepSeek | ✅ 已测试 | API 连接和基本功能正常 | | GLM | ✅ 已测试 | API 连接和基本功能正常 | -| KIMI | ⏳ 待测试 | 计划在后续版本中测试 | -| Qwen | ⏳ 待测试 | 计划在后续版本中测试 | -| Claude | ⏳ 待测试 | 计划在后续版本中测试 | +| KIMI | ✅ 已测试 | API 连接和基本功能正常 | +| Qwen | ✅ 已测试 | API 连接和基本功能正常 | > 💡 **提示**:如果您在其他操作系统或使用未测试的提供商时遇到问题,欢迎提交 [Issue](https://github.com/fakecore/aim/issues) 帮助我们改进兼容性。 diff --git a/VERSION b/VERSION index 3eefcb9..8376431 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 +1.1.0-rc1 diff --git a/configs/default.yaml b/configs/default.yaml index a15ef83..330b4df 100644 --- a/configs/default.yaml +++ b/configs/default.yaml @@ -5,10 +5,10 @@ version: "1.0" # Global Settings settings: - language: en # Language: en/zh - default_tool: claude-code # Default tool - default_provider: deepseek # Default provider - timeout: 60000 # Default timeout (milliseconds) + language: en # Language: en/zh + default_tool: claude-code # Default tool + default_provider: deepseek # Default provider + timeout: 60000 # Default timeout (milliseconds) # Global Provider Configuration (OpenAI Compatible Endpoints) providers: @@ -82,11 +82,11 @@ tools: profiles: deepseek: provider: deepseek - base_url: https://api.deepseek.com/anthropic # Claude Code specific endpoint + base_url: https://api.deepseek.com/anthropic # Claude Code specific endpoint glm: provider: glm - base_url: https://open.bigmodel.cn/api/anthropic # Claude Code specific endpoint + base_url: https://open.bigmodel.cn/api/anthropic # Claude Code specific endpoint env: ANTHROPIC_DEFAULT_HAIKU_MODEL: glm-4.5-air ANTHROPIC_DEFAULT_SONNET_MODEL: glm-4.6 @@ -94,7 +94,7 @@ tools: glm-coding: provider: glm-coding - base_url: https://open.bigmodel.cn/api/anthropic # Claude Code specific endpoint + base_url: https://open.bigmodel.cn/api/anthropic # Claude Code specific endpoint env: ANTHROPIC_DEFAULT_HAIKU_MODEL: glm-4.5-air ANTHROPIC_DEFAULT_SONNET_MODEL: glm-4.6 @@ -102,39 +102,37 @@ tools: kimi: provider: kimi - base_url: https://api.moonshot.cn/anthropic # Claude Code specific endpoint + base_url: https://api.moonshot.cn/anthropic # Claude Code specific endpoint qwen: provider: qwen - base_url: https://dashscope.aliyuncs.com/api/v2/apps/claude-code-proxy # Claude Code specific endpoint + base_url: https://dashscope.aliyuncs.com/api/v2/apps/claude-code-proxy # Claude Code specific endpoint codex: command: codex enabled: true - field_mapping: OPENAI_BASE_URL: profiles.{current_profile}.base_url OPENAI_MODEL: profiles.{current_profile}.model OPENAI_TIMEOUT: profiles.{current_profile}.timeout - # API key environment variable will be set dynamically based on provider - profiles: deepseek: provider: deepseek - # Inherit global deepseek configuration (OpenAI compatible endpoint) - + field_mapping: + DEEPSEEK_API_KEY: keys.{current_key}.key glm: provider: glm - # Inherit global glm configuration (OpenAI compatible endpoint) - + field_mapping: + GLM_API_KEY: keys.{current_key}.key glm-coding: provider: glm-coding - # Inherit global glm-coding configuration (OpenAI compatible endpoint) - + field_mapping: + GLM_API_KEY: keys.{current_key}.key kimi: provider: kimi - # Inherit global kimi configuration (OpenAI compatible endpoint) - + field_mapping: + KIMI_API_KEY: keys.{current_key}.key qwen: provider: qwen - # Inherit global qwen configuration (OpenAI compatible endpoint) \ No newline at end of file + field_mapping: + QWEN_API_KEY: keys.{current_key}.key diff --git a/internal/provider/builtin.go b/internal/provider/builtin.go index fd032e7..bdc87e9 100644 --- a/internal/provider/builtin.go +++ b/internal/provider/builtin.go @@ -75,13 +75,19 @@ var builtinProviders = map[string]BuiltinProviderInfo{ Description: "Default configuration", Tools: map[string]ToolConfig{ "claude-code": { - BaseURL: "https://api.moonshot.cn/anthropic", + BaseURL: "https://api.moonshot.cn/v1/anthropic", Model: "kimi-k2-turbo-preview", Timeout: 60000, Env: map[string]string{ "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1", }, }, + "codex": { + BaseURL: "https://api.moonshot.cn/v1", + Model: "kimi-k2-turbo-preview", + Timeout: 60000, + EnvKeyName: "KIMI_API_KEY", + }, }, }, }, @@ -163,50 +169,11 @@ var builtinProviders = map[string]BuiltinProviderInfo{ "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1", }, }, - }, - }, - }, - }, - "claude": { - Name: "claude", - DisplayName: "Anthropic Claude", - Description: "Anthropic Claude - Safe and reliable AI assistant", - Website: "https://www.anthropic.com", - Endpoints: []EndpointPreset{ - { - Name: "default", - Suffix: "", - Description: "Default configuration", - Tools: map[string]ToolConfig{ - "claude-code": { - BaseURL: "https://api.anthropic.com", - Model: "claude-sonnet-4-5-20250929", - Timeout: 60000, - Env: map[string]string{ - "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5", - "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5-20250929", - "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-1-20250805", - }, - }, - }, - }, - }, - }, - "openai": { - Name: "openai", - DisplayName: "OpenAI GPT", - Description: "OpenAI GPT - Advanced large language model", - Website: "https://www.openai.com", - Endpoints: []EndpointPreset{ - { - Name: "default", - Suffix: "", - Description: "Default configuration", - Tools: map[string]ToolConfig{ - "claude-code": { - BaseURL: "https://api.openai.com/v1", - Model: "gpt-4", - Timeout: 60000, + "codex": { + BaseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1", + Model: "qwen3-max", + Timeout: 60000, + EnvKeyName: "QWEN_API_KEY", }, }, }, diff --git a/scripts/release.sh b/scripts/release.sh index b66ef62..1e1a09c 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -84,6 +84,10 @@ FEATURES: - Interactive confirmation for safety - Separate push command for controlled uploads - Supports dry-run mode for testing + - Different commit messages for version types: + * Dev versions: "Start X.Y.Z-dev" + * RC versions: "Release candidate X.Y.Z-rcN" + * Final releases: "Release X.Y.Z" VERSION FORMAT: Semantic versioning: MAJOR.MINOR.PATCH @@ -339,7 +343,18 @@ create_release() { else print_info "Committing version updates..." git add VERSION README.md README_CN.md - git commit -m "Release $NEW_VERSION" + + # Determine commit message based on version type + local commit_msg="" + if [[ "$NEW_VERSION" =~ -dev$ ]]; then + commit_msg="Start $NEW_VERSION" + elif [[ "$NEW_VERSION" =~ -rc[0-9]+$ ]]; then + commit_msg="Release candidate $NEW_VERSION" + else + commit_msg="Release $NEW_VERSION" + fi + + git commit -m "$commit_msg" # Create git tag (local only) create_tag "$NEW_VERSION"