This guide explains how to work on HAL as a developer, and how to use your
local HAL build as global hal and hal-dev commands in other repositories.
- Node.js 18+
- npm
- At least one engine CLI installed if you want to run end-to-end bot tests (Claude, Copilot, Codex, OpenCode, Cursor, or Antigravity)
From the HAL repo root:
npm installUseful commands:
npm run dev # start HAL with hot reload using examples config
npm run start # run HAL once using examples config
npm run build # compile TypeScript to dist/
npm run test # run test suite
npm run lint # lint checks
npm run lint:fix # fix lint issuesNotes:
npm run devandnpm run startuseexamplesas config dir by default.- The published CLI binary is
hal -> dist/cli.js, so global linked usage always runs fromdist/.
This is useful when your real project lives in another repository and you want to run HAL there, while still developing HAL from this repo.
From this repo:
npm install
npm run build
npm linkCheck:
which hal
hal --helpIn your external repo:
hal start --config .Or point to a specific config file/directory:
hal start --config /absolute/path/to/config-or-directoryhalruns compiled output (dist/cli.js) and requiresnpm run buildafter source changes.hal-devrunssrc/cli.tsthroughtsxand does not require rebuilds for one-shot runs.
Examples:
hal-dev start --config .
hal-dev wiz --config .Because hal points to dist/cli.js, rebuild after code changes:
cd /Users/marcopeg/dv/hal
npm run buildThen re-run hal ... in your external repo. No re-link is needed after each
build.
Use hal-dev to run directly from TypeScript:
hal-dev start --config .This picks up source changes the next time you run it, without npm run build.
Use watch mode:
hal-dev --watch start --config .This restarts on source file changes, so you do not need to manually re-run the command.
Remove global link:
npm unlink -g @marcopeg/halIf needed, also unlink from a consumer repo:
npm unlink @marcopeg/hal- Run
which haland verify it points to npm global bin. - Rebuild this repo:
npm run build. - Re-run
npm linkif global symlink is broken.
- Run
npm installin the HAL repo root. - Re-run
npm linkif needed.
- HAL resolves config from
--config(or current working dir if omitted). - Keep project-specific
.envnear the selected config dir unless overridden by projectengine.envFile.
cwdsets process working directory, but not a full sandbox.- For Claude projects, tighten
.claude/settings.json(for exampleallowedPaths) and disable risky tools (for exampleBash) when strict confinement is required.