Pack Command
Overview
The pack command packages your NitroStack project into an optimized zip file suitable for deployment, container image building, or distribution to NitroCloud.
It automatically excludes build artifacts, dependencies, and environment secrets, while enforcing canonical .gitignore rules.
Usage
Bash
npx @nitrostack/cli pack [options]
# or:
nitrostack-cli pack [options]
# or standalone:
nitrostack-pack [options]
Options
| Option | Shorthand | Description | Default |
|---|---|---|---|
--output <path> | -o | Output zip filename (saved to project root) | <project-name>.zip |
--dry-run | Preview files included/excluded without creating the zip | false | |
--include-env | Include .env files in the zip (use with caution!) | false | |
--no-sync-gitignore | Skip merging canonical NitroStack ignore rules into .gitignore | false | |
--cwd <dir> | Specify target project directory | Current directory |
What Gets Excluded
To keep archive sizes small and protect credentials, pack automatically excludes:
- Dependencies:
node_modules/ - Build Artifacts:
dist/,.next/,build/,out/ - Secrets & Credentials:
.env,.env.local,.env.production(unless--include-envis passed) - Version Control:
.git/,.github/ - Logs & OS Temp:
*.log,.DS_Store,Thumbs.db
Examples
1. Standard Pack
Create a clean deployment archive:
Bash
nitrostack-cli pack
Output: my-mcp-server.zip in project root.
2. Preview with Dry Run
Inspect what files will be included before packing:
Bash
nitrostack-cli pack --dry-run
3. Custom Output Name
Bash
nitrostack-cli pack -o production-build.zip
Next Steps
- Build Command — Compiling your code before packing
- Docker Deployment Guide — Container deployments
- Production Checklist — Pre-deployment verification