CLI Tool
The Optare CLI (@optare/optareid-cli) helps you manage your Optare integration from the terminal.
Installation
npm install -g @optare/optareid-cliAuthentication
Login
optare loginOpens browser for OAuth authentication. Stores credentials locally.
Logout
optare logoutCheck Status
optare whoamiShows 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 currentUsers
## 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=memberApplications (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,webhooksTokens
## 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_keyScripting
JSON Output
optare users list --json | jq '.[] | .email'Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Authentication error |
| 3 | Validation error |
Examples
Invite Multiple Users
cat emails.txt | while read email; do
optare users invite "$email" --role=member
doneExport Users to CSV
optare users list --json | \
jq -r '.[] | [.email, .name, .role] | @csv' > users.csvCI/CD Token Verification
## GitHub Actions
- name: Verify Token
run: |
optare token verify ${{ secrets.OPTARE_TOKEN }}Next Steps
- JavaScript SDK - Programmatic access
- Management SDK - Server-side admin