Skip to main content

Running a Local Agent

Most AI coding agents run as command-line tools over stdio. Bridge them to WebSocket with supergateway so Agmente can connect.

note

Prefer supergateway for local agents. It keeps the stdio child process alive across WebSocket reconnects so session IDs stay valid after app restarts.

Prerequisites

  • Node.js 18+ installed
  • An AI agent with ACP support (Gemini CLI, Qwen, Claude Code, etc.)
  • iPhone/iPad on the same network as your computer

Authenticate the agent

Agmente does not handle agent authentication. Run the agent CLI first and complete its auth flow.

AgentAuthentication method
Gemini CLIGoogle OAuth or GEMINI_API_KEY
Claude CodeAnthropic API key or Claude Pro/Max subscription via /login
QwenOAuth login or Alibaba Cloud API key
VibeOAuth login or MISTRAL_API_KEY

Example (Gemini CLI):

# Authenticate Gemini CLI first
npx @google/[email protected]

# Then start the WebSocket bridge
npx -y supergateway --stdio "npx @google/[email protected] --experimental-acp" --port 8765 --outputTransport ws
tip

Authentication tokens live with the agent CLI (for example, in your keychain). Agmente only speaks ACP over WebSocket and never sees your OAuth tokens or API keys.

Quick start (Gemini CLI)

npx -y supergateway --stdio "npx @google/[email protected] --experimental-acp" --port 8765 --outputTransport ws

This downloads supergateway, launches Gemini CLI with ACP enabled, and exposes ws://localhost:8765/message.

Supported agents

AgentACP supportsession/listsession/loadCapabilities
Gemini CLI✅ VerifiedContext, Image, Audio
Claude Code✅ VerifiedContext, Image
Qwen✅ VerifiedContext, Audio
Vibe (Mistral)✅ VerifiedContext only
  • ✅ Supported and tested
  • ❌ Not supported
  • ❓ Unknown
note

If an agent lacks session/list, Agmente stores session IDs locally. Long-term persistence works best when the agent supports session/load or when supergateway keeps the same agent process alive across reconnects.

Gemini CLI (Google)

npx -y supergateway --stdio "npx @google/[email protected] --experimental-acp" --port 8765 --outputTransport ws

In Agmente:

  • Protocol: ws
  • Host: your-mac-ip:8765/message

Qwen (Alibaba)

npm install -g qwen-cli
npx -y supergateway --stdio "qwen --experimental-acp" --port 8765 --outputTransport ws

In Agmente:

  • Protocol: ws
  • Host: your-mac-ip:8765/message

Qwen is recommended for full session persistence (session/list + session/load).

Vibe (Mistral)

npx -y supergateway --stdio "vibe-acp" --port 8765 --outputTransport ws

In Agmente:

  • Protocol: ws
  • Host: your-mac-ip:8765/message

Claude Code (Anthropic)

npx -y supergateway --stdio "npx @zed-industries/claude-code-acp" --port 8765 --outputTransport ws

In Agmente:

  • Protocol: ws
  • Host: your-mac-ip:8765/message
warning

Use supergateway for Claude Code so the agent process survives reconnects. Bridges that respawn the child process will invalidate session IDs after disconnects.

Find your computer's IP

ipconfig getifaddr en0

Or: System Settings → Network → Wi-Fi → Details → IP Address

Use the IP in Agmente as IP_ADDRESS:8765/message.