CLI Flags Reference Complete reference of all hakobu CLI flags and options.
hakobu < project-roo t > [flags]
hakobu targets
hakobu inspect < project-roo t >
hakobu doctor < project-roo t > [--target < spe c > ]
Flag Alias Type Description --target <spec>-tstringTarget specification, comma-separated for multi-target builds (e.g., node24-linux-x64,node24-win-x64). Use all for all published targets. Defaults to the host platform. --output <path>-ostringOutput executable path (single target) or output directory (multi-target). --entry <file>— stringEntry file relative to the project root. Overrides the "main" field in package.json. --debug-dbooleanShow detailed packaging diagnostics throughout the pipeline. --build-bbooleanForce a local build of the base binary instead of downloading a prebuilt one. --compress <algo>-CstringCompress the snapshot payload. Accepted values: Brotli, GZip, or none. --bytecode— booleanCompile JS to V8 bytecode before packaging. Opt-in; source-only mode is the default. --options <flags>— stringV8 flags to bake into the executable, comma-separated (e.g., "expose-gc,max-heap-size=34"). --help-hbooleanShow the help text. --version-vbooleanPrint the Hakobu version.
Bundle mode pre-compiles TypeScript and resolves dependencies with Rolldown before packaging. This is useful for TypeScript projects and monorepos.
Flag Alias Type Description --bundle [name]— boolean | stringEnable bundle mode. Optionally pass a bundler name (default: Rolldown). --external <mod>— stringKeep a module external when bundling (not resolved into the bundle). Repeatable for multiple modules.
# Bundle a TypeScript project
hakobu ./my-ts-app --bundle --output ./dist/app
# Bundle with external modules
hakobu ./app --bundle --entry src/cli.ts --external electron --external fsevents
Flag Alias Type Description --sign-identity <id>— stringmacOS code-signing identity. Defaults to ad-hoc signing. Also settable via HAKOBU_SIGN_IDENTITY env var. --notarize— booleanSubmit the signed binary to Apple notarization. Requires HAKOBU_APPLE_ID, HAKOBU_APPLE_PASSWORD, and HAKOBU_APPLE_TEAM_ID environment variables.
# Sign with a Developer ID and notarize
hakobu . --target node24-macos-arm64 --output ./dist/app \
--sign-identity "Developer ID Application: My Company (TEAMID)" \
--notarize
These flags wrap the macOS output in a .app bundle with an Info.plist.
Flag Type Description --app-bundlebooleanProduce a macOS .app bundle instead of a raw executable. Output path becomes the .app directory. --bundle-id <id>stringCFBundleIdentifier (e.g., com.example.my-app).--bundle-version <v>stringCFBundleVersion (e.g., 1.2.3).--short-version <v>stringCFBundleShortVersionString (defaults to --bundle-version).--display-name <n>stringCFBundleDisplayName.--copyright <s>stringNSHumanReadableCopyright.--macos-icon <path>stringPath to a .icns file for the app icon. Also configurable via "hakobu.macos" in package.json.
hakobu . --target node24-macos-arm64 --output ./dist/MyApp.app \
--app-bundle \
--bundle-id com.mycompany.myapp \
--bundle-version 1.0.0 \
--display-name "My App" \
--macos-icon ./assets/icon.icns
These flags set the metadata embedded in the Windows executable file properties.
Flag Type Description --product-name <n>stringProduct name shown in file properties. --file-description <d>stringDescription shown in Task Manager. --company-name <n>stringCompany or publisher name. --file-version <v>stringFile version (e.g., 1.2.3). --product-version <v>stringProduct version (defaults to file version). --icon <path>stringPath to a .ico file to embed as the application icon.
hakobu . --target node24-win-x64 --output ./dist/app.exe \
--product-name "My App" \
--file-description "My App CLI" \
--company-name "My Company" \
--file-version "1.0.0" \
--icon ./assets/icon.ico
Flag Type Description --win-cert <path>stringPath to a .pfx or .p12 Authenticode certificate. Also settable via HAKOBU_WIN_CERT env var. --win-cert-passwordstringCertificate password. Also settable via HAKOBU_WIN_CERT_PASSWORD env var.
hakobu . --target node24-win-x64 --output ./dist/app.exe \
--win-cert ./certs/code-signing.pfx \
--win-cert-password " $CERT_PASSWORD "
Flag Type Description --appdirbooleanWrap Linux output in an AppDir structure. Output path becomes the .AppDir directory. --desktop-name <n>stringApplication name in the .desktop file. --desktop-comment <s>stringShort description / tooltip. --desktop-categories <c>stringSemicolon-separated categories (e.g., Utility;Development;). --desktop-terminalbooleanMark the app as needing a terminal (default: true). --no-desktop-terminalbooleanMark the app as not needing a terminal. --linux-icon <path>stringPath to a .png file for the app icon. Also configurable via "hakobu.linux" in package.json.
hakobu . --target node24-linux-x64 --output ./dist/MyApp.AppDir \
--appdir \
--desktop-name "My App" \
--desktop-comment "A CLI tool for doing things" \
--desktop-categories "Utility;Development;" \
--linux-icon ./assets/icon.png
Flag Type Description --appimagebooleanBuild an AppImage from the AppDir output. Implies --appdir. Requires appimagetool in PATH.
hakobu . --target node24-linux-x64 --output ./dist/MyApp \
--appimage \
--desktop-name "My App" \
--linux-icon ./assets/icon.png
Hakobu includes diagnostic subcommands that do not package your project:
Command Description hakobu targetsShow all available targets and local cache status. hakobu inspect <root>Analyze a project without packaging. Shows detected entry, dependencies, and assets. hakobu doctor <root>Check if a project is ready to package. Flags common issues.
hakobu targets
hakobu inspect ./my-app
hakobu doctor ./my-app --target node24-linux-x64
These flags are accepted for backward compatibility with @yao-pkg/pkg but emit deprecation or migration warnings.
Flag Behavior --targets (plural)Accepted. Use --target (singular) instead. --out-pathAccepted. Use --output with a full path instead. --config, -cDeprecated. Put config in the "hakobu" field of package.json.
These flags are not supported and cause an error:
Flag Reason --no-bytecodeNot needed. Hakobu defaults to source-only mode. Use --bytecode to opt in. --publicNot supported. Hakobu always includes source. --public-packagesNot supported. Hakobu always includes source. --seaNot supported. Hakobu uses its own snapshot format, not Node SEA. --no-native-buildNot needed. Hakobu does not prebuild native addons by default. --no-dictNot supported. Hakobu does not use dictionaries.
hakobu . --target node24-linux-x64 --output ./dist/my-app
hakobu . --target node24-linux-x64,node24-win-x64,node24-macos-arm64 \
--output ./dist/
hakobu . --target all --output ./dist/
hakobu ./my-ts-app --bundle --compress Brotli --output ./dist/app
hakobu . --options "expose-gc,max-heap-size=512" --output ./dist/app
hakobu . --target node24-macos-arm64 --output ./dist/MyApp.app \
--app-bundle \
--bundle-id com.mycompany.myapp \
--bundle-version 1.0.0 \
--display-name "My App" \
--macos-icon ./assets/icon.icns \
--sign-identity "Developer ID Application: My Company (TEAMID)" \
--notarize
hakobu . --target node24-win-x64 --output ./dist/app.exe \
--product-name "My App" \
--file-description "My App CLI" \
--company-name "My Company" \
--file-version "1.0.0" \
--icon ./assets/icon.ico \
--win-cert ./certs/signing.pfx \
--win-cert-password " $CERT_PASSWORD "
hakobu . --target node24-linux-x64 --output ./dist/MyApp \
--appimage \
--desktop-name "My App" \
--desktop-comment "A CLI tool" \
--desktop-categories "Utility;" \
--linux-icon ./assets/icon.png