CLI Tool
Manage telemetry configuration and operations from the command line
Overview
The telemetry-kit CLI provides convenient commands for managing telemetry configuration and operations without writing code.
Installation
Commands
init - Interactive Setup
Initialize telemetry configuration for your project.
Options:
-y, --yes- Skip prompts and use defaults-n, --service-name <NAME>- Specify service name-s, --service <NAME>- Override service globally
Example:
The command will output code you can copy-paste into your application.
test - Validate Credentials
Test sync credentials and verify connectivity.
Options:
-o, --org-id <ID>- Organization ID-a, --app-id <ID>- Application ID-t, --token <TOKEN>- Authentication token-s, --secret <SECRET>- HMAC secret
Examples:
stats - View Statistics
View event statistics for a service.
Options:
-d, --detailed- Show detailed breakdown including file size-s, --service <NAME>- Service name (defaults to current directory)
Example output:
sync - Manual Synchronization
Manually trigger event synchronization.
Options:
-f, --force- Force sync even if auto-sync is enabled-s, --service <NAME>- Service name
Currently a placeholder. Full implementation requires stored credential management.
validate - Validate Configuration
Validate telemetry configuration for a service.
Options:
-c, --config <PATH>- Path to configuration file (future use)-s, --service <NAME>- Service name
Example:
clean - Clear Events
Clear local event database for a service.
Options:
-y, --yes- Skip confirmation prompt--all- Also remove configuration files (future use)-s, --service <NAME>- Service name
This operation is destructive. Unsynced events will be permanently lost.
Example:
Global Options
Available on all commands:
-s, --service <NAME>- Service name to operate on-h, --help- Show command help-V, --version- Show version information
Workflows
Typical Developer Workflow
Add code to your application
Copy the generated code snippet into your main.rs.
Managing Multiple Services
User Experience
Colored Output
The CLI uses colors to improve readability:
- Cyan - Command names, values, highlights
- Green - Success messages, valid states
- Yellow - Warnings, info messages
- Red - Errors, failures
- Dimmed - Less important information
- Bold - Headers, important messages
Disable colors with the NO_COLOR=1 environment variable.
Interactive Prompts
- Input - Text input with defaults
- Password - Hidden input for secrets
- Confirm - Yes/no questions
- Progress - Spinners for long operations
Helpful Hints
The CLI provides contextual hints and next steps:
Database Location
Event databases are stored in:
Each service has its own SQLite database file.
Troubleshooting
"No telemetry data found"
"Failed to initialize"
"Credentials test failed"
Examples
Quick Setup Script
CI/CD Integration
Monitoring Script
Future Enhancements
Planned features for future releases:
- Configuration files - Store credentials securely in config files
- Full sync implementation - CLI-based sync with stored credentials
- Event filtering - View and filter specific events
- Export/Import - Backup and restore event data
- Batch operations - Operate on multiple services at once
- Plugin system - Extend CLI with custom commands
See Also
- Getting Started - Initial setup guide
- Auto-Sync - Background synchronization
- API Reference - Complete API documentation
- GitHub - Source code and issues