@optare/optareid-cli
v0.1.8
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: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)
Example:
optare apps:create --name "Mobile App" --type mobileAPI 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:listUtility 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
