CLI & Scripts

Reference for all pnpm scripts, CLI commands, and development tools available in the Chvor monorepo.

4 min read

CLI & Scripts

Chvor uses a pnpm monorepo. All commands are run from the project root. This page covers every available script and development tool.


Development

pnpm dev

Starts the full development stack — both the Hono backend server and the React client with hot module replacement.

pnpm dev

Output:

  Server running at http://localhost:3001
  Client running at http://localhost:5173

The client proxies API requests to the server. Edit code in either package and changes are reflected immediately.

pnpm dev:server

Starts only the backend server with file watching and auto-restart.

pnpm dev:server

Useful when working on server-side code (skills, channels, MCP integration) and you do not need the client.

pnpm dev:client

Starts only the React client dev server.

pnpm dev:client

Useful when working on the Brain Canvas UI. You need the server running separately or it will show connection errors.


Building

pnpm build

Creates a production build of both the server and client. The client is bundled into the server’s static directory so everything runs on a single port.

pnpm build

Output goes to dist/. The build includes:

  • dist/server/ — compiled server code
  • dist/client/ — optimized, minified client bundle

pnpm start

Runs the production build. Must run pnpm build first.

pnpm build && pnpm start

The production server serves the client on the same port (default 3001). No separate client dev server is needed.


Code Quality

pnpm typecheck

Runs the TypeScript compiler in check mode across all packages. Reports type errors without emitting files.

pnpm typecheck

This checks both the server and client packages. Run it before committing to catch type errors early.

pnpm lint

Runs ESLint across the entire monorepo.

pnpm lint

pnpm lint:fix

Runs ESLint with the --fix flag to auto-fix issues where possible.

pnpm lint:fix

pnpm format

Formats all source files with Prettier.

pnpm format

pnpm format:check

Checks formatting without making changes. Returns a non-zero exit code if any files are not formatted. Useful in CI.

pnpm format:check

Testing

pnpm test

Runs the test suite using Vitest.

pnpm test

pnpm test:watch

Runs tests in watch mode — re-runs affected tests when files change.

pnpm test:watch

pnpm test:coverage

Runs tests with coverage reporting.

pnpm test:coverage

Desktop App (Tauri)

These commands require Tauri prerequisites to be installed. See the Tauri setup guide.

pnpm tauri dev

Launches the desktop app in development mode with hot reload.

pnpm tauri dev

pnpm tauri build

Builds the desktop app installer for your current platform.

pnpm tauri build

Output is in src-tauri/target/release/bundle/.


Monorepo Structure

The Chvor monorepo contains these packages:

chvor/
├── packages/
│   ├── server/        # Hono backend — channels, skills, MCP, API
│   └── client/        # React frontend — Brain Canvas UI
├── src-tauri/         # Tauri desktop app shell
├── pnpm-workspace.yaml
├── package.json       # Root scripts
└── .env               # Environment variables

Root-level scripts (like pnpm dev) orchestrate commands across packages using pnpm’s workspace features. You can also run package-specific scripts:

# Run a script in a specific package
pnpm --filter server dev
pnpm --filter client dev

Environment Variables in Development

During development, Chvor reads from the .env file at the project root. You do not need to export variables manually.

# Just set them in .env and run
pnpm dev

If you need to override a variable for a single command:

PORT=4000 pnpm dev:server

Common Workflows

Start fresh development environment

git clone https://github.com/luka-zivkovic/chvor.git
cd chvor
pnpm install
cp .env.example .env
# Edit .env with your API key
pnpm dev

Check everything before committing

pnpm typecheck && pnpm lint && pnpm test

Rebuild after pulling changes

git pull
pnpm install    # In case dependencies changed
pnpm build
pnpm start

Reset the data directory

If you want a clean slate (deletes all conversations, skills, and config):

rm -rf ~/.chvor
pnpm dev        # Recreates the directory with defaults

Next Steps