This guide is for users who want to build ncode outside the Noumena monorepo. Most users should start with the prebuilt binary below.
As of this release we can only ship one well-tested prebuilt:
linux-x64glibc, built on Ubuntu 24.04
If your host matches that target, use the release download and run ncode install to set up the launcher.
Build from source if you are on:
- macOS (Intel or Apple Silicon)
- Linux ARM64
- Linux with a musl-based distribution
- Any Linux distribution that is binary-incompatible with our Ubuntu 24.04 build
- Bun 1.3.10 or newer
- Rust 1.80 or newer (with
cargoonPATH) curlorwget(only for the install helper)
You do not need the rest of the Noumena monorepo or Sapling/Buck2.
ncode bakes its build mode at bundle time. Choose the mode before building; setting NCODE_USER_TYPE only when running an already-built binary does not switch modes.
The default user-facing build produces a native single-file binary under .tmp/packages/.
For one-off native packages, you can call the package script directly:
NCODE_USER_TYPE=external bun build/package.mjs --build-mode external
NCODE_USER_TYPE=noumena bun build/package.mjs --build-mode noumena
NCODE_USER_TYPE=dev bun build/package.mjs --build-mode dev
NCODE_USER_TYPE=internal bun build/package.mjs --build-mode internalFor source-level development, use the Bun bundle scripts instead:
bun run build:source:external
bun run build:source:noumena
bun run build:source:dev
bun run build:source:internalThose write dist/cli.js for the ./ncode development launcher. They are not the preferred user-facing build artifact.
The code/ directory is self-contained. Copy or clone it to a fresh location and build the default external native binary:
cd code
bun install
bun run buildThis compiles the native Rust modules required by the CLI and packages a single-file executable. The package script prints JSON with the exact paths, including:
binaryPath: native executablemanifestPath: package manifest and checksum metadatazipPath: distributable archive
The default Linux x64 artifact path is:
.tmp/packages/ncode-0.1.0-linux-x64/ncodeIf cargo is not available, the build is not considered complete.
The canonical login path for Noumena-managed accounts is OAuth:
.tmp/packages/ncode-0.1.0-linux-x64/ncode auth loginYou can also run the app and type /login in the REPL. Complete the browser OAuth flow to connect the local CLI to your Noumena-managed account.
Noumena API keys and BYOK remain supported for automation and direct-provider workflows. Noumena OAuth login is optional and independent from inference provider selection:
NOUMENA_API_KEY=... .tmp/packages/ncode-0.1.0-linux-x64/ncode
ANTHROPIC_API_KEY=... .tmp/packages/ncode-0.1.0-linux-x64/ncode
OPENAI_API_KEY=... OPENAI_BASE_URL=https://openrouter.ai/api/v1 OPENAI_MODEL=inclusionai/ling-2.6-flash .tmp/packages/ncode-0.1.0-linux-x64/ncodeDirect key precedence is NOUMENA_API_KEY, then ANTHROPIC_API_KEY, then OPENAI_API_KEY. Project settings cannot silently set OpenAI BYOK routing variables.
Run the native binary produced by bun run build:
.tmp/packages/ncode-0.1.0-linux-x64/ncode --helpFor source-level development without packaging a binary:
bun run build:source
./ncode --helpTo install into ~/.local/bin with shell integration:
.tmp/packages/ncode-0.1.0-linux-x64/ncode installbun run build is an alias for the default external package command. The current supported targets are:
bun-linux-x64bun-linux-x64-muslbun-darwin-x64bun-darwin-arm64
Choose a target explicitly when needed:
bun run package:compiled:external -- --target bun-linux-x64
bun run package:compiled:noumena -- --target bun-linux-x64
bun run package:compiled:dev -- --target bun-linux-x64
bun run package:compiled:internal -- --target bun-linux-x64- The dev wrapper
code/ncodedispatches workspace lifecycle commands (ncode create|delete|reap|list) to../tools/bootstrap/ncode_workspace_cli.sh. The bootstrap tooling is not part of the self-containedcode/release, so those commands are not available outside the monorepo. - The smoke-test suite references files under
../tools/smoke/and can only run from the monorepo root. - macOS ARM64 and musl binaries must be built on matching hosts; we do not cross-compile them in CI yet.
flags.noumena.com(GrowthBook) is optional at build and run time. Without it, the CLI falls back to build-time feature flags and per-call defaults. A simpler remote flag server is planned; for now the product runs correctly without GrowthBook.
