Tool

Inject API credentials into AI agent requests without exposing secrets

Open-source gateway that stores API credentials once and injects them transparently into agent HTTP calls, so AI agents never see real secrets.

Works with postgresbitwardengoogle

91
Spark score
out of 100
Updated 6 days ago
Version 1.43.3

Add to Favorites

Why it matters

Centralize and secure API credential management for AI agents by intercepting outbound HTTP requests, transparently swapping placeholder keys with encrypted real credentials, and providing a single audit point for all agent API access without ever exposing secrets to the agents themselves.

Outcomes

What it gets done

01

Store encrypted API credentials once and route them to multiple agents based on host and path patterns

02

Intercept agent HTTP requests through a gateway proxy and inject real credentials at request time

03

Manage per-agent access tokens and permissions through a web dashboard with audit logging

04

Integrate with password managers like Bitwarden for on-demand credential injection without server storage

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/onecli-onecli | bash

Overview

Onecli

An open-source gateway that sits between AI agents and the APIs they call: real credentials are stored once, encrypted with AES-256-GCM, and a Rust HTTP gateway swaps an agent's placeholder key for the real one on each outbound request, so the agent never sees the actual secret. Use it when multiple AI agents need to call external APIs and giving each agent raw credentials is a security risk; a single quick-start command runs the whole stack locally in single-user mode, or Google OAuth can be enabled for team use.

What it does

OneCLI is an open-source gateway that sits between AI agents and the services they call. Real API credentials are stored once, encrypted at rest with AES-256-GCM, and agents are given placeholder keys such as FAKE_KEY instead. When an agent makes an HTTP call through the gateway, OneCLI matches the request by host and path pattern, decrypts the matching credential, and injects the real key as a header or URL query parameter before the request goes out, so the agent's code and the agent itself never touch the real secret.

When to use - and when NOT to

Use it when multiple AI agents need to call external APIs and distributing raw credentials to each one is a security liability, since it centralizes auth, rotation, and visibility into what every agent is doing in one place. It runs in a single-user local mode with no login by default, useful for solo development; enabling Google OAuth for multi-user team access requires setting NEXTAUTH_SECRET and Google OAuth client credentials. It can also connect to an external password manager such as Bitwarden for on-demand credential injection without storing secrets on the OneCLI server itself.

Inputs and outputs

curl -fsSL https://onecli.sh/install | sh

That command starts the full stack, app plus PostgreSQL. The alternative manual path clones the repo and runs docker compose -f docker/docker-compose.yml up -d --wait. Either way, the dashboard opens at localhost:10254 to create an agent and add secrets, while the agent's HTTP traffic is pointed at the gateway on localhost:10255. Input is an agent's normal outbound HTTP call carrying a placeholder key; output is that same call forwarded with the real credential injected, invisible to the agent that sent it.

Integrations

The system is split into a Rust gateway (apps/gateway, port 10255) that intercepts outbound requests, including HTTPS via MITM interception, and authenticates agents via Proxy-Authorization headers carrying scoped access tokens; a Next.js web dashboard (apps/web, port 10254) for managing agents, secrets, and permissions, backed by a Prisma ORM package (packages/db) against PostgreSQL, plus a shared UI package built on shadcn/ui; and an AES-256-GCM encrypted secret store matched by host and path patterns, with the encryption key auto-generated unless SECRET_ENCRYPTION_KEY is set explicitly. Local development runs on mise, pnpm, Rust, and Docker, with pnpm dev starting both the web app and gateway together and separate pnpm db:up, pnpm db:migrate, and pnpm db:studio commands for managing the PostgreSQL schema through Prisma.

Who it's for

Teams and developers running multiple AI agents against external APIs who need centralized credential storage, rotation, and per-agent scoped access instead of embedding raw API keys in each agent. The project is Apache-2.0 licensed.

Source README
OneCLI

The secret vault for AI agents.
Store once. Inject anywhere. Agents never see the keys.

Website · Docs · Discord


How OneCLI works

What is OneCLI?

OneCLI is an open-source gateway that sits between your AI agents and the services they call. Instead of baking API keys into every agent, you store credentials once in OneCLI and the gateway injects them transparently. Agents never see the secrets.

