CLI Reference
The Optare CLI (@optare/optareid-cli) automates the management of your Optare ID integration. It replaces manual dashboard operations with a scriptable, developer-friendly command-line interface.
Installation
npm install -g @optare/optareid-cliQuick Start
1. Initialize Project
Run the interactive setup wizard to configure your app based on your customer type.
optare init2. Authenticate
optare loginCommands
App Management
Create OAuth Client
Create a new OAuth client for your application.
optare apps:create \
--name "My Web App" \
--type web \
--port 5173Options:
--type:web(default),mobile, orservice.--port: Local development port (default: 3000). Used to generate the callback URL (e.g.,http://localhost:5173/callback).
Product Management
Create a Product
optare product:create \
--name "My Product" \
--slug "my-product" \
--description "My product description" \
--features "Feature 1" "Feature 2" "Feature 3"List Products
optare product:listGet Product Details
optare product:get <slug>Subscription Management
Create a Subscription
optare subscription:create \
--organization "acme-corp" \
--product "my-product" \
--seats 100 \
--price 29.99 \
--cycle monthly \
--status activeList Subscriptions
optare subscription:listUpdate Subscription
optare subscription:update <id> --seats 100Cancel Subscription
optare subscription:cancel <id>Batch Operations
Setup from Config
Run a batch setup using optare-config.json.
optare setupConfiguration
The CLI respects the following environment variables:
OPTARE_API_KEY: Authenticate without user interaction (useful for CI/CD).OPTARE_API_URL: Override the API endpoint (default:https://api.optare.one).
Security
- Credentials should be stored in
.env.localand never committed to version control. - The CLI supports PKCE and API Key hashing.