HakobuHakobu

CLI Flags Reference

Complete reference of all hakobu CLI flags and options.

Usage

hakobu <project-root> [flags]
hakobu targets
hakobu inspect <project-root>
hakobu doctor <project-root> [--target <spec>]

Core Flags

FlagAliasTypeDescription
--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.
--bytecodebooleanCompile 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 Flags

Bundle mode pre-compiles TypeScript and resolves dependencies with Rolldown before packaging. This is useful for TypeScript projects and monorepos.

FlagAliasTypeDescription
--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

macOS Signing Flags

FlagAliasTypeDescription
--sign-identity <id>stringmacOS code-signing identity. Defaults to ad-hoc signing. Also settable via HAKOBU_SIGN_IDENTITY env var.
--notarizebooleanSubmit 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

macOS App Bundle Flags

These flags wrap the macOS output in a .app bundle with an Info.plist.

FlagTypeDescription
--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

Windows Flags

PE Metadata (VERSIONINFO)

These flags set the metadata embedded in the Windows executable file properties.

FlagTypeDescription
--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

Windows Code Signing

FlagTypeDescription
--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"

Linux Flags

AppDir

FlagTypeDescription
--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

AppImage

FlagTypeDescription
--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

Subcommands

Hakobu includes diagnostic subcommands that do not package your project:

CommandDescription
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

Legacy Flags

These flags are accepted for backward compatibility with @yao-pkg/pkg but emit deprecation or migration warnings.

FlagBehavior
--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:

FlagReason
--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.

Common Usage Examples

Basic packaging for the host platform

hakobu .

Cross-compile for a specific target

hakobu . --target node24-linux-x64 --output ./dist/my-app

Multi-target build

hakobu . --target node24-linux-x64,node24-win-x64,node24-macos-arm64 \
  --output ./dist/

Build all targets

hakobu . --target all --output ./dist/

Bundle a TypeScript project with compression

hakobu ./my-ts-app --bundle --compress Brotli --output ./dist/app

Package with V8 flags

hakobu . --options "expose-gc,max-heap-size=512" --output ./dist/app

Full macOS release build

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

Full Windows release build

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"

Full Linux AppImage build

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

On this page