| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Proxy CodeBuddy through OpenAI-compatible and Anthropic-compatible APIs, with a built-in admin console for credentials, access keys, usage, debug traces, and runtime settings.
Forked from Sliverkiss/CodeBuddy2api.
docker run -d \
--name codebuddy2api \
--restart unless-stopped \
-p 8001:8001 \
-v "$(pwd)/.codebuddy_data:/app/.codebuddy_data" \
-v "$(pwd)/.codebuddy_creds:/app/.codebuddy_creds" \
ghcr.io/orangeboychen/codebuddy2api:latestOpen http://127.0.0.1:8001/ after startup.
Persistence is now routed through a storage abstraction layer. Business modules do not read or write files directly.
The file backend now writes into a dedicated data directory instead of a config/ tree:
Usage records, debug records, and credential rotation checkpoints are flushed in batches (at most once per second or after 100 pending records). File storage is therefore intended for a single application instance; multiple instances can overwrite each other's JSON documents.
Optional overrides:
When pg or sqlite storage is active, runtime persistence is stored in a database instead of local files.
In database mode, local files are not used for normal runtime persistence. Runtime configuration, credentials, access keys, and debug settings can be read as an optional one-time legacy import source during initialization. Historical usage and debug log JSON files are not imported.
Usage and debug records are stored as append-only, indexed event rows with retention pruning. PostgreSQL supports concurrent application instances. SQLite is a local, single-instance backend. Credential rotation checkpoints remain eventually consistent, so PostgreSQL replicas can occasionally select the same credential.
The application runs the bundled Drizzle migrations during database-backend initialization, so deployments do not require a separate schema-creation step. Keep legacy files available for the first application start so its idempotent import can copy configuration, credentials, access keys, and admin state. Only set CODEBUDDY_STORAGE_IMPORT_LEGACY_FILES=false after that start has completed.
bun install
mkdir -p .codebuddy_data .codebuddy_creds
bun run devThen open http://127.0.0.1:3000/.
Use the admin console to complete the CodeBuddy OAuth flow or add credentials manually. Local settings and console data are stored under .codebuddy_data/; credentials are stored under .codebuddy_creds/.
bun install
mkdir -p .codebuddy_data .codebuddy_creds
bun run build
bun startThen open http://127.0.0.1:8001/.
The admin console uses stable routes and supports English, Japanese, and Simplified Chinese.
Admin authentication is optional.
Passkey endpoints are available under /admin-api/auth/passkeys/*.
Passkeys use WebAuthn and therefore depend on both a valid origin and a valid RP ID.
Base path:
http://<host>:8001/v1
Supported endpoints:
Settings resolve in this order:
Current persisted runtime settings:
Models are discovered from CodeBuddy for each active credential. The credentials page shows one row per credential with its supported models and a refresh action. /v1/models only merges models from credentials bound to the requesting API key.
The server now includes key runtime and security logging for upstream failures and admin-sensitive flows.
Primary quality gates:
bun run lint
bun run format:check
bun run typecheck
bun run test
bun run buildTargeted suites used during this refactor:
bun run test -- tests/admin/console.test.tsx
bun run test -- tests/server/runtime.test.ts
bun run test -- tests/server/debug-usage.test.ts
bun run test -- tests/server/access-keys-credentials.test.ts
bun run test -- tests/server/units.test.tscp .env.example .env
mkdir -p .codebuddy_data .codebuddy_creds
docker compose -f deploy/docker-compose.yml up -dkubectl apply -f deploy/k8s/codebuddy2api.yaml
kubectl port-forward service/codebuddy2api 8001:8001See LICENSE.
| Back | FazBrowse Home | New Git URL |