← Back to Skills Marketplace
ilzc

CLI AI Proxy

by Leo Liao · GitHub ↗ · v0.1.3 · MIT-0
cross-platform ✓ Security Clean
118
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install cli-ai-proxy
Description
Manage cli-ai-proxy: local OpenAI-compatible proxy that routes requests through Gemini CLI and Claude Code. The proxy itself reads no credentials; the underl...
README (SKILL.md)

CLI AI Proxy

Local OpenAI-compatible proxy that bridges Gemini CLI and Claude Code to a unified REST API. Requests go through the installed CLI tools — the proxy makes no direct AI-vendor API calls and holds no API keys. Authentication (OAuth, API keys, session tokens) is managed by the gemini / claude CLIs themselves.

What This Installs

This skill installs the cli-ai-proxy package from the public npm registry. Specifically:

  • Source: public npm registry package cli-ai-proxy (no GitHub clone, no local build step)
  • Postinstall scripts: none — the package's package.json declares no preinstall/postinstall hooks
  • Runtime dependencies: one — yaml (config parsing)
  • Filesystem writes: only under the global npm prefix (for the binary) and, when the proxy runs, under its working directory for config.yaml, .proxy.pid, and proxy.log
  • Config mutations: only if you explicitly run configure-provider.sh / cli-ai-proxy configure-openclaw, which edits ~/.openclaw/openclaw.json and writes a .bak backup next to it first
  • Network at runtime: localhost HTTP server only; outbound calls are performed by the user's installed gemini / claude CLIs, not by the proxy itself

When to Use

✅ User asks to start/stop/check the AI proxy ✅ User wants to route requests through Gemini CLI or Claude Code ✅ User asks about available models or proxy health ✅ User wants to configure OpenClaw to use the proxy ✅ Troubleshooting proxy connectivity or CLI issues

❌ Direct API calls to OpenAI/Anthropic/Google (this proxy only uses CLI tools) ❌ Managing API keys (CLIs handle their own authentication)

Quick Reference

Action Command
Start proxy {baseDir}/scripts/start.sh
Stop proxy {baseDir}/scripts/stop.sh
Check status {baseDir}/scripts/status.sh
Health check {baseDir}/scripts/health.sh
Configure OpenClaw {baseDir}/scripts/configure-provider.sh
Full install {baseDir}/scripts/install.sh

Proxy Lifecycle

Starting

{baseDir}/scripts/start.sh

Starts the proxy on 127.0.0.1:9090 (default). The proxy listens for OpenAI-compatible requests and routes them to the appropriate CLI tool.

Before starting, verify at least one CLI is available:

  • gemini --version (Gemini CLI)
  • claude --version (Claude Code)

Checking Status

{baseDir}/scripts/status.sh

Shows: running/stopped, PID, health endpoint data, available CLI providers, concurrency stats.

Stopping

{baseDir}/scripts/stop.sh

Gracefully shuts down the proxy: stops accepting connections, kills active CLI subprocesses, cleans up.

Available Models

Model ID Provider Backend Model
gemini Gemini CLI CLI default (auto-upgrades)
claude Claude Code CLI default (auto-upgrades)
claude-sonnet Claude Code sonnet
claude-opus Claude Code opus

When OpenClaw is configured, use as cli-ai-proxy/gemini, cli-ai-proxy/claude, etc.

OpenClaw Integration

To configure OpenClaw to route through the proxy:

{baseDir}/scripts/configure-provider.sh

This automatically:

  1. Adds cli-ai-proxy as a provider in ~/.openclaw/openclaw.json
  2. Registers all proxy models in the agent defaults
  3. Creates a backup of the original config

After configuring, set the default model in openclaw.json:

{ "agents": { "defaults": { "model": { "primary": "cli-ai-proxy/gemini" } } } }

API Endpoints

The proxy exposes:

  • POST /v1/chat/completions — Chat completions (streaming + non-streaming)
  • GET /v1/models — List available models
  • GET /health — Health check with provider status and concurrency info

Default base URL: http://127.0.0.1:9090/v1

For full API details see references/api.md.

Image Support

The proxy supports images in messages. When a request contains image_url content parts:

  1. Images are saved to temporary files
  2. The prompt instructs the CLI to read the image via its built-in file tools
  3. Temp files are automatically cleaned up after each request

Supports both base64 data URLs and remote image URLs.

Configuration

Config file: config.yaml in the proxy installation directory.

Key settings:

  • server.port — Listen port (default: 9090)
  • concurrency.max — Max concurrent CLI processes (default: 5)
  • timeout — CLI process timeout in ms (default: 300000)
  • defaultModel — Default model when none specified

For full configuration options see references/configuration.md.

Troubleshooting

Proxy won't start

  1. Check if port 9090 is already in use: lsof -i :9090
  2. Verify Node.js is available: node --version
  3. Check logs: read the proxy.log file in the installation directory

CLI not available

  1. Verify CLI is installed and in PATH: which gemini or which claude
  2. Check CLI auth: gemini --version or claude --version
  3. The proxy health endpoint shows which CLIs are available

429 Too Many Requests

The concurrency limit has been reached. Either:

  • Wait for current requests to complete
  • Increase concurrency.max in config.yaml

