MCPcopy
hub / github.com/router-for-me/Cli-Proxy-API-Management-Center

github.com/router-for-me/Cli-Proxy-API-Management-Center @v1.17.9 sqlite

repository ↗ · DeepWiki ↗ · release v1.17.9 ↗
1,309 symbols 3,037 edges 194 files 26 documented · 2%
README

CLI Proxy API Management Center

A single-file Web UI (React + TypeScript) for operating and troubleshooting the CLI Proxy API via its Management API (config, credentials, and logs).

中文文档

Main Project: https://github.com/router-for-me/CLIProxyAPI
Example URL: https://remote.router-for.me/
Minimum Required Version: ≥ 7.1.0 (recommended latest)

Since version 6.0.19, the Web UI ships with the main program; access it via /management.html on the API port once the service is running.

What this is (and isn’t)

  • This repository is the Web UI only. It talks to the CLI Proxy API Management API (/v0/management) to read/update config, upload credentials, and view logs.
  • It is not a proxy and does not forward traffic.

Quick start

Option A: Use the Web UI bundled in CLI Proxy API (recommended)

  1. Start your CLI Proxy API service.
  2. Open: http://<host>:<api_port>/management.html
  3. Enter your management key and connect.

The address is auto-detected from the current page URL; manual override is supported.

Option B: Run the dev server

bun install --frozen-lockfile
bun run dev

Open http://localhost:5173, then connect to your CLI Proxy API backend instance.

Option C: Build a single HTML file

bun install --frozen-lockfile
bun run build
  • Output: dist/index.html (all assets are inlined).
  • For CLI Proxy API bundling, the release workflow renames it to management.html.
  • To preview locally: bun run preview

Tip: opening dist/index.html via file:// may be blocked by browser CORS; serving it (preview/static server) is more reliable.

Connecting to the server

API address

You can enter any of the following; the UI will normalize it:

  • localhost:8317
  • http://192.168.1.10:8317
  • https://example.com:8317
  • http://example.com:8317/v0/management (also accepted; the suffix is removed internally)

Management key (not the same as API keys)

The management key is sent with every request as:

  • Authorization: Bearer <MANAGEMENT_KEY> (default)

This is different from the proxy api-keys you manage inside the UI (those are for client requests to the proxy endpoints).

Remote management

If you connect from a non-localhost browser, the server must allow remote management (e.g. allow-remote-management: true).
Check the CLI Proxy API server documentation/config comments for the full authentication rules, server-side limits, and edge cases.

What you can manage (mapped to the UI pages)

  • Dashboard: connection status, server version/build date, quick counts, model availability snapshot.
  • Config Panel: visual editor for common config.yaml fields, basic settings, proxy api-keys, and source editing with YAML highlighting/search plus a save diff preview.
  • AI Providers:
  • Gemini/Codex/Claude/Vertex key entries (base URL, headers, proxy, model aliases, excluded models, prefix).
  • OpenAI-compatible providers (multiple API keys, custom headers, model alias import via /v1/models, optional browser-side "chat/completions" test).
  • Auth Files: upload/download/delete JSON credentials, filter/search/pagination, runtime-only indicators, view supported models per credential (when the server supports it), manage OAuth excluded models (supports * wildcards), configure OAuth model alias mappings.
  • OAuth: start OAuth/device flows for Codex, Anthropic/Claude, Antigravity, Kimi, and xAI/Grok; poll status; submit callback URLs or xAI/Grok displayed codes; import Vertex JSON credentials and iFlow cookies.
  • Quota Management: manage quota limits and usage for Claude, Antigravity, Codex, Kimi, xAI/Grok, and other providers.
  • Logs: tail logs with incremental polling, auto-refresh, search, hide management traffic, clear logs; download request error log files.
  • System: quick links, update check, request logging toggle, local login data cleanup, and fetch /v1/models (grouped view). Requires at least one proxy API key to query models.

Tech Stack

  • React 19 + TypeScript 6.0
  • Vite 8 (single-file build)
  • Zustand (state management)
  • Axios (HTTP client)
  • react-router-dom v7 (HashRouter)
  • Motion (animations)
  • CodeMirror 6 (YAML editor)
  • SCSS Modules (styling)
  • i18next (internationalization)

Internationalization

Currently supports four languages:

  • English (en)
  • Simplified Chinese (zh-CN)
  • Traditional Chinese (zh-TW)
  • Russian (ru)

The UI language is automatically detected from browser settings and can be manually switched from the login page or header language menu.

