Skip to main content

CLI Reference

The CLI is the direct path for scripting, automation, and terminal-first workflows. The public release uses neutral agent_* naming, but the supported runtime is still Claude only.

Prerequisite

The examples below assume pantoum is available on your PATH. Pantoum isn't published to npm, so expose the local build as a global command with npm link:

git clone https://github.com/pantoum-spfx/pantoum.git
cd pantoum
npm install
npm run build
npm link

If you don't want the global command, run any example via node dist/cli.js ... from the repo root instead.

First Commands

Check the local setup:

pantoum doctor

Run a straightforward upgrade:

pantoum --localPath ./my-spfx-project --toVersion 1.22.1

pantoum \
--localPath ./my-project \
--toVersion 1.22.1 \
--aiFixM365Errors true \
--aiFixBuildErrors true

Use Opus when you expect a harder upgrade:

pantoum --localPath ./my-project --toVersion 1.22.1 --agentModel opus

Common Flags

FlagTypeDefaultDescription
--localPathstring.Path to repository containing SPFx solutions
--toVersionstring1.22.1Target SPFx version
--agentProviderstringclaudeAI runtime for this public release
--agentModelstringsonnetClaude model: sonnet or opus
--aiFixM365ErrorsbooleantrueUse AI to fix M365 CLI upgrade errors
--aiFixBuildErrorsbooleantrueUse AI to fix build/test errors
--aiMaxRetriesnumber3Max AI retry iterations
--updateThirdPartyDepsnone | patch | minor | majornoneStrategy for production dependencies
--perSolutionReportsbooleanfalseSave reports inside each solution directory
--onSingleSolutionFailhalt | continuehaltBehavior when a solution fails
--excludeSolutionsstring[][]Solution name patterns to skip
--excludePatchIds / -estring[][]Patch IDs to skip
--silent / -sbooleanfalseSuppress INFO-level logs

Model Values

ValueUse Case
sonnetDefault for most upgrades
opusMore difficult upgrades

Reports

Every CLI run writes report files you can review later. The main ones are:

FilePurpose
Pantoum_Upgrade_Report_{version}.mdHuman-readable summary
pantoum_final-report_{version}.jsonMachine-readable run data
pantoum_error_report_{version}.logError details on failure

See Reports for the review path.

Full Reference

For the complete public settings surface, including advanced settings and YAML mappings, see Settings Reference.