rok-cli-0.1.0 is not a library.
rok - Run One, Know All
An AI coding agent task runner that collapses multi-step operations into a single JSON invocation.
Installation
cargo install rok
Or download pre-built binaries from GitHub Releases.
Usage
rok --json '{ "steps": [...] }'
rok --file ./task.json
echo '{ "steps": [...] }' | rok
rok --json '...' --output pretty
rok --json '...' --dry-run
JSON Payload
{
"options": {
"cwd": ".",
"stopOnError": true,
"timeoutMs": 30000,
"env": {}
},
"steps": [
{ "type": "bash", "cmd": "find . -name '*.rs'" },
{ "type": "read", "path": "./src/**/*.rs" },
{ "type": "write", "path": "./output.txt", "content": "..." },
{ "type": "mkdir", "path": "./new-dir" },
{ "type": "mv", "from": "old", "to": "new" },
{ "type": "cp", "from": "src", "to": "dest", "recursive": true },
{ "type": "rm", "path": "./file", "recursive": true },
{ "type": "grep", "pattern": "TODO", "path": ".", "ext": ["rs", "toml"] },
{ "type": "replace", "pattern": "foo", "replacement": "bar", "path": ".", "ext": ["rs"] },
{
"type": "parallel",
"steps": [
{ "type": "mkdir", "path": "dir1" },
{ "type": "mkdir", "path": "dir2" }
]
}
]
}
Output
{
"status": "ok",
"stepsTotal": 5,
"stepsOk": 5,
"stepsFailed": 0,
"durationMs": 150,
"results": [...]
}
Exit Codes
| Code |
Meaning |
| 0 |
All steps completed successfully |
| 1 |
One or more steps failed |
| 2 |
Invalid JSON payload |
| 3 |
Startup error |
License
MIT