Browser Compatibility

  • Build target: ES2020
  • Supports modern browsers (Chrome, Firefox, Safari, Edge)
  • Responsive layout for mobile and tablet access

Build & release notes

  • Vite produces a single HTML output (dist/index.html) with all assets inlined (via vite-plugin-singlefile).
  • Tagging vX.Y.Z triggers .github/workflows/release.yml to publish dist/management.html.
  • The UI version shown on the System page is injected at build time (env VERSION, git tag, or package.json fallback).

Security notes

  • The management key is stored in browser localStorage using a lightweight obfuscation format (enc::v1::...) to avoid plaintext storage; treat it as sensitive.
  • Use a dedicated browser profile/device for management. Be cautious when enabling remote management and evaluate its exposure surface.

Troubleshooting

  • Can’t connect / 401: confirm the API address and management key; remote access may require enabling remote management in the server config.
  • Repeated auth failures: the server may temporarily block remote IPs.
  • Logs page missing: enable “Logging to file” in Basic Settings; the navigation item is shown only when file logging is enabled.
  • Some features show “unsupported”: the backend may be too old or the endpoint is disabled/absent (common for model lists per auth file, excluded models, logs).
  • OpenAI provider test fails: the test runs in the browser and depends on network/CORS of the provider endpoint; a failure here does not always mean the server cannot reach it.

Development

bun run dev        # Vite dev server
bun run build      # tsc + Vite build
bun run preview    # serve dist locally
bun run lint       # ESLint (fails on warnings)
bun run format     # Prettier
bun run type-check # tsc --noEmit

Contributing

Issues and PRs are welcome. Please include:

  • Reproduction steps (server version + UI version)
  • Screenshots for UI changes
  • Verification notes (bun run lint, bun run type-check, bun run build)

License

MIT

Extension points exported contracts — how you extend this code

Notification (Interface)
(no doc)
src/types/common.ts
SidebarNavLinkItem (Interface)
(no doc)
src/components/layout/MainLayout.tsx
StatusBlockDetail (Interface)
(no doc)
src/utils/recentRequests.ts
ConfirmationOptions (Interface)
(no doc)
src/stores/useNotificationStore.ts
ErrorLogItem (Interface)
(no doc)
src/pages/LogsPage.tsx
ApiKeyFunUsageSummary (Interface)
(no doc)
src/features/providers/sponsor.ts
StorageOptions (Interface)
(no doc)
src/services/storage/secureStorage.ts
ApiResponse (Interface)
(no doc)
src/types/common.ts

Core symbols most depended-on inside this repo

L
called by 103
src/components/config/configSearchIndex.ts
isRecord
called by 61
src/utils/helpers.ts
get
called by 58
src/services/api/client.ts
asString
called by 55
src/services/api/plugins.ts
normalizeProviderKey
called by 35
src/components/providers/hooks/useProviderRecentRequests.ts
delete
called by 30
src/services/api/client.ts
normalizeStringValue
called by 26
src/utils/quota/parsers.ts
docHas
called by 26
src/hooks/useVisualConfig.ts

Shape

Function 1,061
Interface 225
Method 19
Class 4

Languages

TypeScript100%

Modules by API surface

src/hooks/useVisualConfig.ts58 symbols
src/components/ui/icons.tsx54 symbols
src/components/quota/quotaConfigs.ts44 symbols
src/components/config/VisualConfigEditorBlocks.tsx39 symbols
src/pages/OAuthPage.tsx35 symbols
src/types/quota.ts32 symbols
src/services/api/providers.ts29 symbols
src/pages/LogsPage.tsx28 symbols
src/features/providers/sheets/forms/SponsorProviderForm.tsx28 symbols
src/services/api/authFiles.ts25 symbols
src/components/modelAlias/ModelMappingDiagram.tsx24 symbols
src/services/api/plugins.ts23 symbols

Dependencies from manifests, versioned

@codemirror/lang-yaml6.1.2 · 1×
@codemirror/merge6.12.0 · 1×
@eslint/js9.39.1 · 1×
@types/react19.2.7 · 1×
@types/react-dom19.2.3 · 1×
@typescript-eslint/eslint-plugin8.59.3 · 1×
@typescript-eslint/parser8.59.3 · 1×
@uiw/react-codemirror4.25.3 · 1×
@vitejs/plugin-react6.0.1 · 1×
axios1.15.2 · 1×
eslint9.39.1 · 1×
eslint-plugin-react-hooks7.0.1 · 1×

For agents

$ claude mcp add Cli-Proxy-API-Management-Center \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact