Build and distribution
TypeScript source on npm and Nix, run by Bun, published with provenance
The npm package ships TypeScript source, not a build: the tokenmaxxing bin points straight at src/main.ts with a Bun shebang, and Bun 1.2.6 or newer runs it as-is. That is why Bun is a hard requirement. There are no compiled binaries by design: an early release shipped a single 61 MB macOS binary to every platform and failed on Linux with exec format error, and per-platform compiled packages would each need their own release pipeline, so source-run-by-Bun became the distribution model.
The package's exports map exposes src/sdk.ts as the programmatic entry described in The Agent SDK surface. Releases are tagged v<version> on GitHub; CI publishes to npm via trusted publishing (OIDC, with provenance), and the publish gate runs the typecheck and the full test suite first.
Nix / nix-darwin
The same source tree is also a flake. It keeps the source-run-by-Bun model (via bun2nix writeBunApplication) and exposes:
| Output | Purpose |
|---|---|
packages.default | tokenmaxxing + xx on PATH |
darwinModules.default / withOverlay | nix-darwin: install the CLI (optional declarative check timer) |
homeManagerModules.default | Home Manager on macOS or Linux |
nixosModules.default / withOverlay | NixOS system install |
Install onto a profile (so init's supervisor shims can resolve a stable tokenmaxxing on PATH), then init:
nix profile install github:anaclumos/tokenmaxxing
tokenmaxxing initOne-shot without installing (help / status only — do not init this way):
nix run github:anaclumos/tokenmaxxing -- helpnix-darwin (adds the overlay so pkgs.tokenmaxxing resolves):
{
inputs.tokenmaxxing.url = "github:anaclumos/tokenmaxxing";
# ...
modules = [
inputs.tokenmaxxing.darwinModules.withOverlay
{ programs.tokenmaxxing.enable = true; }
];
}Home Manager (set the package explicitly, or apply this flake's overlay to the pkgs Home Manager uses):
{
imports = [ inputs.tokenmaxxing.homeManagerModules.default ];
programs.tokenmaxxing.enable = true;
programs.tokenmaxxing.package = inputs.tokenmaxxing.packages.${pkgs.system}.default;
}Nix only puts the CLI on PATH. Account import, the on-PATH claude supervisor shim, settings.json hooks, and (by default) the periodic check timer still come from tokenmaxxing init — those touch credentials and user-owned settings that a pure module should not rewrite. Set programs.tokenmaxxing.checkTimer.enable = true only when you want Nix to own the timer instead of init (that also exports TOKENMAXXING_SKIP_TIMER=1 so init does not write a second unit). The declarative timer is a user-session timer, matching init — headless Linux needs loginctl enable-linger for it to fire without a login.
When bun.lock changes, regenerate the Nix dependency expression:
bun run nix:bun # writes bun.nix via bun2nix@2.1.2License
MIT. Source at anaclumos/tokenmaxxing.