This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
@codize/cli — a Node.js CLI tool (codize binary) that executes source files in the Codize cloud sandbox. Built with Commander.js, bundled with Bun, published to npm.
# Install runtime tools (bun 1.3.10, node 24.14.0)
mise install
# Install dependencies
bun install
# Build (produces dist/index.js with node shebang)
bun run build
# Type check (no test or lint scripts are configured)
npx tsc --noEmit
# Format check
npx prettier --check .- Bun is used as the package manager and bundler (via
Bun.buildinscripts/build.ts) - TypeScript compiler is used for type checking only (
noEmit: true); Bun handles compilation - Build output: single
dist/index.jsfile with#!/usr/bin/env nodeshebang, targeting Node.js with external packages bunfig.tomlenforces exact version pinning (exact = true)
src/index.ts — Entry point: sets up Commander program, registers commands, handles top-level errors
src/error.ts — CliError class (extends Error with exitCode)
src/config.ts — Config file read/write (path resolution, JSON parsing, validation)
src/commands/run.ts — `codize run` command: reads files, calls CodizeClient.sandbox.execute(), outputs results
src/commands/config.ts — `codize config` command: set/get/list/path subcommands for CLI configuration
scripts/build.ts — Build script using Bun.build API
Each command is defined in src/commands/ and exports a register*Command(program) function that is called from src/index.ts.
CliErroris used for expected CLI errors with specific exit codesCodizeApiError(from@codize/sdk) is caught and wrapped intoCliErrorin command handlers- The top-level catch in
src/index.tswrites to stderr and exits with the appropriate code
The CLI consumes @codize/sdk from npm. The SDK provides CodizeClient which calls the Codize API (POST /api/v1/sandbox/execute).
Conventional Commits on main trigger Release Please to create a release PR. Merging that PR runs npm publish (which invokes prepublishOnly → bun run build) via GitHub Actions.