CliFi

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

FlagShorthandDefaultDescription
--env-elocalTarget environment for variable resolution
--config-cclifi.yamlPath to workflow configuration file
--dry-run-nfalsePreview execution plan without running tasks
--force-ffalseIgnore cache and force task re-execution
--parallelism-p4Maximum number of concurrent tasks
--output-otableOutput format: table, json, or plain
--verbose-vfalseEnable verbose logging with task internals
--watch-wfalseRe-run tasks when source files change
--varOverride a workflow variable (key=value)

Examples

Run the default workflow

bash
clifi run

Run specific tasks

bash
clifi run build test

Run with environment variables

bash
clifi run --env staging

Preview without executing

bash
clifi run --dry-run

Dry-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 total

Force re-execution

bash
clifi run --force

Limit parallelism

bash
clifi run --parallelism 2

JSON output for CI integration

bash
clifi run --output json > results.json

Watch 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=debug

Exit codes

CodeMeaning
0All tasks completed successfully
1One or more tasks failed
2Configuration error or invalid arguments
3Dependency resolution failure (cyclic dependency detected)

See also