API & SDKs
CLI Reference

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-cli

Quick Start

1. Initialize Project

Run the interactive setup wizard to configure your app based on your customer type.

optare init

2. Authenticate

optare login

Commands

App Management

Create OAuth Client

Create a new OAuth client for your application.

optare apps:create \
  --name "My Web App" \
  --type web \
  --port 5173

Options:

  • --type: web (default), mobile, or service.
  • --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:list

Get 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 active

List Subscriptions

optare subscription:list

Update Subscription

optare subscription:update <id> --seats 100

Cancel Subscription

optare subscription:cancel <id>

Batch Operations

Setup from Config

Run a batch setup using optare-config.json.

optare setup

Configuration

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.local and never committed to version control.
  • The CLI supports PKCE and API Key hashing.