Skip to content

CLI reference

The gotifacts binary is both the server and a small management CLI. When no command is given, it defaults to serve. Run subcommands in your deployment with docker compose exec gotifacts gotifacts <command>.

gotifacts — static site host + portal
Commands:
serve Run the HTTP server (default)
keys create … Create an API key (prints token once)
keys list List API keys
keys revoke --id ID Delete an API key
mcp connections List active MCP connections
mcp revoke --id ID Revoke an MCP connection
migrate-layout [--dry-run] Relocate site content into @site leaves
backfill-favicons [--dry-run] Detect and cache favicons for existing sites
version Print the version
help Show usage

Runs the HTTP server on GOTIFACTS_LISTEN_ADDR. Takes no flags — all configuration comes from environment variables.

Terminal window
gotifacts serve

Manage ingest-plane API keys. See permissions for the grant model and create & scope API keys for examples.

Creates a key and prints its plaintext token once.

FlagDescription
--name STRINGRequired. Human-readable key name.
--adminMake the key an admin superuser (ignores grants).
--grant "GROUP:CAPS"Add a group-subtree grant. Repeatable. Empty group = all sites.
--grant-site "GROUP/SLUG:CAPS"Add a single-site grant. Repeatable.
--expires-in DURATIONRelative expiry, Go duration syntax (e.g. 720h).
--expires-at WHENAbsolute expiry, RFC3339 or YYYY-MM-DD. Overrides --expires-in.

CAPS is a comma-separated list of capabilities: publish, unpublish, rollback, patch.

Terminal window
gotifacts keys create --name ci --grant "previews:publish,unpublish"
gotifacts keys create --name docs-bot --grant-site "docs/app:publish,patch"
gotifacts keys create --name root --admin

Lists all API keys (never their plaintext tokens). No flags.

FlagDescription
--id INTRequired. ID of the key to delete.
Terminal window
gotifacts keys revoke --id 3

Manage MCP connector connections.

Lists active MCP connections (client, user, scope, last used). Also accepts the alias mcp list. No flags.

FlagDescription
--id STRINGRequired. ID of the connection to revoke.
Terminal window
gotifacts mcp revoke --id <id>

Relocates each site’s published files into its reserved @site leaf (see the URL ⇄ path convention). Run it once when upgrading a deployment that was created before the @site layout existed; without it, previously published sites would 404. The command is idempotent — already-migrated sites are skipped, so it is safe to re-run.

FlagDescription
--dry-run, -nReport what would move without changing anything.

It reads the registry to tell a site’s own content apart from nested child-site directories (which are preserved in place). Because it walks the data volume, run it during a brief maintenance window so it doesn’t race live publishes:

Terminal window
docker compose stop gotifacts
docker compose run --rm gotifacts migrate-layout
docker compose up -d gotifacts

Any content that isn’t backed by a registry row (for example a stray sub-directory that was accidentally nested inside another site) is folded into that site’s @site as its own content; re-publish it as a proper site afterwards if it should be its own entry.

Detects and caches a favicon for every published site by re-reading each site’s index.html. New publishes cache their favicon automatically; run this once after upgrading to populate favicons for sites that were published before the feature existed. The command is idempotent — a site whose detected favicon already matches what is stored is left untouched — so it is safe to re-run.

FlagDescription
--dry-run, -nReport how many favicons would change without writing anything.

The favicon is taken from the site’s declared <link rel="icon"> (preferring a scalable SVG, then the largest raster; inline data: URIs are decoded), falling back to a bundled /favicon.ico. External icon URLs are never fetched. It reads the data volume, so run it alongside the server or during a brief window:

Terminal window
docker compose run --rm gotifacts backfill-favicons