CommandDescription
gramr init [path]Prepare a site repository: gramr.toml, Dockerfile, .dockerignore.
gramr doctorCheck that publish and preview can work, without building.
gramr publish <site>Build the site and push the image.
gramr preview <site>Build the site and serve it locally.
gramr tokenGenerate a token for an unlisted note.
gramr site listList the configured sites.
gramr config editEdit the global configuration.

--verbose is accepted by every command.

gramr init

gramr init [path] [--force] [--generator zola]

Run in an existing Zola site (path defaults to the current folder). Creates:

FileContent
gramr.tomlEvery key with its default value, commented. See repository configuration.
DockerfileBuilds the site with Zola's official image and serves it with static-web-server on port 80. The Zola version is the one installed on your machine, or a known version if Zola is not installed.
.dockerignoreExcludes .git and public/ from the build context.

Then prints the site configuration to create.

Option
--forceOverwrite existing files. By default they are kept.
--generatorOnly zola for now.

It creates neither the theme, nor the templates, nor the sections: they are the site's business.

About the generated Dockerfile: the Zola build runs on your machine's platform (--platform=$BUILDPLATFORM), since the built site is plain files; only the final image is built per target platform, so multi-platform builds need no emulation. Zola's image has no shell, so the binary is copied into gcr.io/distroless/cc-debian12:debug to handle BASE_URL (see Previewing).

gramr doctor

gramr doctor

Checks, without building anything:

  • Tools: Docker and its daemon, docker buildx, multi-platform support when a site targets several platforms, git when a site uses a remote repository, the local Zola version against the one pinned in each Dockerfile.
  • Sites: every site configuration, source folder, local site repository, Dockerfile (and its use of BASE_URL) and default section.

Remote repositories and notes are not checked: use gramr publish <site> --dry-run for the notes. Exits with an error if a problem is found.

gramr publish

gramr publish <site> [--dry-run] [--keep-workspace]

Selects the notes, writes them into a copy of the site repository, builds the image and pushes it. Prints the tags and the image digest.

Option
--dry-runStop after the checks and print the pages, attachments, removed links and tags. Nothing is built.
--keep-workspaceKeep the temporary workspace, even if something fails.

Requires docker buildx, and git for remote repositories. Registry authentication uses your docker login. See Deploying for the tags.

gramr preview

gramr preview <site> [--port 8080] [--keep-workspace]

Builds the site for your machine and serves it at http://localhost:<port> until Ctrl+C. Nothing is pushed. See Previewing.

Option
--portLocal port. Default: 8080.
--keep-workspaceKeep the temporary workspace.

gramr token

gramr token

Prints a new token for an unlisted note: 20 random characters among a-z and 2-7. See Unlisted pages.

gramr site list

gramr site list

Lists the sites configured in ~/.config/gramr/sites/.

gramr config edit

gramr config edit

Opens the global configuration in $VISUAL, $EDITOR or vi, creating it from a template if needed. The file is checked when the editor closes; if it is invalid, gramr offers to reopen it.