跳转到内容

CLI Reference

此内容尚不支持你的语言。

Reference documentation for the HugoBlox CLI (hugoblox or hbx).

All commands accept the following global flags:

OptionDescription
-h, --helpDisplay help for the command
-v, --versionOutput the version number

Create a new HugoBlox site from a template.

Terminal window
hbx create site [options] [dir]

Arguments:

  • dir: Target directory (defaults to template slug, e.g., new-site).

Options:

  • --template <id>: Starter template ID.
  • --dir <path>: Target directory (alternative to argument).
  • --package-manager <name>: Package manager to use (default: “pnpm”).
  • --no-install: Skip dependency installation.
  • --git: Initialize a git repository.
  • --ci: Run in non-interactive mode.
  • --sample-content: Force include sample content.
  • --no-sample-content: Skip sample content.
  • --preview: Automatically start the dev server after setup.
  • --no-preview: Skip the dev server prompt.

Create a new HugoBlox block (React component).

Terminal window
hbx create block [options] <id>

Arguments:

  • id: Block identifier (e.g. my-cta).

Options:

  • --example <slug>: Include sample content for the block.
  • --dry-run: Print the actions without writing files.
  • --yes: Overwrite files when they already exist.

Start the local development server with Hugo.

Terminal window
hbx dev [options]

This acts as a wrapper around hugo server, adding helpful defaults for local development.

Options:

  • --path <dir>: Project directory (defaults to current directory).
  • --no-default-flags: Disable automatic --disableFastRender flag.
  • --quiet: Suppress all output except errors.
  • --filter: Show only warnings and errors (hide info messages).
  • --verbose: Show all Hugo output (default).

Build your site for production.

Terminal window
hbx build [options]

Runs hugo --gc --minify to generate a production-ready site in the public/ folder.

Options:

  • --path <dir>: Project directory (defaults to current directory).
  • --no-default-flags: Disable automatic --gc and --minify flags.
  • --quiet: Suppress all output except errors.
  • --filter: Show only warnings and errors.

Upgrade HugoBlox modules and the CLI to the latest version.

Terminal window
hbx upgrade

Hydrate HugoBlox Pro assets and dependencies.

Terminal window
hbx install

Check your local environment for issues (missing dependencies, path problems, etc.).

Terminal window
hbx doctor

Authenticate with HugoBlox Pro.

Terminal window
hbx login

Log out and remove stored credentials.

Terminal window
hbx logout

Manage usage data sharing preferences.

Terminal window
hbx telemetry [status|enable|disable]

Commands:

  • status: Show whether telemetry is enabled.
  • enable: Enable anonymous telemetry.
  • disable: Disable telemetry collection.