@volley/vwr-s3-cli
v1.0.0
Published
CLI tool to manage VWR config files in S3
Downloads
134
Maintainers
Keywords
Readme
@volley/vwr-s3-cli
CLI tool to manage VWR config files in S3.
Quick Start
Register your TV device for local development:
npx @volley/vwr-s3-cli setup --device-id <YOUR_DEVICE_ID> --platform SAMSUNG_TV --env dev --launch-url https://your-game.ngrok.ioThis creates a device config with dev defaults, uploads it to S3, and invalidates the CloudFront cache — fully non-interactive. Your TV will load VWR pointed at your local game.
Prerequisites
You need AWS SSO access via the TVDevelopers role (SSO account 375633680607).
# Log in with your AWS profile that maps to TVDevelopers
aws sso login --profile <your-profile-name>
# Either export it for the session:
export AWS_PROFILE=<your-profile-name>
# Or pass it per-command:
npx @volley/vwr-s3-cli --profile <your-profile-name> setup ...Interactive mode
If you omit flags, the CLI prompts for them:
npx @volley/vwr-s3-cli setup
# > Select platform: [Samsung TV / LG TV / Fire TV / ...]
# > Enter device ID: TZBLDTKPZHWVX
# > Select environment: [Development / Staging / Production]
# > Launch URL (optional): https://your-game.ngrok.io
# > Additional trusted domains: (press Enter to skip)Global Options
| Flag | Description |
| --- | --- |
| --profile <profile> | AWS profile to use (uses default credential chain if not set) |
| --region <region> | AWS region (default: us-east-1) |
All Commands
| Command | Description |
| ------------ | ---------------------------------------------------- |
| setup | Create a device config with env defaults (see above) |
| generate | Create a config interactively with full control |
| get | Download and display a config from S3 |
| edit | Edit an existing config in S3 interactively |
| put | Upload a config file to S3 |
| delete | Delete a config from S3 |
| invalidate | Invalidate CloudFront cache for a config path |
setup
Create a device config with environment defaults and upload to S3.
# Fully non-interactive (all flags provided, trusted domains auto-detected)
vwr-config setup --device-id TZBLDTKPZHWVX --platform SAMSUNG_TV --env dev --launch-url https://abc.ngrok.io
# Different environment
vwr-config setup --device-id TZBLDTKPZHWVX --platform SAMSUNG_TV --env staging --launch-url https://abc.ngrok.io
# Interactive — prompts for missing values and trusted domains
vwr-config setup --platform SAMSUNG_TVFlags:
--platform <platform>— SAMSUNG_TV, LG_TV, FIRE_TV, IOS_MOBILE, ANDROID_MOBILE, WEB--device-id <id>— Your TV's device ID--launch-url <url>— URL for VWR to launch in an iframe (include full path and query params). When provided, trusted domains are auto-detected and the command runs non-interactively.--env <env>— dev (default), staging, or prod
generate
Interactively create a config with step-by-step prompts and full control over every field. Supports outputting to S3, local file, or console.
vwr-config generateget
Download and display a config from S3:
vwr-config get device --platform SAMSUNG_TV --device-id TZBLDTKPZHWVX
vwr-config get environment --env dev
vwr-config get device --platform SAMSUNG_TV --device-id TZBLDTKPZHWVX -o config.jsonedit
Edit an existing config in S3 interactively. Select fields to change, review a diff, then confirm upload.
vwr-config edit device --platform SAMSUNG_TV --device-id TZBLDTKPZHWVX
vwr-config edit environment --env devTrusted domains are auto-updated when URL fields change. You can also select trustedDomains directly to add or remove individual domains.
put
Upload a config file to S3 (validates JSON schema before upload):
vwr-config put device ./my-config.json --platform SAMSUNG_TV --device-id TZBLDTKPZHWVX
vwr-config put device ./my-config.json --platform LG_TV --device-id ABC --no-invalidatedelete
Delete a config from S3:
vwr-config delete device --platform SAMSUNG_TV --device-id TZBLDTKPZHWVX
vwr-config delete device --platform SAMSUNG_TV --device-id TZBLDTKPZHWVX -f # skip confirmationinvalidate
Invalidate CloudFront cache:
vwr-config invalidate device --platform SAMSUNG_TV --device-id TZBLDTKPZHWVX
vwr-config invalidate --paths /config/device/SAMSUNG_TV/*/vwrConfig.jsonShared flags for get, edit, put, delete, invalidate
| Flag | Description |
| --- | --- |
| [type] | device, shell-version, or environment (prompted if omitted) |
| --platform <platform> | Platform (for device/shell-version) |
| --device-id <id> | Device ID (for device) |
| --env <env> | Environment (for shell-version/environment) |
| --version <version> | Shell version (for shell-version) |
Config Types
| Type | S3 Path | Required Options |
| --------------- | --------------------------------------------------------------- | ---------------------- |
| device | config/device/{platform}/{deviceId}/vwrConfig.json | platform, device-id |
| shell-version | config/shellVersion/{env}/{platform}/{version}/vwrConfig.json | env, platform, version |
| environment | config/environments/{env}/vwrConfig.json | env |
AWS Authentication
The CLI uses the AWS SDK's default credential chain. You need access to the volley-vwr S3 bucket in account 375633680607.
Roles with access:
- TVDevelopers — Can read all configs, write/delete device configs, invalidate cache
- PlatformFoundations — Full config access (internal team)
# Option 1: Export profile for session
export AWS_PROFILE=<your-profile-name>
vwr-config setup ...
# Option 2: Pass profile per-command
vwr-config --profile <your-profile-name> setup ...VWR Config Schema
{
"hubUrl": "https://game-clients-dev.volley.tv/hub",
"vwrUrl": "https://vwr.volley.tv/v1/1.0.0/vwr.js",
"launchUrl": "https://your-game.ngrok.io",
"platformApiUrl": "https://platform-api.volley.tv",
"platformAuthApiUrl": "https://platform-auth-api.volley.tv",
"trustedDomains": [
"https://game-clients-dev.volley.tv",
"https://vwr.volley.tv",
"https://your-game.ngrok.io"
]
}Required fields
hubUrl- Hub URL (non-empty string)vwrUrl- VWR URL (non-empty string)trustedDomains- Array of trusted domain strings (non-empty array)
Optional fields
launchUrl- Launch URL for VWR to load in an iframeplatformApiUrl- Platform API URLplatformAuthApiUrl- Platform Auth API URL
Local Development
Prerequisites
- Node.js >= 22
- pnpm >= 10.18.1
- AWS credentials with access to the
volley-vwrS3 bucket
Setup
pnpm install
pnpm build
./dist/cli.js --helpProject structure
src/
├── index.ts # CLI entry point
├── types.ts # TypeScript types
├── prompts.ts # Interactive prompts
├── constants.ts # Shared constants (platforms, environments)
├── config-utils.ts # URL origin extraction, trusted domain helpers
├── commands/
│ ├── setup.ts # Setup command (quick device config)
│ ├── generate.ts # Generate command
│ ├── get.ts # Get command
│ ├── put.ts # Put command
│ ├── edit.ts # Edit command
│ ├── delete.ts # Delete command
│ └── invalidate.ts # Invalidate command
├── s3/
│ └── client.ts # S3 client and operations
├── cloudfront/
│ └── client.ts # CloudFront client and cache invalidation
└── validation/
└── schema.ts # JSON schema validation