CLI Reference¶
The rak (Redis Agent Kit) command provides task, pipeline, and worker management.
Global Options¶
There are two kinds of commands:
- Redis-direct commands (
worker,pipelines) talk straight to Redis. Point them at Redis with--redis-urlorREDIS_URL:
rak --redis-url redis://myhost:6379 <command>
# or
export REDIS_URL=redis://myhost:6379
rak <command>
- Operator commands (
tasks/task,run,status,logs,chat,agent,health,up) talk to a running RAK API, not Redis directly. They need an API base via--api-baseorRAK_API_BASE_URL:
export RAK_API_BASE_URL=http://localhost:8000
rak tasks list
# or per-invocation
rak --api-base http://localhost:8000 tasks list
Run rak --help for the full command list.
Tasks¶
Task commands operate against a running RAK API (set RAK_API_BASE_URL or pass --api-base, see Global Options).
List Tasks¶
Get Task¶
Output:
Task: 01HXYZ...
Status: done
Message: What is Redis?
Result: {"answer": "Redis is..."}
Updates:
- [info] Searching knowledge base...
- [tool_call] Found 5 documents
Cancel Task¶
Other Task Commands¶
rak tasks status <task_id> # current status
rak tasks logs <task_id> # task updates/log
rak tasks result <task_id> # result payload
rak tasks run "<message>" # create and queue a task
rak tasks input <task_id> # submit input to a task awaiting it
Pipelines¶
Run Pipeline¶
# Basic
rak pipelines run ./docs
# With patterns
rak pipelines run ./docs -p "*.md" -p "*.txt"
# Custom chunking
rak pipelines run ./docs --chunk-size 500 --chunk-overlap 100
Check Status¶
Output:
Clear Data¶
Worker¶
Start Worker¶
# Default settings
rak worker
# Custom concurrency
rak worker --concurrency 8
# Custom queue
rak worker --name my_queue
# Custom Redis
rak worker --redis-url redis://myhost:6379
# Load tasks from an iterable collection
rak worker --tasks myapp.tasks:tasks
The referenced object must be iterable, for example tasks = [kit.worker_task].
Worker Output¶
Starting worker on queue: my_queue
Concurrency: 4
Redis: redis://localhost:6379
Processing task 01HXYZ...
Task completed: 01HXYZ...
Environment Variables¶
| Variable | Default | Description |
|---|---|---|
REDIS_URL |
redis://localhost:6379 |
Redis connection (Redis-direct commands: worker, pipelines) |
RAK_API_BASE_URL |
- | RAK API base URL for operator commands (tasks, run, status, logs, chat, ...) |
OPENAI_API_KEY |
- | For embeddings |