CLI Reference
The Verdocs Command Line Interface (CLI) is the primary way to interact with your documentation projects. This page provides a detailed reference for all supported commands and their options.
General Usage
verdocs [COMMAND] [OPTIONS]
To see the help for any command, you can use the --help flag:
verdocs --help
verdocs [COMMAND] --help
Commands
init
Initializes a new documentation project by creating a skeleton project structure.
Usage:
verdocs init [PATH]
Arguments:
PATH: The directory where you want to initialize the project (defaults to the current directory.).
What it does:
- Creates an
assets/directory. - Creates a
search-index/directory. - Writes a default
config.ymlfile. - Adds a sample
verdocs-logo.pngto theassets/folder. - Populates the project with two sample versioned folders:
v1.0.0andv1.1.0.
generate
Builds your documentation project into a production-ready static website.
Usage:
verdocs generate [PATH] [OPTIONS]
Arguments:
PATH: The source directory of your documentation project (defaults to.).
Options:
-h,--host <HOST>: Specifies the target hosting platform for optimization. Supported values:vps(default),vercel,gh-pages.
What it does:
- Validates the project structure and
config.yml. - Parses all Markdown files within versioned folders.
- Generates a client-side search index for each version.
- Produces a fully static
out/directory containing optimized HTML, CSS, and JS. - Host Optimizations:
vps: Creates a rootindex.htmlredirector.vercel: Createsindex.htmlandvercel.jsonfor clean URLs.gh-pages: Createsindex.htmland.nojekyll.
preview
Starts a local development server with hot-reloading for real-time documentation previewing.
Usage:
verdocs preview [PATH] [OPTIONS]
Arguments:
PATH: The source directory of your documentation project (defaults to.).
Options:
-p,--port <PORT>: Specifies the port to run the preview server on (defaults to8080).
What it does:
- Performs an initial site generation.
- Starts a local server (e.g.,
http://localhost:8080). - Watches for changes to any Markdown files or the
config.yml. - Automatically re-generates the site and triggers a browser refresh when changes are saved.
clean
Removes generated build files and configuration to reset the project state.
Usage:
verdocs clean [PATH] [OPTIONS]
Arguments:
PATH: The project directory to clean (defaults to.).
Options:
-f,--full: A destructive flag that removes all versioned directories (v*) in addition to theout/folder andconfig.yml.
What it does:
- Deletes the
out/directory. - Deletes the
config.ymlfile. - If
--fullis provided, it also removes every versioned documentation folder found in the root.
self-update
Updates Verdocs to the latest version.
Usage:
verdocs self-update
What it does:
- Downloads and executes the latest installation script from the official repository.
- Replaces the current
verdocsbinary with the latest version. - Requires
sudoif the binary is installed in a protected directory like/usr/local/bin.
uninstall
Removes the Verdocs binary and its configuration directory from your system.
Usage:
verdocs uninstall
What it does:
- Deletes the
~/.verdocsconfiguration and analytics directory. - Deletes the
verdocsbinary from its current installation path. - Requires
sudoif the binary is installed in a protected directory.
Global Options
-V,--version: Displays the current version of the Verdocs CLI.-h,--help: Displays help information for the CLI or a specific subcommand.