CLI Overview
The Scry CLI (@scrymore/scry-deployer) is a command-line tool for deploying Storybook builds to the cloud.
Installation
bash
npx @scrymore/scry-deployer [command] [options]bash
npm install @scrymore/scry-deployer --save-dev
npm exec -- scry-deployer [command] [options]bash
pnpm add @scrymore/scry-deployer -D
pnpm exec scry-deployer [command] [options]Quick Reference
| Command | Description |
|---|---|
init | Initialize project with workflows and config |
| No subcommand | Deploy Storybook |
analyze | Analyze stories and capture screenshots |
Binary Aliases
The package provides multiple binary names:
scry-deployer- Full namestorybook-deploy- Short namescry- Shortest alias
All are equivalent:
bash
npm exec -- scry-deployer --help
npx storybook-deploy --help
npx scry --helpBasic Usage
Initialize a Project
bash
npx @scrymore/scry-deployer init \
--projectId my-project \
--apiKey scry_proj_xxxDeploy Storybook
bash
npx @scrymore/scry-deployer \
--dir ./storybook-static \
--project my-project \
--version latestAnalyze Stories
bash
npx @scrymore/scry-deployer analyze \
--storybook-url http://localhost:6006Configuration Sources
The CLI reads configuration from multiple sources in order of priority:
- Command-line arguments (highest priority)
- GitHub Actions context (deployment version)
- Environment variables (
STORYBOOK_DEPLOYER_*orSCRY_*) - Configuration file (
.storybook-deployer.json) - Default values (lowest priority)
Use --deploy-version latest when the main build must publish a /latest/ alias. GitHub Actions context can override version values supplied only through the environment or configuration file. The CLI does not automatically load .env; supply variables to the process or use your existing environment loader. init requires its own project/key flags.
Environment Variables
All options can be set via environment variables:
| Option | Environment Variable |
|---|---|
--dir | STORYBOOK_DEPLOYER_DIR |
--project | STORYBOOK_DEPLOYER_PROJECT |
--version | STORYBOOK_DEPLOYER_VERSION |
--api-key | STORYBOOK_DEPLOYER_API_KEY |
--api-url | STORYBOOK_DEPLOYER_API_URL |
The SCRY_ prefix also works and takes precedence:
bash
export SCRY_PROJECT_ID=my-project
export SCRY_API_KEY=scry_proj_xxxExit Codes
| Code | Description |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Configuration error |
| 3 | Authentication error |
| 4 | Upload error |
Getting Help
bash
npx @scrymore/scry-deployer --help
npx @scrymore/scry-deployer init --help
npx @scrymore/scry-deployer analyze --helpNext Steps
- Commands - Full command reference
- Configuration - Configuration options
- Examples - Real-world usage examples