Configure coding agents to use the Poe API.
# Install Poe wrapper binaries.
npm install -g poe-code
# Run your existing agent CLI through Poe (you’ll be prompted for api key on first run).
poe-claude --helpAlso available: poe-codex, poe-opencode.
This updates the provider’s config files so you can use the provider CLI directly.
# Claude Code
npx poe-code@latest configure claude-code
# Codex
npx poe-code@latest configure codex
# OpenCode
npx poe-code@latest configure opencode
# Kimi
npx poe-code@latest configure kiminpx poe-code@latest unconfigure claude-codeUtilities are especially useful for scripting and CI/CD.
npx poe-code@latest spawn codex "Say hello"echo "Say hello" | npx poe-code@latest spawn codexnpx poe-code@latest test codex# Claude Code
npx poe-code@latest install claude-code
# Codex
npx poe-code@latest install codex
# OpenCode
npx poe-code@latest install opencode
# Kimi
npx poe-code@latest install kimi--dry-run– show every mutation without touching disk.--yes– accept defaults for prompts.
Use poe-code programmatically in your own code:
import { spawn, getPoeApiKey } from "poe-code"
// Get stored API key
const apiKey = await getPoeApiKey()
// Run a prompt through a provider
const result = await spawn("claude-code", {
prompt: "Fix the bug in auth.ts",
cwd: "/path/to/project",
model: "claude-sonnet-4"
})
console.log(result.stdout)Runs a single prompt through a configured service CLI.
service– Service identifier (claude-code,codex,opencode)options.prompt– The prompt to sendoptions.cwd– Working directory for the service CLI (optional)options.model– Model identifier override (optional)options.args– Additional arguments forwarded to the CLI (optional)
Returns { stdout, stderr, exitCode }.
Reads the Poe API key with the following priority:
POE_API_KEYenvironment variable- Credentials file (
~/.poe-code/credentials.json)
Throws if no credentials found.