Preliminary Checks
Description
Summary
The HugoBlox CLI documentation for hbx dev and hbx build indicates that both commands accept additional positional arguments through [hugoArgs...]. These arguments appear intended to be forwarded to the underlying hugo server or hugo command.
However, Hugo flags passed through hbx are currently rejected as unknown HugoBlox CLI options.
For example, attempting to include drafts in the development server fails:
$ hbx dev --buildDrafts
👋 Welcome to the Early Access / Preview Edition of HugoBlox CLI!
We'd love your feedback on our Discord: https://hugoblox.com/discord
Report issues: https://github.com/HugoBlox/kit/issues
error: unknown option '--buildDrafts'
Expected behavior
Arguments not handled directly by HugoBlox CLI should be forwarded to the underlying Hugo command.
For example:
should behave equivalently to:
hugo server --disableFastRender --buildDrafts
Similarly:
should behave equivalently to:
hugo --gc --minify --buildDrafts
Alternatively, if Hugo arguments must be separated using --, the following should work and the requirement should be documented clearly:
hbx dev -- --buildDrafts
hbx build -- --buildDrafts
Actual behavior
Hugo options beginning with - or -- are parsed as HugoBlox CLI options and rejected before they can be forwarded to Hugo.
error: unknown option '--buildDrafts'
Relevant help output
The help text for hbx dev documents a variadic hugoArgs argument:
Usage: hbx dev [options] [hugoArgs...]
Start the Hugo development server (hugo server)
Options:
--path <dir> Project directory (defaults to cwd)
--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)
-h, --help display help for command
The same is true for hbx build:
Usage: hbx build [options] [hugoArgs...]
Run a production Hugo build (hugo --gc --minify)
Options:
--path <dir> Project directory (defaults to cwd)
--no-default-flags Disable automatic --gc/--minify flags
--quiet Suppress all output except errors
--filter Show only warnings and errors (hide info messages)
-h, --help display help for command
This makes it appear that arbitrary Hugo arguments are supported, but the current option parsing prevents commonly used Hugo flags from being passed.
Suggested resolution
One of the following would resolve the ambiguity:
- Allow unknown options after the command name to be captured in
[hugoArgs...] and forwarded to Hugo.
- Support forwarding arguments after the conventional
-- separator.
- If forwarding Hugo flags is not supported, remove
[hugoArgs...] from the usage text and document the limitation.
Supporting -- would likely provide the clearest distinction between HugoBlox CLI options and options intended for Hugo:
hbx dev --path ./site -- --buildDrafts --buildFuture
Reproduction Link
https://github.com/AliSajid/hugoblox-cli-args-reprex
Steps to Reproduce
Steps to reproduce
-
Open a HugoBlox project.
-
Run:
-
Observe that the CLI exits with:
error: unknown option '--buildDrafts'
The same issue appears to affect hbx build when passing options intended for the underlying Hugo command.
Expected Result
Expected behavior
Arguments not handled directly by HugoBlox CLI should be forwarded to the underlying Hugo command.
For example:
should behave equivalently to:
hugo server --disableFastRender --buildDrafts
Similarly:
should behave equivalently to:
hugo --gc --minify --buildDrafts
Actual Result
$ hbx dev --buildDrafts
👋 Welcome to the Early Access / Preview Edition of HugoBlox CLI!
We'd love your feedback on our Discord: https://hugoblox.com/discord
Report issues: https://github.com/HugoBlox/kit/issues
error: unknown option '--buildDrafts'
What Hugo Module versions does your site use?
module github.com/HugoBlox/kit/templates/starter
go 1.19
require github.com/HugoBlox/kit/modules/blox v0.12.0
What operating system(s) are you seeing the problem on?
macOS
What browser(s) are you seeing the problem on?
No response
Which Hugo Blox template are you using?
Starter for the reprex repo. Independent of template.
What version of Hugo are you using?
hugo v0.159.2-5f4646acaad89e1166aac118e118b0d28013f460+extended darwin/arm64 BuildDate=2026-04-01T12:59:20Z VendorInfo=gohugoio
Preliminary Checks
Description
Summary
The HugoBlox CLI documentation for
hbx devandhbx buildindicates that both commands accept additional positional arguments through[hugoArgs...]. These arguments appear intended to be forwarded to the underlyinghugo serverorhugocommand.However, Hugo flags passed through
hbxare currently rejected as unknown HugoBlox CLI options.For example, attempting to include drafts in the development server fails:
Expected behavior
Arguments not handled directly by HugoBlox CLI should be forwarded to the underlying Hugo command.
For example:
hbx dev --buildDraftsshould behave equivalently to:
hugo server --disableFastRender --buildDraftsSimilarly:
hbx build --buildDraftsshould behave equivalently to:
hugo --gc --minify --buildDraftsAlternatively, if Hugo arguments must be separated using
--, the following should work and the requirement should be documented clearly:Actual behavior
Hugo options beginning with
-or--are parsed as HugoBlox CLI options and rejected before they can be forwarded to Hugo.Relevant help output
The help text for
hbx devdocuments a variadichugoArgsargument:The same is true for
hbx build:This makes it appear that arbitrary Hugo arguments are supported, but the current option parsing prevents commonly used Hugo flags from being passed.
Suggested resolution
One of the following would resolve the ambiguity:
[hugoArgs...]and forwarded to Hugo.--separator.[hugoArgs...]from the usage text and document the limitation.Supporting
--would likely provide the clearest distinction between HugoBlox CLI options and options intended for Hugo:hbx dev --path ./site -- --buildDrafts --buildFutureReproduction Link
https://github.com/AliSajid/hugoblox-cli-args-reprex
Steps to Reproduce
Steps to reproduce
Open a HugoBlox project.
Run:
hbx dev --buildDraftsObserve that the CLI exits with:
The same issue appears to affect
hbx buildwhen passing options intended for the underlying Hugo command.Expected Result
Expected behavior
Arguments not handled directly by HugoBlox CLI should be forwarded to the underlying Hugo command.
For example:
hbx dev --buildDraftsshould behave equivalently to:
hugo server --disableFastRender --buildDraftsSimilarly:
hbx build --buildDraftsshould behave equivalently to:
hugo --gc --minify --buildDraftsActual Result
What Hugo Module versions does your site use?
What operating system(s) are you seeing the problem on?
macOS
What browser(s) are you seeing the problem on?
No response
Which Hugo Blox template are you using?
Starter for the reprex repo. Independent of template.
What version of Hugo are you using?
hugo v0.159.2-5f4646acaad89e1166aac118e118b0d28013f460+extended darwin/arm64 BuildDate=2026-04-01T12:59:20Z VendorInfo=gohugoio