Why we built it: AI agents need to call dozens of APIs, but giving each agent raw credentials is a security risk. OneCLI solves this with a single gateway that handles auth, so you get one place to manage access, rotate keys, and see what every agent is doing.

How it works: You store your real API credentials in OneCLI and give your agents placeholder keys (e.g. FAKE_KEY). When an agent makes an HTTP call through the gateway, the OneCLI gateway matches the request to the right credentials, swaps the FAKE_KEY for the REAL_KEY, decrypts them, and injects them into the outbound request. The agent never touches the real secrets. It just makes normal HTTP calls and the gateway handles the swap.

Architecture

OneCLI Architecture
  • Rust Gateway: fast HTTP gateway that intercepts outbound requests and injects credentials. Agents authenticate with access tokens via Proxy-Authorization headers.
  • Web Dashboard: Next.js app for managing agents, secrets, and permissions. Provides the API the gateway uses to resolve which credentials to inject for each request.
  • Secret Store: AES-256-GCM encrypted credential storage. Secrets are decrypted only at request time, matched by host and path patterns, and injected by the gateway as headers or URL query parameters.

Quick Start

The fastest way to run OneCLI locally:

curl -fsSL https://onecli.sh/install | sh

Or, if you prefer to run it manually:

git clone https://github.com/onecli/onecli.git
cd onecli
docker compose -f docker/docker-compose.yml up -d --wait

Open http://localhost:10254, create an agent, add your secrets, and point your agent's HTTP gateway to localhost:10255.

The Quick Start runs OneCLI in local mode (single-user, no login), so no .env or NEXTAUTH_SECRET is required. To enable Google OAuth for multiple users, set NEXTAUTH_SECRET and the Google credentials (see Configuration).

Features

  • Transparent credential injection: agents make normal HTTP calls, the gateway handles auth
  • Encrypted secret storage: AES-256-GCM encryption at rest, decrypted only at request time
  • Host & path matching: route secrets to the right API endpoints with pattern matching
  • Multi-agent support: each agent gets its own access token with scoped permissions
  • Easy setup: curl -fsSL https://onecli.sh/install | sh starts everything (app + PostgreSQL)
  • Two auth modes: single-user (no login) for local use, or Google OAuth for teams
  • Rust gateway: fast, memory-safe HTTP gateway with MITM interception for HTTPS
  • Vault integration: connect Bitwarden (or other password managers) for on-demand credential injection without storing secrets on the server

Project Structure

apps/
  web/            # Next.js app (dashboard + API, port 10254)
  gateway/        # Rust gateway (credential injection, port 10255)
packages/
  db/             # Prisma ORM + migrations
  ui/             # Shared UI components (shadcn/ui)
docker/
  Dockerfile      # App image (gateway + web)
  docker-compose.yml

Local Development

Prerequisites

  • mise (installs Node.js, pnpm, and other tools)
  • Rust (for the gateway)
  • Docker (for PostgreSQL)

Setup

mise install
pnpm install
cp .env.example .env
pnpm db:generate
pnpm db:up          # Start PostgreSQL
pnpm db:migrate     # Apply migrations
pnpm dev

Dashboard at http://localhost:10254, gateway at http://localhost:10255.

Commands

Command Description
pnpm dev Start web + gateway in dev mode
pnpm build Production build
pnpm check Lint + types + format
pnpm db:up Start PostgreSQL (Docker)
pnpm db:down Stop PostgreSQL
pnpm db:generate Generate Prisma client
pnpm db:migrate Run database migrations
pnpm db:studio Open Prisma Studio

Configuration

All environment variables are optional for local development:

Variable Description Default
DATABASE_URL PostgreSQL connection string See .env.example
NEXTAUTH_SECRET Enables Google OAuth (multi-user) Single-user mode
GOOGLE_CLIENT_ID Google OAuth client ID -
GOOGLE_CLIENT_SECRET Google OAuth client secret -
SECRET_ENCRYPTION_KEY AES-256-GCM encryption key Auto-generated

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.