Skip to content

CLI ​

The civitai CLI (Go, repo civitai/cli) is the canonical command-line tool for Civitai — searching and downloading models, running generations, and authoring Apps. Its app command group scaffolds a correct project, validates it against the platform contract, and packages + submits it for review.

This replaces the deprecated @civitai/blocks-cli

The old npm @civitai/blocks-cli (with init / dev / deploy) is deprecated. Install the civitai binary instead — its authoring commands below are the source of truth.

Install ​

Pick whichever fits — npm is the most convenient if you already have Node; the others need no Node toolchain:

bash
# npm (a thin wrapper that downloads the matching prebuilt binary)
npm install -g @civitai/cli
# or, without installing:
npx @civitai/cli --help

# Homebrew (macOS only — see the note below)
brew install civitai/tap/civitai

# Go install (from source, Go 1.25+)
go install github.com/civitai/cli/cmd/civitai@latest

# Nix flake — run without installing:
nix run github:civitai/cli -- --help
# …or install into your profile:
nix profile install github:civitai/cli

Homebrew is macOS-only

The tap publishes a cask, not a formula — the CLI's release config carries homebrew_casks: and no brews: stanza — and a cask is a macOS-only concept. On Linux (Linuxbrew included) brew install civitai/tap/civitai has nothing to install; use npm, the Nix flake, go install, or a prebuilt binary instead.

The npm install-scripts warning is expected

A successful npm 11 install still ends with a warning that @civitai/cli's postinstall is "not yet covered by allowScripts". That is an advisory about a future npm policy, not a report that the script was skipped: the postinstall still runs. Do not re-install with an allow-scripts flag — civitai version tells you whether the install worked.

The repo is a Nix flake, so nix run / nix profile install need no Go toolchain (x86_64/aarch64 Linux and macOS). To pin the CLI as a flake input — the reproducible option for a team devShell or CI — reference it in your flake.nix:

nix
{
  inputs.civitai-cli.url = "github:civitai/cli";
  # …or pin a release tag from the Releases page:
  # inputs.civitai-cli.url = "github:civitai/cli/<tag>";

  outputs = { self, nixpkgs, civitai-cli, ... }: {
    # add `civitai-cli.packages.${system}.default` to your devShell / packages
  };
}

Prebuilt binaries for linux/macOS/windows × amd64/arm64 are on the GitHub Releases page. Verify with civitai version.

Authenticate ​

Most app commands that talk to the platform need a stored credential:

bash
civitai login                    # browser device login
# or a full-scope personal API key (needed for real Buzz-spend in dev:live):
civitai login --token <key>      # create the key at civitai.com/user/account

The App lifecycle ​

The authoring flow is create → validate → submit, then review on civitai.com. The platform rebuilds your app from source — there is no client-side deploy.

bash
civitai app create my-app        # scaffold a ready-to-build App
cd my-app
npm install && npm run dev:harness   # iterate locally against the mock host
civitai app validate             # local pre-check of block.manifest.json
civitai app submit               # package the SOURCE tree + submit for review
civitai app status               # track review / deploy state

civitai app submit enters your app into moderator review — it is not published immediately. On approval the platform builds + deploys it and serves it at https://<blockId>.civit.ai/.

Command reference ​

Every command is generated from the binary's own help output — the whole civitai command tree, not just app. Alongside App authoring it covers catalog browsing and downloads (models, images, articles, collections, creators, tags, users, model-versions, download), image generation (generate, workflows — these spend Buzz), account commands (login, whoami, buzz, upgrade, version), agent-setup, which configures your coding agent for Civitai App development, and feedback, which reports a Civitai platform problem to Civitai.

The commands are documented across the pages indexed below — civitai app and civitai app listing first, then the catalog, generation and account commands — so that each page's .md copy stays small enough for an agent's fetch tool to read whole. The index names every command; the global flags follow it.

Two app commands are badged invite-only — they are gated during the pre-GA beta. The completion command (shell-completion scripts) is deliberately not documented here; run civitai completion --help for it.

civitai app — authoring commands

Scaffold, validate, submit and operate an App: every civitai app command except the listing group.

civitai app listing — store listing commands

Edit an App's store listing: icon, cover, screenshots, text, source repo and revisions.

Catalog and download commands

Browse and search the public catalog, and download model files.

Generation commands

Run generations and manage workflows. These spend Buzz.

Account, setup and utility commands

Sign in, inspect your account and Buzz, configure your coding agent, and update the CLI.

Global flags

Accepted by every civitai command, in addition to the flags listed with it.

FlagDescriptionDefault
--colorforce colored output even when stdout is not a TTY (also via CLICOLOR_FORCE)—
--no-colordisable colored/styled output (also via NO_COLOR or CIVITAI_NO_COLOR)—
--no-update-checkskip the background check for a newer release (also via CIVITAI_NO_UPDATE_CHECK)—
-v, --versionversion for civitai—

Local dev against the real backend ​

The scaffold ships npm scripts for the inner dev loop (npm run dev:harness for the mock host, npm run dev:live for the real backend). Two app subcommands support the live loop and are invite-gated during the pre-GA beta:

  • civitai app dev-token <slug> mints a short-lived dev block token for npm run dev:live (real backend). Real generation that spends Buzz needs a full-scope personal API key.
  • civitai app dev-tunnel previews your local dev server rendered inside the real Civitai host (real session, real pickers, real Buzz) via a hardened reverse SSH tunnel.

See the Quickstart for the end-to-end flow.

Civitai Developer Documentation