init
The init command sets up kasl configuration interactively, guiding you through the initial setup process.
kasl init [OPTIONS]Options
Section titled “Options”| Option | Description |
|---|---|
-d, --delete |
Remove existing configuration instead of creating new one |
-h, --help |
Print help information |
Description
Section titled “Description”The init command provides an interactive configuration wizard that guides you through setting up:
- Monitor Settings: Activity detection thresholds and timing
- API Integrations: GitLab, Jira, and SiServer connections
- Server Configuration: External reporting endpoints
- Credential Management: Secure storage setup
Interactive Setup
Section titled “Interactive Setup”Monitor Configuration
Section titled “Monitor Configuration”Configure activity monitoring behavior:
Minimum pause duration (minutes) [20]:Pause threshold (seconds) [60]:Poll interval (milliseconds) [500]:Activity threshold (seconds) [30]:Minimum work interval (minutes) [10]:Settings Explained:
- Minimum pause duration: Breaks shorter than this are ignored
- Pause threshold: Time without activity before pause detection
- Poll interval: How often to check for activity
- Activity threshold: Continuous activity needed to start workday
- Minimum work interval: Short intervals to merge
API Integrations
Section titled “API Integrations”Configure external service connections:
GitLab Integration
Section titled “GitLab Integration”Enable GitLab integration? (y/N): yGitLab API URL [https://gitlab.com]:GitLab Access Token:Jira Integration
Section titled “Jira Integration”Enable Jira integration? (y/N): yJira API URL:Jira Username:SiServer Integration
Section titled “SiServer Integration”Enable SiServer integration? (y/N): ySiServer Auth URL:SiServer API URL:SiServer Username:Server Configuration
Section titled “Server Configuration”Configure external reporting:
Enable external reporting? (y/N): yServer API URL:Authentication Token:Configuration Reset
Section titled “Configuration Reset”Remove existing configuration:
kasl init --deleteThis will:
- Delete the configuration file
- Remove global PATH settings
- Reset to initial state
Configuration File Location
Section titled “Configuration File Location”Configuration is stored in platform-specific locations:
- Windows:
%LOCALAPPDATA%\lacodda\kasl\config.json - macOS:
~/Library/Application Support/lacodda/kasl/config.json - Linux:
~/.local/share/lacodda/kasl/config.json
Example Configuration
Section titled “Example Configuration”After running init, your configuration will look like:
{ "monitor": { "min_pause_duration": 20, "pause_threshold": 60, "poll_interval": 500, "activity_threshold": 30, "min_work_interval": 10 }, "gitlab": { "access_token": "glpat-XXXXXXXXXXXXXXXXXXXX", "api_url": "https://gitlab.com" }, "jira": { "login": "john.doe", "api_url": "https://company.atlassian.net" }, "si": { "login": "john.doe@company.com", "auth_url": "https://auth.company.com", "api_url": "https://api.company.com" }, "server": { "api_url": "https://api.company.com/timetracking", "auth_token": "your-api-token" }}Credential Management
Section titled “Credential Management”Secure Storage
Section titled “Secure Storage”Credentials are stored securely:
- API Tokens: Encrypted in separate files
- Passwords: Prompted interactively, not stored
- Session Data: Cached temporarily
File Permissions
Section titled “File Permissions”Ensure proper file permissions:
# Linux/macOSchmod 600 ~/.local/share/lacodda/kasl/config.jsonchmod 700 ~/.local/share/lacodda/kasl/Troubleshooting
Section titled “Troubleshooting”Configuration Issues
Section titled “Configuration Issues”Problem: Configuration not saved
# Check file permissionsls -la ~/.local/share/lacodda/kasl/config.json
# Recreate configurationkasl init --deletekasl initProblem: Invalid configuration
# Validate JSON syntaxpython -m json.tool ~/.local/share/lacodda/kasl/config.json
# Reset configurationkasl init --deletekasl initAPI Configuration Issues
Section titled “API Configuration Issues”Problem: API connection failures
# Test connectivitycurl -H "Authorization: Bearer YOUR_TOKEN" https://gitlab.com/api/v4/user
# Reconfigure integrationkasl initExamples
Section titled “Examples”Basic Setup
Section titled “Basic Setup”# Run interactive setupkasl init
# Follow prompts to configure:# 1. Monitor settings# 2. API integrations (optional)# 3. Server configuration (optional)Reset Configuration
Section titled “Reset Configuration”# Remove existing configurationkasl init --delete
# Run setup againkasl initPartial Configuration
Section titled “Partial Configuration”# Run setup and skip optional integrationskasl init
# Only configure monitor settings# Skip GitLab, Jira, and SiServer when promptedNext Steps
Section titled “Next Steps”After running init:
-
Start monitoring:
Terminal window kasl watch -
Enable autostart (optional):
Terminal window kasl autostart enable -
Create your first task:
Terminal window kasl task add --name "Set up kasl" --completeness 100 -
View your report:
Terminal window kasl report