CLI Reference
Installation
Srcpack runs without global install:
sh
npx srcpack [command] [options]sh
bunx srcpack [command] [options]sh
pnpm dlx srcpack [command] [options]sh
yarn dlx srcpack [command] [options]Or install as a dev dependency:
sh
npm install -D srcpacksh
bun add -D srcpacksh
pnpm add -D srcpacksh
yarn add -D srcpackCommands
srcpack (default)
Bundle all configured bundles and upload if configured.
sh
npx srcpacksh
bunx srcpacksh
pnpm dlx srcpacksh
yarn dlx srcpackWith specific bundles:
sh
npx srcpack web apish
bunx srcpack web apish
pnpm dlx srcpack web apish
yarn dlx srcpack web apisrcpack init
Create a srcpack.config.ts interactively.
sh
npx srcpack initsh
bunx srcpack initsh
pnpm dlx srcpack initsh
yarn dlx srcpack initDetects your project structure and suggests bundle configurations.
srcpack login
Authenticate with Google Drive for uploads.
sh
npx srcpack loginsh
bunx srcpack loginsh
pnpm dlx srcpack loginsh
yarn dlx srcpack loginOpens a browser to authorize access. Tokens are stored in ~/.config/srcpack/credentials.json.
Options
| Option | Description |
|---|---|
--dry-run | Preview bundles without writing files |
--no-upload | Bundle only, skip upload |
--help | Show help |
--version | Show version |
Examples
Preview without writing
sh
npx srcpack --dry-runsh
bunx srcpack --dry-runsh
pnpm dlx srcpack --dry-runsh
yarn dlx srcpack --dry-runOutput:
[dry-run] web → .srcpack/web.txt (24 files, 8.2 KB)
[dry-run] api → .srcpack/api.txt (18 files, 5.1 KB)Bundle without upload
sh
npx srcpack --no-uploadsh
bunx srcpack --no-uploadsh
pnpm dlx srcpack --no-uploadsh
yarn dlx srcpack --no-uploadExit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Error (config, IO, etc) |
Config File Locations
Srcpack searches for config in order:
srcpack.config.tssrcpack.config.jssrcpackfield inpackage.json
Searches from current directory up to filesystem root.