CLI Reference
Static Docs command line commands, arguments, and flags.
All commands follow this pattern:
static-docs <command> [options]
--config accepts either a site.toml file or a project directory containing site.toml.
init
Scaffold a new project directory.
static-docs init [path]
| Parameter | Type | Status | Description |
|---|---|---|---|
path | argument | Optional | Directory to initialize. Defaults to the current directory. |
build
Build the site to output_dir from site.toml.
static-docs build --config <path/to/site.toml>
| Parameter | Type | Status | Description |
|---|---|---|---|
--config | flag | Optional | Path to site.toml or a project directory. Defaults to site.toml. |
preview
Start the local development server with live reload.
static-docs preview --config <path/to/site.toml> --host 127.0.0.1 --port 8000
serve is an alias for preview.
| Parameter | Type | Status | Description |
|---|---|---|---|
--config | flag | Optional | Path to site.toml or a project directory. Defaults to site.toml. |
--host | flag | Optional | Network interface to bind. Defaults to 127.0.0.1. |
--port | flag | Optional | Port to listen on. Defaults to 8000. |
publish
Build the site and copy the output to a destination directory.
static-docs publish --config <path/to/site.toml> --destination ./release
| Parameter | Type | Status | Description |
|---|---|---|---|
--config | flag | Optional | Path to site.toml or a project directory. Defaults to site.toml. |
--destination | flag | Optional | Optional destination directory. Defaults to the configured output_dir. |
gh-deploy
Build the site, add GitHub Pages artifacts, and force-push the output to a deploy branch.
static-docs gh-deploy --config <path/to/site.toml> --remote origin --branch gh-pages
| Parameter | Type | Status | Description |
|---|---|---|---|
--config | flag | Optional | Path to site.toml or a project directory. Defaults to site.toml. |
--remote | flag | Optional | Git remote to push to. Defaults to origin. |
--branch | flag | Optional | Branch to force-push generated output to. Defaults to gh-pages. |
--message | flag | Optional | Commit message for the deploy commit. Defaults to Deploy static-docs site. |
api generate
Generate Markdown API reference pages from Python source files.
static-docs api generate --source src --output content/api --package my_package
| Parameter | Type | Status | Description |
|---|---|---|---|
--source | flag | Optional | Python source directory. Defaults to src. |
--output | flag | Optional | Directory where generated Markdown pages are written. Defaults to content/api. |
--package | flag | Optional | Optional package prefix for generated module names. |
--title | flag | Optional | Title for the generated API index page. Defaults to API Reference. |
--include-private | flag | Optional | Include private Python objects. |
--include-init | flag | Optional | Include __init__.py modules. |