CLI Reference
The fn CLI is a single static binary. Every command operates on an Agentic Function in the current directory unless you pass a name.
| Command | Description |
|---|---|
fn init | Scaffold a new Agentic Function from a template |
fn run | Execute an Agentic Function locally against an input |
fn eval | Score an Agentic Function against a dataset |
fn deploy | Deploy a version to an environment |
fn pin | Point an alias (stable, canary) at a version |
fn diff | Compare two versions of an Agentic Function |
fn rollback | Revert an alias to a prior version |
fn ls | List Agentic Functions, versions, and aliases |
fn logs | Stream run logs for a deployed Agentic Function |
fn init
fn init <name> [--template <template>]
Creates <name>/fn.yml. Built-in templates: classify, summarize,
extract, transform, generate.
fn run
fn run <name>[@<version>] --input <path> [--json]
Runs an Agentic Function locally. Defaults to the latest local version. --json prints
only the structured output, with no metadata line — useful for piping.
fn eval
fn eval <name>[@<version>] --dataset <file.jsonl> [--threshold <0-1>] [--runs <n>]
Grades an Agentic Function against a dataset. --runs re-executes each case N times to
measure consistency. Exits non-zero when the score is below --threshold.
fn deploy
fn deploy <name> --env <environment>
Compiles the current Agentic Function into a new immutable version and ships it to the named environment. Prints the version and endpoint URL.
fn pin & fn rollback
fn pin <name> <alias> --to <version>
fn rollback <name> --to <version>
Aliases are moving pointers. fn rollback is sugar for re-pinning stable to
an earlier version — instant, with no rebuild.