Metadata-Version: 2.4
Name: agent-provider-manager
Version: 0.1.2
Summary: Centralized API provider management for AI coding agents
Project-URL: Homepage, https://github.com/jaxtonzhc/apm
Project-URL: Repository, https://github.com/jaxtonzhc/apm
Project-URL: Issues, https://github.com/jaxtonzhc/apm/issues
Author: jaxtonzhc
License-Expression: MIT
License-File: LICENSE
Keywords: agent,ai,api-key,cli,provider
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

<p align="center">
  <img src="docs/logo.png" width="120" alt="APM Logo" />
</p>

<h1 align="center">Agent Provider Manager</h1>

<p align="center">
  <strong>Centralized API provider management for AI coding agents.</strong>
</p>

<p align="center">
  <a href="https://github.com/jaxtonzhc/agent-provider-manager/actions/workflows/ci.yml"><img src="https://github.com/jaxtonzhc/agent-provider-manager/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
  <a href="https://github.com/jaxtonzhc/agent-provider-manager/actions/workflows/release-gui.yml"><img src="https://github.com/jaxtonzhc/agent-provider-manager/actions/workflows/release-gui.yml/badge.svg" alt="Release GUI"></a>
  <a href="https://pypi.org/project/agent-provider-manager/"><img src="https://img.shields.io/pypi/v/agent-provider-manager" alt="PyPI"></a>
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
  <a href="https://pypi.org/project/agent-provider-manager/"><img src="https://img.shields.io/pypi/pyversions/agent-provider-manager" alt="Python"></a>
</p>

---

Your API subscriptions are the source of truth. Agents come and go — your provider config stays.

## GUI Desktop App

<p align="center">
  <img src="docs/screenshots/gui-overview.png" width="720" alt="APM GUI" />
</p>

Download the latest GUI release from [Releases](https://github.com/jaxtonzhc/agent-provider-manager/releases).

```
┌─────────────┐
│   Provider   │  ← Your API subscription (base URL + key)
│  (GLM 5.2)  │
└──────┬──────┘
       │  apm sync glm
       ├──────────────→ Claude Code
       ├──────────────→ Codex
       ├──────────────→ Cursor
       ├──────────────→ Hermes
       ├──────────────→ ZCode
       └──────────────→ ... (15 agents supported)
```

## Install

### Homebrew (macOS/Linux)

```bash
brew tap jaxtonzhc/tap
brew install apm
```

### pip / pipx

```bash
pip install agent-provider-manager
# or
pipx install agent-provider-manager
```

### One-line script

```bash
curl -sSL https://raw.githubusercontent.com/jaxtonzhc/agent-provider-manager/main/install.sh | bash
```

## Quick Start

```bash
# Interactive setup (recommended for first-time users)
apm init

# Or step by step:
apm scan                                # 1. Scan installed agents
apm provider add deepseek               # 2. Add a provider (key entered interactively)
apm sync deepseek                       # 3. Sync to all agents
apm status                              # 4. Check status
```

## Commands

### Core

| Command | Description |
|---------|-------------|
| `apm init` | Interactive setup guide |
| `apm scan` | Scan installed agents |
| `apm status` | Show current provider for each agent |
| `apm doctor [--fix]` | Diagnose and fix issues |

### Provider Management

| Command | Description |
|---------|-------------|
| `apm provider add` | Interactive provider selection from registry |
| `apm provider add <name>` | Add provider by name (key entered interactively) |
| `apm provider add <name> --key-env VAR` | Add provider with key from env var |
| `apm provider add <name> --url <url>` | Add custom provider (not in registry) |
| `apm provider add <name> --alias myname` | Add with custom alias |
| `apm provider add <name> --variant V` | Select specific variant (e.g., token-plan-cn) |
| `apm provider update <name> --url/--anthropic-url/--key/--models` | Update provider fields |
| `apm provider test [name]` | Test provider connectivity |
| `apm provider rename <old> <new>` | Rename a provider slug |
| `apm provider remove <name>` | Remove a provider |
| `apm provider list` | List configured providers |
| `apm provider show <name>` | Show provider details (models with context/reasoning/vision) |
| `apm provider import` | Import from installed agents |
| `apm provider known` | List known providers from registry |

### Sync

| Command | Description |
|---------|-------------|
| `apm sync` | Interactive provider selection, sync to all agents |
| `apm sync <provider>` | Sync to all installed agents |
| `apm sync <provider> --agents a1,a2` | Sync to specific agents |
| `apm sync <provider> --dry-run` | Preview changes |
| `apm switch <provider>` | Alias for sync |
| `apm undo` | Undo last sync (restore auto-snapshot) |

### Snapshot

| Command | Description |
|---------|-------------|
| `apm snapshot save [--name N]` | Save current agent configs |
| `apm snapshot restore <name>` | Restore from a snapshot |
| `apm snapshot list` | List saved snapshots |
| `apm snapshot delete <name>` | Delete a snapshot |

### Maintenance

| Command | Description |
|---------|-------------|
| `apm update` | Update provider/agent registry |
| `apm self-update` | Update apm itself |
| `apm logs [--tail N]` | Show log file |
| `apm agents` | List known agents |
| `apm providers` | List known providers |

### Debug & Machine-Readable Output

```bash
apm --debug status          # Verbose logging
APM_DEBUG=1 apm status     # Via environment variable
apm --json status           # JSON output (for GUI/scripts)
apm --json provider list    # All commands support --json
```

## Built-in Registry

**10 AI Agents** with full sync support (read + write config):

Claude Code, Codex, Cursor, Hermes, OpenClaw, ZCode, WorkBuddy, Aider, Pi, Oh-My-Pi

**5 additional agents** known (detection only, no sync yet):

GitHub Copilot, Windsurf, Continue, Mimocode, OpenCode

**13 Providers** with pre-configured base URLs, models, and capabilities:

OpenAI, Anthropic, DeepSeek, Google Gemini, GLM (Zhipu), SiliconFlow, OpenRouter, Volcengine, Alibaba Qwen, MiniMax, Xiaomi MiMo, Groq, ZAI

Each model includes metadata: context window (e.g., 1M), reasoning support, and vision capability.

The registry is updated remotely — run `apm update` to get the latest providers and models.

## Storage

```
~/.apm/
├── providers.json          # Your provider configs (mode 0600)
├── sync-state.json         # Sync history
├── registry-cache.json     # Remote registry cache
├── snapshots/              # Agent config backups (apm snapshot / apm undo)
└── apm.log                 # Debug log
```

## Development

```bash
git clone https://github.com/jaxtonzhc/agent-provider-manager.git
cd agent-provider-manager
pip install -e ".[dev]"
make test
```

## License

[MIT](LICENSE)
