@adobe/mysticat-cli
v2.1.0
Published
Mysticat CLI - command line interface for SpaceCat
Maintainers
Keywords
Readme
@adobe/mysticat-cli
Command-line interface for SpaceCat. Built for humans, AI agents, and CI/CD pipelines.
Install
npm install -g @adobe/mysticat-cliRequires Node.js >= 20.
Quick start
# Authenticate via browser (opens Adobe IMS)
mysticat login
# Check login status
mysticat status
# List sites
mysticat site list
mysticat site list --live --limit 10
# Get site details
mysticat site get https://example.comCommands
| Command | Description |
|---------|-------------|
| mysticat login | Authenticate via Adobe IMS (browser or headless) |
| mysticat logout | Clear stored tokens |
| mysticat status | Show login status, environment, and token expiry |
| mysticat auth token | Print or copy session token |
| mysticat site list | List sites with optional filters |
| mysticat site get <url> | Get site information by URL |
| mysticat config get [key] | Show configuration |
| mysticat config set <key> <value> | Set a configuration value |
All data commands support --json for machine-readable output.
Authentication
Browser login (interactive)
mysticat login
mysticat login --env stage
mysticat login --product LLMOOpens a browser for Adobe IMS OAuth (PKCE). The CLI starts a local callback server, receives the authorization code, exchanges it for tokens, and stores them in ~/.mysticat/tokens.json.
Headless login (CI/CD, agents)
echo "$IMS_TOKEN" | mysticat login --tokenAccepts an IMS access token on stdin and exchanges it with SpaceCat for a session JWT.
Token resolution order
For authenticated commands, tokens are resolved in this order:
MYSTICAT_TOKENenv var (raw session JWT)MYSTICAT_TOKEN_FILEenv var (path to file containing session JWT)- Stored session token (from
~/.mysticat/tokens.json) - Auto-refresh via stored IMS access token
- Auto-refresh via IMS refresh token grant
Using tokens in scripts
# Use session token directly
curl -H "Authorization: Bearer $(mysticat auth token)" https://spacecat.experiencecloud.live/api/sites
# Copy to clipboard
mysticat auth token --copy
# Get the IMS access token instead
mysticat auth token --imsConfiguration
# Set default environment
mysticat config set env stage
# Set default product
mysticat config set product LLMO
# View current config
mysticat config getConfiguration is stored in ~/.mysticat/config.json. Per-command --env flags override the default.
Environments
| Name | API | IMS |
|------|-----|-----|
| prod (default) | spacecat.experiencecloud.live | ims-na1.adobelogin.com |
| stage | spacecat-stage.experiencecloud.live | ims-na1-stg1.adobelogin.com |
| dev | spacecat-dev.experiencecloud.live | ims-na1-stg1.adobelogin.com |
Environment variables
| Variable | Purpose |
|----------|---------|
| MYSTICAT_TOKEN | Session JWT - bypasses token store |
| MYSTICAT_TOKEN_FILE | Path to file containing session JWT |
| MYSTICAT_CONFIG_DIR | Override config directory (default: ~/.mysticat) |
| MYSTICAT_IMS_CLIENT_ID | Override IMS client ID |
| MYSTICAT_TIMEOUT | API request timeout in ms (default: 30000) |
| DEBUG=mysticat:* | Enable debug logging |
Development
git clone [email protected]:adobe/mysticat-cli.git
cd mysticat-cli
npm install
# Run tests with coverage
npm test
# Lint
npm run lint
# Run CLI locally
./bin/run.js login
./bin/run.js site list --jsonProject structure
src/
commands/ # oclif command classes
auth/token.js # Print/copy tokens
config/get.js # Show config
config/set.js # Set config
login.js # Browser and headless login
logout.js # Clear tokens
site/get.js # Get site by URL
site/list.js # List sites
status.js # Login status
hooks/init/ # oclif lifecycle hooks
lib/
api/client.js # SpaceCat API client
auth/ # IMS OAuth, token storage, resolution
config/ # Environment config, persistent settings
output/ # Output formatting
test/ # Mirrors src/ structureReleasing
Releases are fully automated via semantic-release on merge to main. Use conventional commits:
feat:- new feature (minor version bump)fix:- bug fix (patch version bump)feat!:orBREAKING CHANGE:- breaking change (major version bump)
npm publishing uses trusted publishing via OIDC - no stored npm tokens required.
License
Apache-2.0
