@assetflux.io/cli
v1.0.0
Published
CLI for AssetFlux — upload assets, manage versions, control rollouts
Maintainers
Readme
AssetFlux CLI
Command-line tool for managing assets on the AssetFlux platform. Upload images, manage versions, control rollouts, and fetch SDK manifests — all from your terminal or CI/CD pipeline.
Install
npm install -g assetfluxRequires Node.js 18 or later.
Quick Start
# Authenticate (opens browser)
assetflux login
# Configure your project
assetflux config set projectId af_your_project_id
# Upload an asset
assetflux assets upload hero.png --key home.hero.banner
# Upload a new version
assetflux assets upload-version hero-v2.png --key home.hero.banner
# Roll out the new version to 25% of users
assetflux deploy rollout home.hero.banner --percentage 25
# Promote to 100%
assetflux deploy promote home.hero.banner --version <version-id>Authentication
# Browser-based OAuth (default)
assetflux login
# Email and password
assetflux login --no-browser
# API key (for CI/CD)
assetflux login --api-key afk_your_key_here
# Clear credentials
assetflux logoutCommands
assetflux config
Manage CLI configuration. Settings are stored in ~/.assetflux/.
assetflux config set apiUrl https://api.assetflux.io/api/v1
assetflux config set projectId af_your_project_id
assetflux config set apiKey afk_your_api_key
assetflux config get projectId
assetflux config list| Key | Description |
|-----|-------------|
| apiUrl | API base URL (default: https://api.assetflux.io/api/v1) |
| projectId | Default project ID for all commands |
| apiKey | API key for authentication |
assetflux assets
Manage assets within a project.
# List all assets
assetflux assets list
# Get asset details and versions
assetflux assets get home.hero.banner
# Upload a new asset
assetflux assets upload hero.png --key home.hero.banner
# Upload a new version of an existing asset
assetflux assets upload-version hero-v2.png --key home.hero.banner
# Delete an asset (with confirmation)
assetflux assets delete home.hero.banner
# Delete without confirmation prompt
assetflux assets delete home.hero.banner --yesUse -p <id> to override the default project ID on any subcommand.
assetflux deploy
Control deployments and rollouts.
# Promote a version to production
assetflux deploy promote home.hero.banner --version <version-id>
# Set rollout percentage (0–100)
assetflux deploy rollout home.hero.banner --percentage 50
# Rollback to a previous version
assetflux deploy rollback home.hero.banner --version <version-id> --reason "Regression"
# Bulk promote from a JSON file
assetflux deploy bulk-promote --file promotions.json --percentage 10The bulk promote JSON file format:
[
{ "assetKey": "home.hero.banner", "versionId": "ver_abc123" },
{ "assetKey": "home.logo", "versionId": "ver_def456" }
]assetflux manifest
Fetch the SDK manifest for a project (useful for debugging).
assetflux manifest
assetflux manifest --api-key afk_your_sdk_key --project af_your_project_idCI/CD Usage
All commands support --json for machine-readable output:
assetflux assets list --json | jq '.data[].key'Authenticate in CI with an API key:
assetflux login --api-key $ASSETFLUX_API_KEY
assetflux config set projectId $ASSETFLUX_PROJECT_ID
assetflux assets upload build/hero.png --key home.hero.bannerConfiguration
The CLI stores configuration and credentials in ~/.assetflux/:
| File | Contents |
|------|----------|
| config.json | API URL, project ID, API key |
| credentials.json | Access token (mode 0600) |
License
BSD 3-Clause. See LICENSE for details.
