logo
icon

OneCLI

Open-source credential gateway and vault for AI agents. Store API keys once, inject them transparently when your agents make HTTP calls — they never see the real secrets.

template cover
Deployed1 times
Publisherglasschan
Created2026-08-01
Tags
AISecurityVaultCredentialsAI AgentsGateway

OneCLI — Secret Vault for AI Agents (create by SEAFOODHOLDHAND)

OneCLI is the open-source credential gateway that sits between your AI agents and the services they call. Store real API keys once in OneCLI's encrypted vault, give your agents placeholder keys (e.g. FAKE_KEY), and OneCLI's gateway injects the real credentials transparently on outbound requests — agents never see the real secrets.

This template deploys a complete OneCLI instance with a single click.

Architecture

[Zeabur LB] → OneCLI App (single image, two processes)
                  ├─ :10254  → Next.js Web Dashboard (UI + API)
                  └─ :10255  → Rust Gateway (credential injection proxy)
[PostgreSQL]   → OneCLI database (agents, secrets, audit logs)

The OneCLI app image (ghcr.io/onecli/onecli:latest) bundles:

  • Next.js web dashboard on port 10254 (UI, agent management, secret management)
  • Rust gateway on port 10255 (transparent credential injection proxy)
  • Prisma migrations run automatically on container start
  • Auto-generated SECRET_ENCRYPTION_KEY persisted to /app/data/ (AES-256-GCM)

⚠️ Read this before storing real credentials — Security

By default this template deploys in single-user / local mode: the dashboard opens with no login. Anyone who can reach your dashboard domain can see and manage every stored API key. OneCLI is a credential vault — that makes the default unsafe to expose on the public internet.

Before storing any real secret, do ONE of the following:

  1. Lock the dashboard behind Google OAuth — on the onecli service in the Zeabur Dashboard, set NEXTAUTH_SECRET + GOOGLE_CLIENT_ID + GOOGLE_CLIENT_SECRET together (all three, then restart). See "Post-Deployment Configuration" below.
  2. OR keep the dashboard on a private/non-public domain (e.g. reachable only over VPN or from a private network), so only you can open it.

The Gateway Domain (where agents send requests) is always public — that's fine, the gateway authenticates every call with a per-agent access token. The concern is only the Dashboard Domain in default local mode.

Why not just default to OAuth? OneCLI's auth is all-or-nothing: NEXTAUTH_SECRET set without Google credentials makes the dashboard redirect to a setup-error page. So local mode is the only working zero-input default; securing it is a deliberate one-time step you take after deploy.

How It Works

  1. Open the dashboard at https://your-domain.zeabur.app
  2. Create an agent and get an access token
  3. Store real API keys in OneCLI's encrypted vault (e.g. OpenAI, GitHub, Stripe)
  4. Configure your agent to route HTTP traffic through https://your-gateway-domain.zeabur.app (the separate Gateway Domain auto-provisioned for the gateway port)
  5. Give your agent a placeholder (e.g. Bearer FAKE_KEY) — when it makes a request, the gateway swaps it for the real credential
Your Agent → [FAKE_KEY] → OneCLI Gateway → [REAL_KEY] → External API (OpenAI, GitHub, etc.)
                                      ↓
                              Audit log + rate limit

Features

  • Transparent credential injection — agents make normal HTTP calls, gateway handles auth
  • AES-256-GCM encryption at rest — secrets decrypted only at request time
  • Host & path matching — route secrets to specific API endpoints
  • Multi-agent support — each agent gets its own scoped access token
  • Rust gateway — fast, memory-safe HTTP proxy with MITM interception
  • Two auth modes — single-user (no login, default) or Google OAuth (multi-user teams)
  • Vault integration — connect Bitwarden for on-demand credential injection
  • Full audit log — see exactly what every agent is doing

First Login

After deployment completes (may take 2-3 minutes for initial startup + migrations):

  1. Open https://your-domain.zeabur.app in your browser
  2. You'll land directly on the dashboard (no login required in single-user mode)
  3. Create your first agent and grab its access token
  4. Add secrets to the vault
  5. Point your AI agent's HTTP client to the gateway URL

Configure Your AI Agent

Once you have an agent token and at least one secret stored, point your agent at the Gateway Domain (a separate subdomain that Zeabur auto-provisions for the gateway port — find it in the service's Domains tab):

# Example: route OpenAI calls through OneCLI
curl https://your-gateway-domain.zeabur.app/v1/chat/completions \
  -H "Authorization: Bearer <your-agent-access-token>" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4","messages":[{"role":"user","content":"Hello!"}]}'

In your agent code, just use a placeholder like FAKE_OPENAI_KEY and OneCLI swaps it for the real key.

Post-Deployment Configuration (Optional)

Customize these environment variables in the Zeabur Dashboard under the onecli service:

Enable Google OAuth (multi-user mode)

Set all three together (then restart), or leave all three empty for single-user mode:

  • NEXTAUTH_SECRET → your NextAuth secret
  • GOOGLE_CLIENT_ID → your Google OAuth client ID
  • GOOGLE_CLIENT_SECRET → your Google OAuth client secret

⚠️ Auth is all-or-nothing: setting NEXTAUTH_SECRET alone (without the Google credentials) makes the dashboard redirect to a setup-error page. Set all three together, or none.

Custom Gateway Port

  • GATEWAY_PORT → default 10255

Notes

  • The encryption key (SECRET_ENCRYPTION_KEY) is auto-generated on first start and persisted to /app/data/. Don't lose this volume — without it, all stored secrets are unrecoverable.
  • The Rust gateway uses HTTPS interception (MITM) for credential injection. Your agent must trust the OneCLI CA cert (or set --insecure-skip-verify in development).
  • Database migrations run automatically via the entrypoint script.
  • The all-in-one image is ~500MB (Next.js + Rust gateway). Smaller than running separately.

Learn more: https://github.com/onecli/onecli

If you encounter any issues during deployment, please let me know via GitHub issues: https://github.com/glasschan/seafoodholdhand-zeabur-templates