Dependency Commands
Dependency commands manage relationships between tasks. Use these to control the order in which tasks are executed and to prevent tasks from starting before their prerequisites are complete.
ralph dependency
Show the dependency graph for all tasks.
ralph dependencyAlias: ralph dependency graph
Output:
Task Dependencies:
[1] Set up project scaffolding
└── (no dependencies)
[2] Add database schema
└── depends on: [1]
[3] Implement user API endpoints
└── depends on: [1], [2]ralph dependency graph
Display a visual representation of task dependencies.
ralph dependency graphShows all tasks and their dependency relationships.
ralph dependency validate
Check for dependency issues.
ralph dependency validateValidates:
- No circular dependencies
- All referenced tasks exist
- Dependencies are consistent
Output:
Dependency validation passed.Or if issues are found:
Dependency validation failed:
- Circular dependency detected: [2] -> [3] -> [2]
- Task [5] depends on non-existent task [99]ralph dependency ready
List tasks that are ready to be worked on.
ralph dependency readyShows tasks that have no unfinished dependencies.
Output:
Ready tasks:
[1] Set up project scaffolding
[4] Write documentationralph dependency blocked
List tasks that are blocked by incomplete dependencies.
ralph dependency blockedShows tasks waiting on other tasks to complete.
Output:
Blocked tasks:
[2] Add database schema
└── waiting on: [1]
[3] Implement user API endpoints
└── waiting on: [1], [2]ralph dependency order
Show the execution order based on dependencies.
ralph dependency orderDisplays the order in which tasks should be completed.
Output:
Execution order:
1. [1] Set up project scaffolding
2. [4] Write documentation
3. [2] Add database schema
4. [3] Implement user API endpointsralph dependency show
Show dependencies for a specific task.
ralph dependency show 3Arguments:
| Argument | Description |
|---|---|
<id> | Task number |
Output:
Task [3] Implement user API endpoints
Dependencies:
- [1] Set up project scaffolding (done)
- [2] Add database schema (pending)
Blocked by: [2]ralph dependency set
Set all dependencies for a task.
ralph dependency set 3 1 2Arguments:
| Argument | Description |
|---|---|
<id> | Task number to modify |
[deps...] | Task numbers that this task depends on |
This replaces any existing dependencies.
Examples:
ralph dependency set 3 1 2
ralph dependency set 5ralph dependency add
Add a dependency to a task.
ralph dependency add 3 2Arguments:
| Argument | Description |
|---|---|
<id> | Task number to modify |
<dep> | Task number to add as dependency |
Adds to existing dependencies without removing them.
ralph dependency remove
Remove a dependency from a task.
ralph dependency remove 3 1Arguments:
| Argument | Description |
|---|---|
<id> | Task number to modify |
<dep> | Task number to remove as dependency |
How Dependencies Work
During Sessions
When Ralph runs, it respects task dependencies:
- Only tasks with all dependencies completed are eligible
ralph task currentreturns the first eligible task- Blocked tasks are skipped until dependencies complete
Best Practices
Keep dependencies minimal:
Only add dependencies where truly necessary. Over-constraining can slow down execution.
Use for true prerequisites:
ralph dependency add 3 2Don’t use for preferences:
If task order is just a preference, let Ralph handle it naturally.
Next Steps
- Task Commands — Managing tasks
- Core Concepts: Tasks — Understanding tasks