CLI Reference
clifi run
Execute a workflow defined in your clifi.yaml configuration.
Synopsis
clifi run [task...] [flags]Description
The run command executes tasks from the workflow defined in clifi.yaml. If no tasks are specified, CliFi runs the default task or all root-level tasks in dependency order.
CliFi builds a directed acyclic graph from task dependencies and executes tasks in parallel where safe. Outputs are cached by default, so unchanged tasks skip execution on subsequent runs.
The command supports dry-run mode for safe previews, environment-specific variable injection, and selective task execution for iterative development.
Flags
| Flag | Shorthand | Default | Description |
|---|---|---|---|
--env | -e | local | Target environment for variable resolution |
--config | -c | clifi.yaml | Path to workflow configuration file |
--dry-run | -n | false | Preview execution plan without running tasks |
--force | -f | false | Ignore cache and force task re-execution |
--parallelism | -p | 4 | Maximum number of concurrent tasks |
--output | -o | table | Output format: table, json, or plain |
--verbose | -v | false | Enable verbose logging with task internals |
--watch | -w | false | Re-run tasks when source files change |
--var | Override a workflow variable (key=value) |
Examples
Run the default workflow
bash
clifi runRun specific tasks
bash
clifi run build testRun with environment variables
bash
clifi run --env stagingPreview without executing
bash
clifi run --dry-runDry-run mode prints the execution plan showing task order, estimated duration, and cache status:
bash
Execution plan (dry-run):
[build] ~12s (cache: unknown)
[test] ~8s (cache: unknown)
[deploy] ~45s (cache: unknown)
3 tasks, estimated 65s totalForce re-execution
bash
clifi run --forceLimit parallelism
bash
clifi run --parallelism 2JSON output for CI integration
bash
clifi run --output json > results.jsonWatch mode for development
bash
clifi run build test --watch --glob "src/**/*.ts"Override variables inline
bash
clifi run deploy --var API_URL=https://api.example.com --var LOG_LEVEL=debugExit codes
| Code | Meaning |
|---|---|
| 0 | All tasks completed successfully |
| 1 | One or more tasks failed |
| 2 | Configuration error or invalid arguments |
| 3 | Dependency resolution failure (cyclic dependency detected) |
See also
- clifi init - Initialize a new CliFi project
- clifi status - Check workflow and environment status
- clifi logs - View execution logs from previous runs