@adopture/cli
v1.0.2
Published
Official CLI tool for Adopture Feature Adoption Tracker - authenticate, configure projects, and manage API keys
Maintainers
Readme
@adopture/cli
Official CLI tool for Adopture Feature Adoption Tracker.
Installation
# Run directly with npx (recommended)
npx @adopture/cli@latest init
# Or install globally
npm install -g @adopture/cliQuick Start
Initialize Adopture in your project:
npx @adopture/cli@latest initInstall the SDK:
npm install @adopture/sdkStart tracking features:
import { FeatureTracker } from '@adopture/sdk'; const tracker = new FeatureTracker(); await tracker.init(); // Automatically uses .adopture.config.json tracker.track('button-click', 'user-123');
Commands
adopture init
Interactive setup wizard that configures Adopture for your project.
npx @adopture/cli@latest initOptions:
--project-id <id>- Specify project ID to use--api-key <key>- Specify API key to use--force- Overwrite existing configuration
adopture login
Authenticate with Adopture using your browser.
npx @adopture/cli@latest loginadopture logout
Sign out of Adopture.
npx @adopture/cli@latest logoutadopture whoami
Show current user information.
npx @adopture/cli@latest whoamiadopture status
Show current project status and configuration.
npx @adopture/cli@latest statusadopture projects
List your projects.
npx @adopture/cli@latest projectsadopture projects:create [name]
Create a new project.
npx @adopture/cli@latest projects:create "My App"Configuration File
The CLI generates a .adopture.config.json file with your project configuration:
{
"projectId": "abc123-def456-ghi789",
"projectName": "My App",
"apiKey": "ad_live_...",
"environment": "live",
"apiUrl": "https://api.adopture.com"
}This file is automatically used by the Adopture SDK when you call tracker.init() without parameters.
Authentication
The CLI uses browser-based OAuth for secure authentication. Your credentials are stored securely in your system's credential manager (Keychain on macOS, Credential Manager on Windows, etc.).
Environment Variables
The CLI supports the following environment variables for configuration:
API URLs
ADOPTURE_API_URL- Adopture API endpoint (default:https://api.adopture.com)ADOPTURE_DASHBOARD_URL- Adopture dashboard URL (default:https://app.adopture.com)
Legacy Variables (still supported)
API_URL- Legacy API endpoint variableDASHBOARD_URL- Legacy dashboard URL variable
Usage
# For production (default)
npx @adopture/cli login
# For custom environment
ADOPTURE_API_URL=https://api.example.com \
ADOPTURE_DASHBOARD_URL=https://app.example.com \
npx @adopture/cli login
# For local development
ADOPTURE_API_URL=http://localhost:3001 \
ADOPTURE_DASHBOARD_URL=http://localhost:3000 \
npx @adopture/cli loginDevelopment
# Build the CLI
npm run build
# Development mode with watch
npm run dev
# Run locally
./bin/run.js --helpSupport
For help and support:
- Documentation: https://docs.adopture.com
- Issues: https://github.com/adopture/adopture/issues
