| Command | Description |
|---|---|
gramr init [path] | Prepare a site repository: gramr.toml, Dockerfile, .dockerignore. |
gramr doctor | Check 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 token | Generate a token for an unlisted note. |
gramr site list | List the configured sites. |
gramr config edit | Edit 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:
| File | Content |
|---|---|
gramr.toml | Every key with its default value, commented. See repository configuration. |
Dockerfile | Builds 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. |
.dockerignore | Excludes .git and public/ from the build context. |
Then prints the site configuration to create.
| Option | |
|---|---|
--force | Overwrite existing files. By default they are kept. |
--generator | Only 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,gitwhen 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 ofBASE_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-run | Stop after the checks and print the pages, attachments, removed links and tags. Nothing is built. |
--keep-workspace | Keep 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 | |
|---|---|
--port | Local port. Default: 8080. |
--keep-workspace | Keep 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.