This doc covers how to package hack for local testing and public release, plus how the installer
works and where assets live.
bun install
bun run install:dev
hack --helpInstalls a small wrapper at ~/.hack/bin/hack that runs your working tree directly.
bun install
bun run install:bin
hack --helpBuilds dist/hack and installs it to ~/.hack/bin/hack.
bun run install:statusShows whether the current hack is a dev wrapper or a compiled binary.
bun install
bun run release:prepare
git push --follow-tagsWhat this does:
- Computes the next version from Conventional Commits.
- Updates
CHANGELOG.mdandpackage.json. - Creates a
chore(release): <version>commit andv<version>tag. - Pushing the tag triggers the GitHub Release workflow, which builds artifacts and publishes the GitHub Release.
Notes:
- Use
bun run commitfor a Commitizen prompt (commitlint enforces Conventional Commits). - To force a release, make a Conventional Commit that bumps the right level
(e.g.
fix:for patch,feat:for minor,feat!:orBREAKING CHANGE:for major). - If you want to package locally without tagging, use
bun run build:release.
bun run build:releaseOutputs two artifacts:
dist/release/hack-<version>-<platform>-<arch>.tar.gzdist/release/hack-install.sh(also writeshack-<version>-install.sh)
Flags:
--out=<dir>: custom output dir (default:dist/release)--version=<x.y.z>: override package version--skip-tests: skipbun test--no-clean: keep existing release dir
hack-<version>-release/
hack
install.sh
assets/
gifs/
cut.gif
hacker-mash.gif
schemas/
hack.config.schema.json
hack.branches.schema.json
binaries/
gum/
gum_0.17.0_Darwin_arm64.tar.gz
gum_0.17.0_Darwin_x86_64.tar.gz
README.md
SHA256SUMS
Tarball name: hack-<version>-<platform>-<arch>.tar.gz
There are two scripts:
- Top-level install script (
hack-install.sh): downloads the tarball for your platform, extracts it to a temp dir, runs the inner installer, then cleans up. - Inner install script (inside the tarball): copies the binary + assets into
~/.hack/, offers to update your shell config (PATH+HACK_ASSETS_DIR), and optionally runshack global install.
Defaults:
- Binary:
~/.hack/bin/hack - Assets:
~/.hack/assets
Environment overrides:
HACK_INSTALL_BIN: override install bin dirHACK_INSTALL_ASSETS: override assets dirHACK_INSTALL_NONINTERACTIVE=1: skip prompts (defaults to “no” except for chafa/dnsmasq)HACK_INSTALL_TAG: override release tag (top-level installer)HACK_INSTALL_VERSION: override version (top-level installer)HACK_RELEASE_BASE_URL: override download base URL (top-level installer)
Dependency checks (macOS, inside the inner installer):
chafa(used byhack the planet)dnsmasq(required for*.hackDNS)mkcert(only forhack global cert)
Gum is not installed via brew; the CLI uses the bundled gum tarballs when present.
The inner script can optionally run hack global install after setup.
HACK_ASSETS_DIRis used to locate bundled gum tarballs.hack global installgenerates schemas into~/.hack/schemas/and serves them athttps://schemas.hack.hack the planetcurrently resolves GIFs from the repo root or current working directory. The release bundle includes GIFs underassets/gifs/for convenience.
- Publish release tarballs (per-arch if needed) to GitHub Releases:
hack-<version>-darwin-arm64.tar.gzhack-<version>-darwin-x86_64.tar.gz
- Publish the install script as an asset:
hack-install.sh(latest-friendly)
- Include
SHA256SUMS. - Provide a one-line install snippet that downloads + runs the installer:
curl -fsSL https://github.com/hack-dance/hack-cli/releases/latest/download/hack-install.sh | bashhack --helpworks after install.hack global installsucceeds on a clean machine.https://logs.hackandhttps://schemas.hackare reachable.hack the planet --loop