Skip to content

CLI reference

The taggor command line logs you in, creates and publishes components, and manages sites, data and the marketplace. These pages are generated from the CLI itself, so every command, option and default here is the one the CLI has. Run npx taggor <command> --help for the same text in your terminal.

Command What it does
taggor login Log in with your browser (device authorization)
taggor logout Log out: revoke the saved login and delete it from this machine
taggor whoami Show who the CLI is acting as and in which workspace
taggor workspaces Manage the workspace the CLI acts in
taggor init Create a component project (in the folder Taggor keeps for your workspace, unless you give one; that needs you signed in), or add a component to the project you are in
taggor pull Download the workspace's components (or one) and recreate the project
taggor projects List and clean the project folders Taggor keeps for you
taggor publish Package the project's components, build them remotely and put the new version on a channel: staging by default, which is what the staging snippet of a site serves
taggor logs Show the log of a build, or follow it until it ends
taggor sites Sites. One site has two environments, each with its own snippet and domains: production (the live website) and staging (the test copy and localhost)
taggor attach Attach a component to a site, for both environments (safe to repeat); prints the version each environment serves
taggor detach Remove a component from a site, in both environments, with its saved props and pinned versions
taggor pin Pin a version of a component in ONE environment of a site: that environment keeps serving it, whatever publish, promote or rollback do, until taggor unpin
taggor unpin Remove the pinned version from ONE environment of a site, so it follows its channel again
taggor codegen Write typed code for the components a site serves, from their manifests: React components (react) or typed tags for Vue templates (vue). With --check it writes nothing and fails when the folder is out of date
taggor components The components of the workspace
taggor shared The workspace's shared folders: code several components import, each published as immutable versions
taggor versions List a component's versions and what each channel points to
taggor promote Point a channel (staging or production) to a version of a component: every site environment that follows the channel serves it (a pinned one does not change, and the output says so)
taggor rollback Point a channel back to its previous version (or to one you name); a site environment with a pinned version does not change, and the output says so
taggor preview Get a private preview link, a new one every time: the latest version of a component (no build), or with --build a new build of the project's component
taggor data Read the data your components collected
taggor usage Show what the workspace used of every limit of its plan, with the overage and the spending limit
taggor marketplace Find bundles of components other workspaces published, and acquire them
taggor acquisitions The bundles this workspace acquired
taggor bundles This workspace's own bundles in the marketplace
taggor publisher The company shown on this workspace's bundles
taggor metrics Show what the components did: deliveries, impressions, submissions and rates
taggor dev Preview your components locally on a test page with hot reload
taggor check Run the publication quality gates locally, offline (types, size, security)
taggor agent Teach an AI agent to write and publish Taggor components in this project

Most commands take these options. Each command page names the ones it takes.

Option What it does
--api-url <value> Origin of the Taggor API (overrides TAGGOR_API_URL)
--workspace <value> Workspace slug to act in (overrides TAGGOR_WORKSPACE)
--verbose Print each request (method, path, status); never tokens
--store <value> Where to keep the login. Taggor keeps it in a file only you can read (mode 0600).
--json Print one JSON object on stdout instead of text (logs go to stderr)
--no-input Pass --no-input to never ask a question. A value or a clear yes that only a flag can give (a missing --site, sites delete without --yes) fails and names the flag; a step that asks only on a terminal (promote, components archive, acquisitions delete) runs without asking. Already the case without a terminal or with CI=true
Variable What it does
TAGGOR_API_KEY An API key. When it is set the CLI uses it and needs no taggor login; it wins over a saved login and taggor logout leaves it alone. Never print it or write it to a file.
TAGGOR_API_URL The origin of the Taggor API the CLI talks to. The --api-url flag overrides it. Only https is accepted (plain http only on localhost).
TAGGOR_WORKSPACE The slug of the workspace to act in. The --workspace flag overrides it; taggor workspaces use saves one.
TAGGOR_SERVER_KEY Not read by the CLI: the name taggor sites server-keys create --out writes the secret under, for your own server to read (server rendering).
CI When it is true the CLI never asks a question and never opens a browser, like --no-input.
NO_COLOR Set to any value to print without colors.
LC_ALL, LC_MESSAGES, LANG The language of the messages, read in this order: Portuguese (Brazil) when the value starts with pt, English otherwise.

The codes are stable: scripts and agents can branch on them. A code is never renumbered or reused.

Code Name When
0 ok The command did what it was asked.
1 generic Any other failure: a server error, an unexpected error, or a change you did not confirm (nothing changed).
2 usage Invalid use: an unknown flag or command, a missing argument, an invalid value, or an input the run could not ask for (no terminal, CI=true, --no-input or --json): the message names the flag to pass.
3 unauthenticated No credential, or the API did not accept it, or the login was denied or expired.
4 not_found The component, version, collection or other item you named does not exist.
5 conflict Something already exists or changed: files init would overwrite (use --force), a folder that is not empty, a site left on a pinned version.
6 build_failed The build or a publication check failed, or taggor check found a component that fails one.
7 rate_limited A rate limit or a plan quota was reached.
8 network The API could not be reached, or a stream was lost.
9 forbidden You are signed in, but your role or the key's scopes do not allow it. Signing in again does not help: ask the person who manages the workspace.

With --json a command prints exactly one JSON document on stdout and sends its progress lines to stderr, so taggor … --json | jq always receives valid JSON. A successful run prints { "ok": true, "command": …, "data": … }; a failed one prints { "ok": false, "command": …, "error": … }, where error holds the code, the message, the request_id (or null) and the exit_code.