Skip to content

Development Setup

This guide covers setting up a local development environment for nemar-cli.

  • Bun >= 1.0.0
  • Git
  • GitHub CLI (gh) for integration testing
Terminal window
bun install

This also runs husky via the prepare script, which sets up Git pre-commit hooks automatically.

The project uses husky and lint-staged for pre-commit checks. These run automatically on every commit:

  1. lint-staged - Runs biome check --fix on staged TypeScript files in src/ and backend/src/
  2. Frontend typecheck - Runs tsc --noEmit on the CLI source
  3. Backend typecheck - Runs tsc --noEmit on the backend source (Cloudflare Workers)

Both frontend and backend typechecks run because they have separate tsconfig.json files with different targets (Bun vs Cloudflare Workers). A type error in either will block the commit.

Fix the reported errors and try committing again. Common issues:

ErrorFix
Biome lint errorRun bun run lint:fix to auto-fix, or fix manually
Frontend type errorCheck src/ for TypeScript issues
Backend type errorCheck backend/src/ for TypeScript issues
Terminal window
# Run CLI in development
bun run src/index.ts
# Run with arguments
bun run src/index.ts dataset list
Terminal window
# Run all tests
bun test
# Run specific test file
bun test test/license-provenance.test.ts
Terminal window
# Check for lint issues
bun run lint
# Auto-fix lint issues
bun run lint:fix
# Format code
bun run format
# Type check (frontend only)
bun run typecheck
# Type check backend
cd backend && bun run typecheck
Terminal window
bun run build

This produces dist/index.js targeting the Bun runtime.