Skip to content

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 srcpack
sh
bun add -D srcpack
sh
pnpm add -D srcpack
sh
yarn add -D srcpack

Commands

srcpack (default)

Bundle all configured bundles and upload if configured.

sh
npx srcpack
sh
bunx srcpack
sh
pnpm dlx srcpack
sh
yarn dlx srcpack

With specific bundles:

sh
npx srcpack web api
sh
bunx srcpack web api
sh
pnpm dlx srcpack web api
sh
yarn dlx srcpack web api

srcpack init

Create a srcpack.config.ts interactively.

sh
npx srcpack init
sh
bunx srcpack init
sh
pnpm dlx srcpack init
sh
yarn dlx srcpack init

Detects your project structure and suggests bundle configurations.

srcpack login

Authenticate with Google Drive for uploads.

sh
npx srcpack login
sh
bunx srcpack login
sh
pnpm dlx srcpack login
sh
yarn dlx srcpack login

Opens a browser to authorize access. Tokens are stored in ~/.config/srcpack/credentials.json.

Options

OptionDescription
--dry-runPreview bundles without writing files
--no-uploadBundle only, skip upload
--helpShow help
--versionShow version

Examples

Preview without writing

sh
npx srcpack --dry-run
sh
bunx srcpack --dry-run
sh
pnpm dlx srcpack --dry-run
sh
yarn dlx srcpack --dry-run

Output:

[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-upload
sh
bunx srcpack --no-upload
sh
pnpm dlx srcpack --no-upload
sh
yarn dlx srcpack --no-upload

Exit Codes

CodeMeaning
0Success
1Error (config, IO, etc)

Config File Locations

Srcpack searches for config in order:

  1. srcpack.config.ts
  2. srcpack.config.js
  3. srcpack field in package.json

Searches from current directory up to filesystem root.