@saplings/cli
v0.20.0
Published
One `sapling` command for the Saplings catalog, local source scan reports, SDK readiness guidance, and frontend and backend quality suites. Use Node.js 26.13.1 or newer in the Node.js 26 line.
Readme
@saplings/cli
One sapling command for the Saplings catalog, local source scan reports, SDK readiness guidance, and frontend and backend quality suites. Use Node.js 26.13.1 or newer in the Node.js 26 line.
Install
npm install --save-dev @saplings/cli
npm exec -- sapling --helpCommands
| Command | What it does |
| --- | --- |
| sapling init --path sapling.config.mjs | Creates a quality starter config without overwriting an existing file. |
| sapling catalog | Prints feature and scanner catalogs as JSON. |
| sapling doctor | Prints SDK readiness guidance and the catalog coverage summary. |
| sapling scan --path ./src --format sarif | Writes a SARIF report for files in your project. The default format is JSON. |
| sapling quality list | Lists backend and frontend suite IDs. |
| sapling quality doctor | Checks for browsers and optional external engines. |
| sapling quality run --config sapling.config.ts --profile pr | Runs the configured PR suites. |
| sapling quality report --file <report.json> | Prints a report saved by a run. |
| sapling quality legacy run --config <file> | Runs a legacy backend quality config. |
Scan exits 2 for high or critical findings. With --require-all it exits 3 if coverage is incomplete. Quality runs exit 1 when a suite fails or is skipped and 2 for usage or configuration errors. A successful --dry-run writes a selection report with execution disabled.
Try a quality profile
Create sapling.config.mjs in your project.
export default {
name: 'my-web-app',
environment: 'local',
frontend: {
baseUrl: 'http://127.0.0.1:5173',
routes: ['/'],
browsers: ['chromium'],
},
profiles: { pr: ['frontend:accessibility'] },
};Preview the selected suites, then start your web server on port 5173 and run them.
npm exec -- sapling quality run --config sapling.config.mjs --profile pr --dry-run
npm exec [email protected] -- install chromium
npm exec -- sapling quality run --config sapling.config.mjs --profile prEach run writes JSON, HTML, and JUnit outputs in quality-results/ by default. Set outputDir to place artifacts elsewhere. Use --suite to select explicit suite IDs and --scope frontend, backend, or fullstack to filter selection. Install the engines required by the suites you run.
Migration
Install @saplings/cli in place of @saplings/quality-cli. Replace sapling-quality <args> with sapling quality <args> and replace sapling-quality-legacy <args> with sapling quality legacy <args>. The repository's pnpm run quality <args> script uses the unified CLI.
See the quality integration guide for profile examples and CI configuration.
Scaffold a local service
Run sapling create --path ./my-app --name my-app to generate a dependency-free Node HTTP service, health endpoint and executable smoke test. The destination must not already exist. Run npm test and npm start inside it. This is a minimal local service, not a multi-tenant authenticated starter.
MCP server
Run sapling mcp for local AI tooling or sapling mcp --http for authenticated loopback access. To explicitly enable source scanning of one trusted checkout, launch sapling mcp --scan-root /absolute/path/to/project. See the @saplings/mcp package guide for security boundaries and client setup.
Save reviewed MCP generator output and use sapling mcp apply plan.json ./new-app --confirm to materialize it into a new directory without overwriting files or executing commands.
