Skip to content

feat: embed CLIProxyAPIPlus, eliminate vibeproxy dependency#2

Closed
johannhipp wants to merge 2 commits intomasterfrom
feat/embed-cliproxy
Closed

feat: embed CLIProxyAPIPlus, eliminate vibeproxy dependency#2
johannhipp wants to merge 2 commits intomasterfrom
feat/embed-cliproxy

Conversation

@johannhipp
Copy link
Copy Markdown
Owner

What

Single binary with built-in provider auth. No vibeproxy needed.

Before: Amp CLI → amp-proxy → vibeproxy → CLIProxyAPIPlus → providers
After: Amp CLI → amp-proxy → providers

Changes

  • Embed CLIProxyAPIPlus as in-process provider gateway on ephemeral loopback port
  • CLI subcommands: amp-proxy login claude, amp-proxy status, amp-proxy serve
  • Optional YAML config with ${ENV} expansion — model remaps, API keys, provider toggles, routing strategy
  • Install script (bin/install.sh) — builds amp-proxy, downloads cli-proxy-api-plus, installs to ~/.local/bin
  • cache_control stripping (was in vibeproxy ThinkingProxy layer)
  • Default bind 127.0.0.1 (was 0.0.0.0)
  • Reuses existing ~/.cli-proxy-api/ tokens from vibeproxy — zero migration effort

Quick start after merge

./bin/install.sh
amp-proxy login claude
amp-proxy

Files

File Purpose
main.go CLI subcommands: serve, login, logout, status, version
config.go Optional YAML config with env expansion, sensible defaults
auth.go Provider login/logout/status using ~/.cli-proxy-api/ tokens
gateway.go Embeds CLIProxyAPIPlus via Builder/Service on ephemeral port
proxy.go Main HTTP handler — routing, cache_control strip, Exa tools
remap.go Model remapping now config-driven (was hard-coded)
bin/install.sh macOS + Linux installer
config.example.yaml Commented example config
ARCHITECTURE.md Full architecture doc with decision rationale

Testing

  • All 12 tests pass
  • Live-tested on port 28317 (separate from running session on 18317)
  • Verified: health, metrics, auth redirect, free-tier fake, model list via gateway, clean shutdown
  • Existing vibeproxy tokens detected automatically

Johann Hipp 🐻 and others added 2 commits March 27, 2026 15:05
Single binary with built-in provider auth. No vibeproxy needed.

- Embed CLIProxyAPIPlus as in-process provider gateway on ephemeral loopback port
- Add CLI subcommands: serve, login, logout, status, version
- Add optional YAML config with env var expansion and sensible defaults
- Move hard-coded model remappings to config (with same defaults)
- Add cache_control stripping middleware (was in vibeproxy's ThinkingProxy)
- Add install script (bin/install.sh) for macOS and Linux
- Reuse existing ~/.cli-proxy-api/ tokens from vibeproxy
- Default bind to 127.0.0.1 (was 0.0.0.0)
- All 12 tests pass, live-tested on separate port

Amp-Thread-ID: https://ampcode.com/threads/T-019d30f2-a7d6-73cd-ae34-2a8dabb213d8
Co-authored-by: Amp <amp@ampcode.com>
@johannhipp johannhipp closed this Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant