rok-cli-0.7.0 is not a library.
Visit the last successful build:
rok-cli-0.10.0
rok - Run One, Know All
Execute multi-step tasks from JSON - the ultimate automation tool for developers and AI agents.
What is rok?
rok is a CLI tool that executes multi-step tasks defined in JSON format. It's designed for:
- Developer workflows - Automate repetitive tasks
- AI agents - Self-contained task execution
- CI/CD pipelines - Complex build and deployment scripts
- Self-evolution - Use rok to improve rok
Installation
# From crates.io
# From source
# Local development
Quick Start
Basic Usage
# Run from file
# Run from stdin
|
# Run from inline JSON
Example: File Operations
Core Concepts
Steps
rok provides 20+ built-in step types:
| Category | Steps |
|---|---|
| File Operations | read, write, mv, cp, rm, mkdir, patch |
| Search | grep, scan, extract |
| Code Analysis | summarize, lint, diff |
| Templates | template |
| Version Control | git, snapshot, restore |
| Network | http |
| Control Flow | if, each, parallel |
References
Pass data between steps using refs:
Conditionals
Advanced Features
Templates
Create reusable templates:
Templates support:
- Custom props with validation
- Inheritance (
extendsfield) - Derived transforms (pluralize, camelcase, etc.)
Task Files
Save and reuse tasks:
# Save current payload as a named task
# Run saved task
# List all tasks
Environment Variables
Use {{env.VAR_NAME}} in any string field:
Timeouts & Retries
Step Enhancements
All steps support:
id- Referenceable identifier- Custom fields per step type (max_bytes, create_dirs, case_sensitive, context_lines, encoding)
CLI Commands
rok - AI Agent Task Runner
Commands:
templates List available templates
init-template Create a new template
validate-template Validate a template schema
run Run a saved task
save Save current payload as task
list List saved tasks
edit Edit a saved task
watch Watch files and re-run
history Show execution history
replay Replay a previous run
Options:
-f, --file FILE Path to JSON file
-j, --json JSON Inline JSON payload
-o, --output Output format: json, pretty, silent
-v, --verbose Enable verbose output
-q, --quiet Suppress output
--dry-run Preview without executing
Configuration
Options
Self-Evolution
rok is self-hosting - use it to improve itself:
# Generate a new step module
See usage.md for more self-evolution patterns.
Development
# Build
# Test
# Lint
# Format
License
MIT License - see LICENSE for details.