rf init
Synopsis
Section titled “Synopsis”rf init [name] [options]Description
Section titled “Description”rf init creates a new project directory with a flow.yaml scaffold, a .rf/ runtime directory, and a .gitignore. If name is omitted, the current directory is used.
If the target directory already contains a flow.yaml, the command exits without overwriting.
Options
Section titled “Options”| Flag | Default | Description |
|---|---|---|
--template <name> | blank | Starter template: blank, csv-filter, api-fetch. |
--no-git | — | Skip Git initialization. |
--dir <path> | . | Create the project in a specific directory instead of using the name. |
Examples
Section titled “Examples”Basic init
Section titled “Basic init”$ rf init lead-scoring
Created lead-scoring/ flow.yaml pipeline definition (blank template) .rf/ runtime directory .gitignore configured
Initialized Git repository.
Next steps: cd lead-scoring rf runInit with a template
Section titled “Init with a template”$ rf init lead-scoring --template csv-filter
Created lead-scoring/ flow.yaml pipeline definition (csv-filter template) data/sample.csv sample input data .rf/ runtime directory .gitignore configured
Initialized Git repository.
Next steps: cd lead-scoring rf runInit in an existing directory
Section titled “Init in an existing directory”$ mkdir my-project && cd my-project$ rf init --dir .
Created flow.yaml, .rf/, .gitignore in current directory.Generated file structure
Section titled “Generated file structure”my-project/ flow.yaml # pipeline definition .rf/ # runtime directory (logs, state, artifacts) data/ # sample input data (non-blank templates only) sample.csv .gitignore # ignores .rf/, artifacts/flow.yaml (blank template)
Section titled “flow.yaml (blank template)”name: my-projectversion: 1
nodes: {}flow.yaml (csv-filter template)
Section titled “flow.yaml (csv-filter template)”name: my-projectversion: 1
nodes: read-data: type: source op: file.read params: path: data/sample.csv format: csv outputs: rows: type: Table
filter: type: deterministic op: sql.query params: query: "SELECT * FROM rows WHERE score >= 50" inputs: rows: type: Table from: ref(read-data.rows) outputs: filtered: type: Table
write-output: type: deterministic op: file.write params: path: output/filtered.json format: json inputs: data: type: Table from: ref(filter.filtered).gitignore
Section titled “.gitignore”.rf/artifacts/*.ndjson!data/**/*.ndjsonCommon errors
Section titled “Common errors”| Error | Cause |
|---|---|
Directory "foo" already contains flow.yaml | A project already exists at that path. Pick a different name or delete the existing file. |
Invalid project name "..." | Names must be lowercase alphanumeric with hyphens. No spaces, no special characters. |
Cannot create directory "..." | Parent directory doesn’t exist or you don’t have write permissions. |
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 | Project created successfully. |
1 | Directory already contains flow.yaml. |
2 | Invalid project name. |