@optare/optareid-cli
v0.2.2
Published
CLI Tool for Optare ID
Readme
@optare/optareid-cli
Official Command Line Interface for Optare ID - The authentication platform for modern applications.
Quick Start
Installation
# Global installation
npm install -g @optare/optareid-cli
# Or use with npx (no installation required)
npx @optare/optareid-cli --helpSetup
Get your API key from the Optare Dashboard
Set environment variable:
export OPTARE_API_KEY="your-api-key-here"- Verify setup:
optare whoamiCommands
Project Initialization
optare init
Interactive setup for a new Optare project. Creates OAuth client and optionally a product for licensing.
optare initPrompts:
- Project name
- Customer type (B2C or Enterprise)
Generates:
- OAuth Client ID and Secret
- Product (for Enterprise mode)
.envfile with credentials
OAuth Client Management
optare apps list
List all OAuth applications.
optare apps listoptare apps create
Create a new OAuth application.
optare apps create --name "My App" --type webOptions:
--name <name>- Application name (required)--type <type>- App type:web,mobile, orservice(default:web)
optare apps get <clientId>
Get details of a specific application.
optare apps get client_123optare apps update <clientId>
Update an application.
optare apps update client_123 --name "New Name" --add-redirect "http://localhost:3000"optare apps delete <clientId>
Delete an application.
optare apps delete client_123Organization Management
optare orgs list
List all organizations you are a member of.
optare orgs listoptare orgs create
Create a new organization.
optare orgs createoptare orgs get <orgId>
Get organization details.
optare orgs get org_123API Key Management
optare keys create
Generate a new API key for server-side or CI/CD usage.
optare keys create --name "CI/CD Pipeline"Options:
--name <name>- Descriptive name for the key (required)
Product Management
optare product create
Create a new product for licensing and subscriptions.
optare product create \
--name "Pro Plan" \
--slug "pro" \
--description "Professional tier" \
--features sso audit-logs advanced-analyticsOptions:
--name <name>- Product name (required)--slug <slug>- Unique URL-safe identifier (required)--description <desc>- Product description (optional)--features <features...>- Space-separated feature list (optional)
optare product list
List all products in your organization.
optare product listoptare product get <slug>
Get details of a specific product.
optare product get proSubscription Management
optare subscription create
Create a new subscription for an organization.
optare subscription create \
--organization "org_123" \
--product "pro" \
--seats 10 \
--price 49.99 \
--cycle monthly \
--status activeOptions:
--organization <id>- Organization ID (required)--product <id>- Product ID or slug (required)--seats <number>- Total seat count (required)--price <amount>- Price per seat (required)--cycle <cycle>-monthlyoryearly(default:monthly)--status <status>-active,trial,cancelled, orexpired(default:active)--endDate <date>- Subscription end date in ISO 8601 format (optional)
optare subscription list
List all subscriptions.
optare subscription listBilling Management
optare billing connect
Connect a billing provider (Stripe, PayPal, or Razorpay) to your organization.
optare billing connect \
--provider stripe \
--secret-key "sk_live_..." \
--webhook-secret "whsec_..."Options:
--provider <provider>- Billing provider:stripe,paypal, orrazorpay(required)--secret-key <key>- Provider API/secret key (required)--webhook-secret <secret>- Webhook signing secret (optional)--sandbox- Use sandbox/test mode (optional)
optare billing portal
Create a self-service customer billing portal session.
optare billing portal --return-url "https://myapp.com/settings"Options:
--return-url <url>- URL to redirect after portal session (default:http://localhost:3000)
Opens the billing portal in your browser automatically.
Utility Commands
optare whoami
Display current authenticated user information.
optare whoamioptare dashboard
Open the Optare Dashboard in your browser.
optare dashboardEnvironment Variables
| Variable | Description | Required |
|----------|-------------|----------|
| OPTARE_API_KEY | Your API key from the dashboard | Yes |
| OPTARE_API_URL | API base URL | No (defaults to https://id.optare.one) |
| OPTARE_DASHBOARD_URL | Dashboard URL for optare dashboard | No |
Configuration
The CLI stores configuration in ~/.config/optare-cli/config.json (or OS equivalent).
Stored data:
- API key (if saved via config, not recommended)
- Last used options
Security: We recommend using environment variables instead of storing the API key in config.
Examples
Full Project Setup
# 1. Set API key
export OPTARE_API_KEY="optk_..."
# 2. Initialize project
optare init
# 3. Create additional OAuth app for staging
optare apps:create --name "My App - Staging" --type web
# 4. Generate CI/CD key
optare keys:create --name "GitHub Actions"Enterprise Setup with Products
# Create products
optare product:create \
--name "Starter" \
--slug "starter" \
--features basic-support
optare product:create \
--name "Enterprise" \
--slug "enterprise" \
--features sso saml audit-logs priority-support \
--description "Full enterprise features"
# Create subscription
optare subscription:create \
--organization "org_xyz" \
--product "enterprise" \
--seats 50 \
--price 99.99 \
--cycle yearlyTroubleshooting
"OPTARE_API_KEY not set"
Solution: Export your API key:
export OPTARE_API_KEY="your-key-from-dashboard"Get your key from: https://id.optare.one/portal/settings
"Unauthorized" or 401 errors
Causes:
- Expired or invalid API key
- Insufficient permissions
Solution: Generate a new API key from the dashboard
Command not found: optare
Solution:
# Reinstall globally
npm install -g @optare/optareid-cli
# Or use npx
npx @optare/optareid-cli <command>Documentation
Support
- Issues: GitHub Issues
- Email: [email protected]
- Discord: Join our community
License
MIT
