askx

CLI & Go library · v0.1.0

One harness for every model, ACP agent, and coding CLI.

Swap OpenAI, Anthropic, Ollama, Devin ACP, OpenCode ACP, and Claude, Copilot, or Gemini CLI in one profiles.yaml — while tools, MCP servers, skills, JSON schemas, budgets, and policy guardrails stay on the host.

macOS · Linux · WindowsCGO_ENABLED=0 static binaryexit 0–6 contractApache-2.0
curl -fsSL https://raw.githubusercontent.com/muthuishere/askx/main/install.sh | sh

What it looks like in practice

Discover local Ollama models, installed coding CLIs, and API key environment variables once. Everything after that uses the same flags, exit codes, and audit log regardless of which backend answers.

askx init && askx doctor

askx "summarize in 3 bullets" -f README.md
askx --schema '{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}' "check"
askx --stream-json -p ollama "explain this diff"
askx -p ollama -f screenshot.png "what error is on this screen?"

Architecture

Most tools force a split between Unix pipe CLIs that only call HTTP APIs and vendor coding agents that own their own tools, flags, and permissions. askx keeps the harness local and swaps only the model or agent behind -p NAME.

Backends
OpenAI-compatible HTTP endpoints (OpenAI, Ollama, vLLM, OpenRouter), Anthropic Messages API, warm ACP sessions (Devin, OpenCode), and CLI adapters (Claude, Devin, OpenCode, Copilot, Gemini, or any custom command).
Host-owned tools
read, write, edit, glob, grep, bash, MCP servers, and skills run inside your host Toolkit — never delegated blindly to the remote agent.
Validated JSON Schema
--schema FILE|JSON enforces a JSON Schema across every backend with an automatic repair loop. Downstream scripts never receive unvalidated output.
Reusable subagent skills
Annotate any profile or template with category, description, when_to_use, and tags. Run askx install --subagents to export standard SKILL.md files that Claude Code, Codex, Devin, and ~/.agents/skills route to automatically.
Fallbacks & budgets
fallback: [ollama, claude-cli, openai] fails over on connection, timeout, 429/5xx, or credit errors — never on policy denial (exit 6). --max-tokens-budget and --max-cost hard-stop cleanly with exit 4.
Warm daemon & Go library
askx warm start keeps ACP and stream-json CLI sessions warm over 0600 local IPC. Or skip the CLI and import github.com/muthuishere/askx directly in pure Go (CGO_ENABLED=0).

One profiles.yaml, reusable as subagent skills

Profiles live in ~/.config/askx/profiles.yaml (mode 0600). API keys are referenced by environment variable name, never stored raw. Annotate any profile withcategory, description, and when_to_use, then runaskx install --subagents so your main coding agent knows when to delegate to it.

default_profile: ollama
profiles:
  log-triage:
    endpoint: http://127.0.0.1:11434/v1
    style: openai
    model: qwen3.5:4b
    category: ops
    description: Triage build and test logs into root cause and fix
    when_to_use: When a CI or test log exceeds 200 lines
    tags: [logs, ci, cheap]
    fallback: [claude-cli]

  claude-cli:
    style: cli
    preset: claude
    model: haiku
    mcp_config: ~/mcp.json

Honest limits

Documentation