---
title: CLI Overview
description: 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](/docs/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`.

```bash
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](https://app.notiflows.com/account-tokens)), then log in:

```bash
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).

<Callout type="info">
**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](/docs/cli/account-tokens) for how to create, scope, and rotate the token.
</Callout>

Confirm who you are and which project is active:

```bash
notiflows whoami
```

## Quickstart

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

```bash
# 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](/docs/cli/notiflows-as-code) for the on-disk format.

## Explore

<Cards>
  <Card title="Notiflows as code" href="/docs/cli/notiflows-as-code">
    The on-disk format: notiflows.json, per-notiflow notiflow.json, the flat steps array, and template body extraction.
  </Card>
  <Card title="Command reference" href="/docs/cli/commands">
    Every command, grouped by area — auth, project, sync, lifecycle, trigger, and channels.
  </Card>
  <Card title="CI/CD" href="/docs/cli/ci-cd">
    Run the CLI in continuous integration with environment-based auth and idempotent pushes.
  </Card>
  <Card title="MCP server" href="/docs/ai/mcp">
    The same operations, conversationally, inside an AI editor.
  </Card>
</Cards>
