notiflowsDocs
CLI

CLI Overview

Install the Notiflows CLI, authenticate with an account token, and manage your notiflows as code — pull, edit, push, and publish from the terminal or CI.

The Notiflows CLI (@notiflows/cli) is a notiflows-as-code tool. It pulls the notiflows in a project into version-controllable local files, lets you edit them in your editor, and pushes them back through the Management API. It also wraps the full lifecycle (publish, rollback, activate, deactivate, archive), read-only inspection (list/get versions, channels, projects), and triggering runs.

The CLI is a thin client over the Management API — creation, validation, versioning, and execution all happen server-side. The CLI only serializes notiflows to and from disk and calls the API.

Install

The package installs two binary aliases: notiflows and the shorthand nf.

npm install -g @notiflows/cli

# or run without installing
npx @notiflows/cli --help

Authenticate

The CLI authenticates with an account token (prefix nf_at_). Create one in the dashboard (Account tokens), then log in:

notiflows login
# or pass it non-interactively
notiflows login --token nf_at_xxx

The token is stored at ~/.config/notiflows/credentials.json with mode 0600 (owner read/write only).

Resolution precedence. The token is resolved as --token flag → NOTIFLOWS_TOKEN env → the stored credentials file. The project is resolved as --project flag → NOTIFLOWS_PROJECT env → the project field in notiflows.json. See Account tokens for how to create, scope, and rotate the token.

Confirm who you are and which project is active:

notiflows whoami

Quickstart

A typical loop is init → pull → edit → push → publish:

# 1. Create notiflows.json + the .notiflows/notiflows/ working tree
notiflows init my-app

# 2. Pull every notiflow in the project into local files
notiflows pull

# 3. Edit notiflow.json / template body files in your editor, then
#    push your changes back (creates a new draft version)
notiflows push

# 4. Publish the draft so it becomes live for execution
notiflows notiflow publish welcome-series

Notiflows live under <notiflowsDir>/notiflows/<handle>/ (default .notiflows). Each notiflow is a notiflow.json plus extracted template body files — see Notiflows as code for the on-disk format.

Explore

On this page