CLI Commands
The pledge CLI provides dev, build, and project management commands.
TL;DR
The pledge CLI is the primary interface for PledgeJS. Use pledge dev for the dev server, pledge build for production builds, pledge serve to serve the build, and pledge doctor for health checks.
Last updated: August 22, 2026
Core Commands
The CLI command is pledge. After installing pledgestack, use npx pledge or add it to your scripts.
| Command | Description |
|---|---|
| pledge dev | Start dev server with HMR |
| pledge build | Build for production (PledgePack bundler) |
| pledge serve | Serve production build |
| pledge create <name> | Scaffold a new project from template |
| pledge init | Initialize PledgeJS in existing project |
| pledge info | Show project diagnostics |
| pledge doctor | Health checks (Rust toolchain, Cargo, env) |
Code Quality
Built-in commands for linting, type checking, testing, and formatting.
| Command | Description |
|---|---|
| pledge lint | Run ESLint with PledgeJS rules |
| pledge typecheck | TypeScript type checking |
| pledge test | Run Vitest + Rust test runner |
| pledge fmt | Format Rust code (cargo fmt) |
| pledge clean | Remove build artifacts and caches |
Rust Crate Management
PledgeJS integrates Rust native addons (PSX). Manage them with these commands.
| Command | Description |
|---|---|
| pledge add <crate> | Add a Rust crate (PSX integration) |
| pledge remove <crate> | Remove a Rust crate |
| pledge list | List installed Rust crates |
| pledge update <crate> | Update a Rust crate |
| pledge bench | Benchmark Rust addons vs JS fallbacks |
Analysis & Tooling
Commands for bundle analysis, documentation, Docker setup, and more.
| Command | Description |
|---|---|
| pledge analyze | Bundle analysis — per-module .node size breakdown |
| pledge why <module> | Trace why a module is in the bundle |
| pledge docs | Generate API reference (TypeDoc) |
| pledge docker [--optimized] | Generate Dockerfile, .dockerignore, docker-compose.yml (--optimized: Rust-addon multi-stage build) |
| pledge storybook | Set up Storybook |
| pledge codemod | Run code transformations |
| pledge upgrade | Upgrade PledgeJS with codemods |
| pledge search [query] | Index pages and search content (full-text search) |
| pledge generate-route-types | Generate typed route declarations |
| pledge check-routes | Detect route conflicts |
| pledge sync-aliases | Sync tsconfig path aliases |