Optare v1.0 is now available. Get started →
SDKs
CLI Tool

CLI Tool

The Optare CLI (@optare/optareid-cli) helps you manage your Optare integration from the terminal.

Installation

npm install -g @optare/optareid-cli

Authentication

Login

optare login

Opens browser for OAuth authentication. Stores credentials locally.

Logout

optare logout

Check Status

optare whoami

Shows current authenticated user and organization.


Commands

Organizations

## List organizations
optare orgs list
 
## Switch organization
optare orgs switch <org-slug>
 
## Create organization
optare orgs create "Acme Corp"
 
## Get current organization
optare orgs current

Users

## List users in current org
optare users list
 
## Get user details
optare users get <user-id>
 
## Invite user
optare users invite john@example.com --role=member

Applications (OAuth Clients)

## List applications
optare apps list
 
## Create application
optare apps create \
  --name "My App" \
  --type spa \
  --redirect-uri "https://yourapp.com/callback"
 
## Get application details
optare apps get <client-id>
 
## Rotate secret
optare apps rotate-secret <client-id>

Products

## List products
optare products list
 
## Create product
optare products create \
  --name "Pro Plan" \
  --slug pro \
  --features sso,analytics,webhooks

Tokens

## Get access token (for testing)
optare token get
 
## Decode token
optare token decode <token>
 
## Verify token
optare token verify <token>

Configuration

Config File

Located at ~/.optare/config.json:

{
  "domain": "https://id.optare.one",
  "currentOrg": "acme",
  "token": "...",
  "refreshToken": "..."
}

Environment Variables

export OPTARE_DOMAIN=https://id.optare.one
export OPTARE_CLIENT_ID=your_client_id
export OPTARE_API_KEY=your_api_key

Scripting

JSON Output

optare users list --json | jq '.[] | .email'

Exit Codes

CodeMeaning
0Success
1General error
2Authentication error
3Validation error

Examples

Invite Multiple Users

cat emails.txt | while read email; do
  optare users invite "$email" --role=member
done

Export Users to CSV

optare users list --json | \
  jq -r '.[] | [.email, .name, .role] | @csv' > users.csv

CI/CD Token Verification

## GitHub Actions
- name: Verify Token
  run: |
    optare token verify ${{ secrets.OPTARE_TOKEN }}

Next Steps