feat(M3): Async CLI Integration
This commit is contained in:
@@ -28,12 +28,13 @@ npm install
|
||||
|
||||
```bash
|
||||
scripts/ai-cli-dispatch list --json
|
||||
scripts/ai-cli-dispatch exec --client codex --prompt "refactor this function"
|
||||
scripts/ai-cli-dispatch exec --client claude --prompt "add tests for auth middleware"
|
||||
scripts/ai-cli-dispatch exec --client opencode --prompt "migrate to ESM"
|
||||
scripts/ai-cli-dispatch run --client codex --prompt "refactor this function"
|
||||
scripts/ai-cli-dispatch run --client claude --prompt "add tests for auth middleware"
|
||||
scripts/ai-cli-dispatch run --client opencode --prompt "migrate to ESM"
|
||||
scripts/ai-cli-dispatch dispatch "use codex to write tests"
|
||||
```
|
||||
|
||||
Use `--json` for machine-readable command output.
|
||||
Use `--json` for machine-readable command output. Use `--sync` with `run` or `dispatch` to block until the client returns; the default is async (starts a background job and returns the job ID immediately).
|
||||
|
||||
## Client Discovery
|
||||
|
||||
@@ -47,7 +48,7 @@ Run `list` to see which clients are installed and their resolved versions.
|
||||
|
||||
## Background Jobs
|
||||
|
||||
For long-running or fire-and-forget tasks, use the programmatic job API instead of `exec`:
|
||||
For long-running or fire-and-forget tasks, use the programmatic job API or invoke `run` / `dispatch` without `--sync`:
|
||||
|
||||
```typescript
|
||||
import { startJob, getJob, cancelJob, listJobs, cleanupJobs } from "./src/jobs.js";
|
||||
|
||||
Reference in New Issue
Block a user