-
Notifications
You must be signed in to change notification settings - Fork 0
Command Line
The CLI is powered by Typer and provides commands for managing migrations, credentials, databases, and telemetry. All commands support --verbose / -v for detailed debug logging with Rich formatting.
The tool is installed as onelogin-migration:
onelogin-migration --helpAlternatively, you can use:
onelogin-migration-cli --helpOr run it as a Python module:
python -m onelogin_migration_cli.app --help| Command | Purpose |
|---|---|
plan |
Export from source provider (read-only, safe) |
provision-attributes |
Pre-create custom attributes in OneLogin |
show-config |
Display sanitized configuration for troubleshooting |
migrate |
Execute full migration workflow |
credentials |
Manage secure credentials (v0.2.0+) |
db |
Manage application connector database |
telemetry |
View migration analytics and statistics |
Exports users, groups, memberships, and applications from the configured source provider without touching OneLogin. Safe to run repeatedly — no writes to OneLogin.
onelogin-migration plan --config config/migration.yaml -vOptions:
-
--config PATH(required) - Path to YAML configuration file -
--output PATH(optional) - Save export to custom location -
-v, --verbose- Enable debug logging and per-category snapshots
Output:
-
source_export.json— Complete export with all categories - Per-category snapshots:
{provider}_{category}_{timestamp}.json
Example:
# Basic export
onelogin-migration plan --config config/migration.yaml
# With custom output path and verbose logging
onelogin-migration plan --config config/migration.yaml \
--output /tmp/source_export.json -vRuns the complete migration workflow with safety controls and resume capability.
onelogin-migration migrate --config config/migration.yamlOptions:
-
--config PATH(required) - Path to YAML configuration -
--export PATH(optional) - Use pre-generated source export (skips the export phase) -
--dry-run- Simulate without writing to OneLogin -
--bulk-user-upload- Generate CSV instead of API calls -
-v, --verbose- Enable debug logging
What it does:
- Exports from source provider (if not provided via
--export) - Provisions custom attributes in OneLogin
- Creates roles (groups), users, and applications
- Assigns users to roles and roles to apps
- Persists state for resume capability
Examples:
# Standard migration with dry-run
onelogin-migration migrate --config config/migration.yaml --dry-run
# Production migration with verbose logging
onelogin-migration migrate --config config/migration.yaml -v
# Generate CSV for bulk upload
onelogin-migration migrate --config config/migration.yaml \
--bulk-user-upload
# Use pre-generated export
onelogin-migration migrate --config config/migration.yaml \
--export artifacts/source_export.jsonDiscovers custom attributes from source user profiles and creates them in OneLogin before migration. Run this before migrate to avoid validation errors.
onelogin-migration provision-attributes --config config/migration.yamlOptions:
-
--config PATH(required) - Path to YAML configuration -
--export PATH(optional) - Use pre-generated source export -
--dry-run- Preview attributes without creating them -
-v, --verbose- Show detailed attribute analysis
Examples:
# Preview what attributes would be created
onelogin-migration provision-attributes --config config/migration.yaml --dry-run
# Create attributes in OneLogin
onelogin-migration provision-attributes --config config/migration.yaml
# Use existing export to avoid re-fetching
onelogin-migration provision-attributes --config config/migration.yaml \
--export artifacts/source_export.jsonDisplays the parsed configuration with secrets redacted. Useful for troubleshooting config issues without exposing credentials.
onelogin-migration show-config --config config/migration.yamlOutput is JSON with all secret fields masked — safe to share in bug reports.
Manage the application connector database for OneLogin connector ID mappings.
onelogin-migration db --helpdb init - Initialize database
onelogin-migration db initCreates the connector database with schema and initial data.
db refresh - Update from OneLogin API
onelogin-migration db refresh --config config/migration.yamlFetches latest connector information from OneLogin API and updates the database.
db search - Find connector IDs
# Search by application name
onelogin-migration db search --name "Slack"
# Search by protocol
onelogin-migration db search --protocol samldb stats - Database statistics
onelogin-migration db statsShows database statistics including connector counts and categories.
View migration statistics and analytics.
onelogin-migration telemetry --helptelemetry stats - Migration statistics
onelogin-migration telemetry statsShows migration success rates, error counts, and performance metrics.
telemetry events - Event history
onelogin-migration telemetry events --limit 50Displays recent migration events.
telemetry export - Export analytics
onelogin-migration telemetry export --output analytics.csvExports telemetry data to CSV format.
Safe exploration:
# 1. Test export
onelogin-migration plan --config config/migration.yaml -v
# 2. Dry-run migration
onelogin-migration migrate --config config/migration.yaml --dry-runProduction workflow:
# 1. Export from source provider
onelogin-migration plan --config config/migration.yaml \
--output source_export.json
# 2. Pre-create custom attributes
onelogin-migration provision-attributes --config config/migration.yaml \
--export source_export.json
# 3. Run migration
onelogin-migration migrate --config config/migration.yaml \
--export source_export.json -vManage credentials with system keyring integration (v0.2.0+).
onelogin-migration credentials --helpcredentials set - Store credentials
# Interactive prompt (recommended for sensitive data)
onelogin-migration credentials set okta token
# Provide value directly
onelogin-migration credentials set okta domain --value "company.okta.com"
# Store in encrypted vault
onelogin-migration credentials set okta token \
--backend vault --vault-password "mypassword"credentials get - Retrieve credentials
# Show masked value
onelogin-migration credentials get okta token
# Reveal full value
onelogin-migration credentials get okta token --revealcredentials list - List all stored credentials
# List all credentials
onelogin-migration credentials list
# Filter by backend
onelogin-migration credentials list --backend keyring
# Show masked values
onelogin-migration credentials list --show-valuescredentials delete - Remove credentials
# Delete with confirmation
onelogin-migration credentials delete okta token
# Force delete without confirmation
onelogin-migration credentials delete okta token --forcecredentials test - Validate authentication
# Test Okta credentials
onelogin-migration credentials test okta
# Test OneLogin credentials
onelogin-migration credentials test onelogincredentials migrate - Migrate from YAML
# Migrate credentials from YAML config
onelogin-migration credentials migrate config/migration.yaml
# Migrate to encrypted vault
onelogin-migration credentials migrate config/migration.yaml \
--backend vault --vault-password "mypassword"
# Skip backup creation
onelogin-migration credentials migrate config/migration.yaml --no-backupcredentials audit - View access logs
# Show last 20 events
onelogin-migration credentials audit
# Show last 50 events
onelogin-migration credentials audit --limit 50
# Filter by event type
onelogin-migration credentials audit --type credential_storedcredentials validate - Check config sanitization
# Validate config has no plaintext credentials
onelogin-migration credentials validate config/migration.yamlcredentials export - Backup vault
# Export encrypted vault
onelogin-migration credentials export backup/vault-2024-01-15.enccredentials import - Restore vault
# Import vault from backup
onelogin-migration credentials import backup/vault-2024-01-15.encInitial setup:
# 1. Store credentials securely (service name = provider key from config)
onelogin-migration credentials set source token
onelogin-migration credentials set source domain --value "company.okta.com"
onelogin-migration credentials set onelogin client_id --value "abc123"
onelogin-migration credentials set onelogin client_secret
onelogin-migration credentials set onelogin region --value "us"
# 2. Test authentication
onelogin-migration credentials test source
onelogin-migration credentials test onelogin
# 3. List stored credentials
onelogin-migration credentials listMigrating from YAML:
# 1. Migrate credentials from existing config
onelogin-migration credentials migrate config/migration.yaml
# 2. Verify migration
onelogin-migration credentials list
onelogin-migration credentials validate config/migration.yaml
# 3. Test credentials
onelogin-migration credentials test okta
onelogin-migration credentials test onelogin
# 4. Delete old YAML file (after verification)
rm config/migration.yaml.bakAll commands use Rich for formatted console output:
- INFO - Progress updates and summaries
-
DEBUG (
-vflag) - API requests, field mappings, detailed operations - WARNING - Skipped items, recoverable errors
- ERROR - Failures with HTTP status, URL, and response details