Cli Agent
@mgreten/cli-agentv2026.05.19.2
01README
Invoke CLI coding agents (claude, opencode, amp, gemini) with typed inputs and capture structured outputs — tokens, cost, duration, retries, and exit code. Supports slash command resolution and JSON response parsing.
02Release Notes
Add commandSubdirs global arg for configurable slash command search paths.
03Models
@mgreten/cli-agentv2026.05.19.2cli_agent.ts
fn invoke(prompt: string, model?: string, cwd?: string, tags?: record, wallTimeoutMs?: number)
Run a CLI agent tool (claude, opencode, amp, gemini) with a prompt and record structured results
| Argument | Type | Description |
|---|---|---|
| prompt | string | The prompt or slash command to execute |
| model? | string | Override the default model (e.g. 'opus', 'sonnet', 'ollama/qwen3.6:35b') |
| cwd? | string | Working directory for the CLI (defaults to Deno.cwd()) |
| tags? | record | Arbitrary key-value tags for grouping/filtering invocations |
| wallTimeoutMs? | number | Override wall timeout in milliseconds |
fn invokeAndParse(prompt: string, model?: string, cwd?: string, tags?: record, wallTimeoutMs?: number)
Run a CLI agent and parse the JSON response from the output. Returns the parsed data alongside the invocation record.
| Argument | Type | Description |
|---|---|---|
| prompt | string | |
| model? | string | |
| cwd? | string | |
| tags? | record | |
| wallTimeoutMs? | number |
Resources
invocation(30d)— Structured record of a CLI agent invocation with provider, tokens, cost, and output
04Previous Versions
2026.05.19.1May 19, 2026
Initial release: multi-provider CLI agent invoker with structured output tracking.
05Stats
A
100 / 100
Downloads
7
Archive size
12.1 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types1/1earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
06Platforms