Timeout errors (504)

The CLI process took too long. Either:

  • Increase timeout in config.yaml
  • Check if the CLI is hanging (auth issues, network)

For more troubleshooting see references/troubleshooting.md.

Usage Guidance
This skill appears to do what it says: install an npm CLI that proxies OpenAI-style requests through your installed Gemini/Claude CLIs and optionally registers itself in your OpenClaw config. Before installing: (1) inspect the npm package (npm view cli-ai-proxy, npm pack or review its source) to confirm there are no unexpected postinstall hooks or malicious code; (2) prefer installing with an unprivileged Node setup (nvm/fnm/volta) rather than sudo to avoid system-wide changes; (3) verify maintainers and package version on the registry; (4) keep the proxy bound to 127.0.0.1 (do not change server.host to 0.0.0.0) because the proxy is unauthenticated and exposes permissive CORS; (5) be aware running configure-provider.sh will modify ~/.openclaw/openclaw.json (a backup should be created) and may change your agent's default model. If you cannot or do not want to trust the remote npm package, consider extracting and reviewing the package tarball first or running the package in a confined environment.
Capability Analysis
Type: OpenClaw Skill Name: cli-ai-proxy Version: 0.1.3 The skill bundle is a management wrapper for the 'cli-ai-proxy' utility, which allows local Gemini and Claude CLIs to be used via an OpenAI-compatible API. It includes scripts for installation (via npm), service lifecycle management (start/stop/status), and configuration of the OpenClaw provider settings. The documentation (SKILL.md and references/) clearly outlines the tool's behavior, including its reliance on external CLIs for authentication and the security implications of binding the local proxy to non-loopback addresses. No evidence of data exfiltration, malicious execution, or obfuscation was found; all actions are transparent and aligned with the stated purpose.
Capability Tags
requires-oauth-tokenrequires-sensitive-credentials
Capability Assessment
Purpose & Capability
Name/description align with requested binaries (node/npm and gemini/claude) and with what the scripts do (install and run the cli-ai-proxy binary). Requiring Node and an npm package is expected for this purpose.
Instruction Scope
Runtime instructions and scripts call the installed cli-ai-proxy binary (start/stop/status/health) and document the proxy's behavior. The proxy will write config.yaml, .proxy.pid, proxy.log and temporary image files in its working directory, and the configure script edits ~/.openclaw/openclaw.json (with a backup). These are expected but worth noting since they mutate a user config and write local files.
Install Mechanism
Install uses npm install -g cli-ai-proxy from the public registry, which is appropriate for a Node CLI. This is a moderate-risk install vector because remote npm packages can contain arbitrary code; the skill claims the package has no install hooks, but the remote package contents were not provided for verification.
Credentials
The skill itself requires no additional environment variables and defers authentication to the gemini/claude CLIs (the docs explicitly state GEMINI_API_KEY/ANTHROPIC_API_KEY are consumed by those CLIs). The environment variables referenced in docs are proportional and related to the CLIs or proxy config.
Persistence & Privilege
always:false (no forced/global install). The only persistent modification described is optional: configure-provider.sh edits ~/.openclaw/openclaw.json (it claims to make a timestamped .bak). This is coherent with integrating the proxy as a model provider but is a notable config mutation the user should consent to.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cli-ai-proxy
  3. After installation, invoke the skill by name or use /cli-ai-proxy
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.3
- Clarified that the proxy itself does not read or manage any credentials or API keys; authentication is always handled by the underlying CLI tools (Gemini/Claude). - Updated description to emphasize the proxy makes no direct calls to AI vendor APIs. - Removed mentions and implications of API key management. - Minor wording changes for accuracy and clarity regarding authentication flow and proxy responsibilities. - No code or functional changes; documentation only.
v0.1.2
Summary: Improves transparency about package installation, dependencies, and side effects. - Adds an explicit section detailing what the skill installs, including package source, dependencies, and filesystem impact - States that installation uses the public npm registry only (no GitHub clone or build steps) - Clarifies that no postinstall scripts are run and only a single runtime dependency (`yaml`) is required - Explains exactly when and where filesystem and config changes can occur - Specifies that the proxy itself only listens on localhost and that all outbound requests are handled by user CLIs - Updates model table to clarify that `gemini` and `claude` model IDs auto-upgrade according to the respective CLI
v0.1.0
Initial release: OpenAI-compatible proxy for Gemini CLI and Claude Code. Supports streaming, sessions, image input, concurrency control.
Metadata
Slug cli-ai-proxy
Version 0.1.3
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is CLI AI Proxy?

Manage cli-ai-proxy: local OpenAI-compatible proxy that routes requests through Gemini CLI and Claude Code. The proxy itself reads no credentials; the underl... It is an AI Agent Skill for Claude Code / OpenClaw, with 118 downloads so far.

How do I install CLI AI Proxy?

Run "/install cli-ai-proxy" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is CLI AI Proxy free?

Yes, CLI AI Proxy is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does CLI AI Proxy support?

CLI AI Proxy is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created CLI AI Proxy?

It is built and maintained by Leo Liao (@ilzc); the current version is v0.1.3.

💬 Comments