mockql can use installed assistant CLIs as LLM backends.
claudecodexopencode
mockql executes these providers in non-interactive script mode. For Claude and Codex the generated prompt is piped to stdin; for OpenCode it is passed as a positional argument.
- The provider executable must be installed and available on
PATH - The provider must already be authenticated in whatever way that CLI expects
- The machine running
mockqlmust be allowed to launch unattended provider sessions
The current integration uses provider modes intended for unattended automation:
- Codex:
--yolo - Claude:
--dangerously-skip-permissions - OpenCode: none required (the
opencode runsubcommand is non-interactive by design)
That means the provider CLI is being invoked without interactive permission prompts. Do not treat this as a no-risk default. Use care when running mockql in repositories with sensitive source code, secrets, credentials, or production-adjacent configuration.
The CLI provider is selected as a transport subcommand after the flat oneshot / proxy options. The schema subcommand does not use an LLM provider.
mockql oneshot [flat options] cli --provider <claude|codex|opencode> [--model <model>]
--provideris required--modelis optional and defaults based on--provider:cli --provider claude=>sonnetcli --provider codex=>gpt-5.4-minicli --provider opencode=>github-copilot/gemini-3-flash-preview
Verified against the current mockql source and local CLI help output.
| Need | Codex | Claude | OpenCode | Notes |
|---|---|---|---|---|
| Non-interactive mode | codex exec [PROMPT] |
claude --print [prompt] |
opencode run [PROMPT] |
mockql uses codex exec, claude --print, and opencode run. |
| Read prompt from stdin | codex exec - |
claude --print - |
N/A — prompt is a positional argument | OpenCode receives the prompt as a CLI argument, not via stdin. |
| Pass model | -m, --model <MODEL> |
--model <MODEL> |
--model <MODEL> |
All three support direct model selection. |
| Reasoning setting | --config model_reasoning_effort="low" |
--effort low |
N/A | OpenCode does not expose a reasoning-effort flag. |
| Output mode | --json plus --output-last-message <path> |
--output-format json |
Raw JSON on stdout | Codex reads a temp file; Claude and OpenCode read stdout. |
| Permission bypass mode used | --yolo |
--dangerously-skip-permissions |
None needed | opencode run is non-interactive by design. |
These are the commands currently constructed by the library. The prompt content is generated at runtime and piped to stdin (or passed as a positional argument for OpenCode).
codex exec --skip-git-repo-check --yolo -m <model> --config 'model_reasoning_effort="low"' --json --output-last-message <temp>/last-message.json -Notes:
--skip-git-repo-checkavoids requiring the current directory to be a git repository--output-last-messagewrites the final assistant message to a temp file, whichmockqlparses as the GraphQL response- If no model is provided,
mockqldefaults togpt-5.4-mini
claude --print --dangerously-skip-permissions --model <model> --effort low --output-format json -Notes:
--printruns Claude in non-interactive modemockqlparses stdout as JSON and reads theresultfield from the response envelope- If Claude returns an error envelope,
mockqlsurfaces that as a request error - If no model is provided,
mockqldefaults tosonnet
opencode run <prompt> --model <model>Notes:
- The prompt is passed as a positional argument to
opencode run, not via stdin mockqlreads JSON directly from stdout and parses it as aGraphQLResponse- No permission-bypass or reasoning-effort flags are needed
- If no model is provided,
mockqldefaults togithub-copilot/gemini-3-flash-preview
For quick local experiments, use docs/prompt-example.md.
codex exec --skip-git-repo-check --yolo -m gpt-5.4-mini --config 'model_reasoning_effort="low"' --json --output-last-message mock-response.codex.json - < ./docs/prompt-example.mdclaude --print --dangerously-skip-permissions --model opus --effort low --output-format json - < ./docs/prompt-example.md > mock-response.claude.jsonopencode run "$(cat ./docs/prompt-example.md)" --model github-copilot/gemini-3-flash-preview > mock-response.opencode.json