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.
curl -fsSL https://raw.githubusercontent.com/muthuishere/askx/main/install.sh | sh
curl -fsSL https://raw.githubusercontent.com/muthuishere/askx/main/install.cmd -o install.cmd && install.cmd
npm install -g @muthuishere/askx
go install github.com/muthuishere/askx/cmd/askx@v0.1.0
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.jsonHonest limits
askxis a scripted, headless harness — not an interactive terminal chat TUI. If you want an interactive chat browser, useclaudeoraichat.- Multimodal
-fattachments depend on the target model supporting vision or PDF inputs; text-only Ollama models will reject image bytes. - A policy denial (exit
6) always hard-stops the run and never triggers a fallback profile, by design.