autostart
The autostart command provides cross-platform functionality for managing whether kasl automatically starts monitoring when the system boots. It supports different autostart mechanisms depending on the operating system.
kasl autostart [COMMAND]Commands
Section titled “Commands”enable - Enable autostart on system boot
Section titled “enable - Enable autostart on system boot”kasl autostart enableConfigures the system to automatically start kasl monitoring when the user logs in or the system boots.
Platform-specific behavior:
Windows:
- Primary: Windows Task Scheduler (requires admin privileges)
- Fallback: Registry Run key (current user)
- Provides clear feedback about which method was used
macOS: LaunchAgent (planned - not yet implemented) Linux: systemd user service (planned - not yet implemented)
disable - Disable autostart on system boot
Section titled “disable - Disable autostart on system boot”kasl autostart disableRemoves any existing autostart configuration, ensuring kasl will not automatically start on system boot.
status - Show current autostart status
Section titled “status - Show current autostart status”kasl autostart statusChecks and displays whether autostart is currently enabled or disabled on the system.
Examples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”# Enable autostartkasl autostart enable
# Check current statuskasl autostart status
# Disable autostartkasl autostart disableWindows-Specific Examples
Section titled “Windows-Specific Examples”# Enable with admin privileges (recommended)# Run as Administratorkasl autostart enable
# Enable without admin (user-level only)kasl autostart enable
# Check which method was usedkasl autostart statusPlatform Support
Section titled “Platform Support”Windows
Section titled “Windows”Supported Methods:
-
Windows Task Scheduler (Primary)
- Requires administrator privileges
- More reliable and configurable
- Can be managed through Windows Task Manager
-
Registry Run Key (Fallback)
- User-level configuration
- Works without admin privileges
- Less configurable than Task Scheduler
Implementation Details:
- Attempts Task Scheduler first
- Falls back to Registry if admin access denied
- Provides clear feedback about which method was used
macOS (Planned)
Section titled “macOS (Planned)”Future Implementation:
- LaunchAgent: User-level autostart
- Configuration in
~/Library/LaunchAgents/ - Integration with macOS system preferences
Linux (Planned)
Section titled “Linux (Planned)”Future Implementation:
- systemd user service: Modern Linux systems
- init.d scripts: Legacy systems
- Integration with desktop environment autostart
Sample Output
Section titled “Sample Output”Enable Autostart (Windows - Task Scheduler)
Section titled “Enable Autostart (Windows - Task Scheduler)”✅ Autostart enabled successfully!Method: Windows Task SchedulerStatus: ActiveNext run: On system startupEnable Autostart (Windows - Registry Fallback)
Section titled “Enable Autostart (Windows - Registry Fallback)”⚠️ Autostart enabled with limited functionalityMethod: Registry Run Key (user-level)Status: ActiveNote: Task Scheduler method requires administrator privilegesStatus Check
Section titled “Status Check”Autostart Status: EnabledMethod: Windows Task SchedulerConfiguration: ActiveNext startup: Will start automatically on system bootDisable Autostart
Section titled “Disable Autostart”✅ Autostart disabled successfully!Removed: Task Scheduler entryRemoved: Registry entriesStatus: DisabledUnsupported Platform
Section titled “Unsupported Platform”❌ Autostart not supported on this platformPlatform: macOSStatus: Not implementedNote: This feature is planned for future releasesUse Cases
Section titled “Use Cases”Daily Workflow Automation
Section titled “Daily Workflow Automation”# Set up autostart for seamless monitoringkasl autostart enable
# Verify it's workingkasl autostart status
# Start monitoring manually for first timekasl watchSystem Administration
Section titled “System Administration”# Deploy to multiple workstationskasl autostart enable
# Verify deploymentkasl autostart status
# Remove from decommissioned systemskasl autostart disableDevelopment and Testing
Section titled “Development and Testing”# Enable for testingkasl autostart enable
# Test autostart functionality# Restart system and verify kasl starts
# Disable after testingkasl autostart disableTroubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”Insufficient privileges (Windows)
# Run as Administrator# Right-click Command Prompt/PowerShell -> "Run as Administrator"kasl autostart enable
# Or use user-level fallbackkasl autostart enable# Will use Registry method automaticallyAutostart not working after enable
# Check statuskasl autostart status
# Verify system startup# Restart system and check if kasl starts
# Re-enable if neededkasl autostart disablekasl autostart enablePlatform not supported
# Check current platform supportkasl autostart status
# Manual startup alternative# Add kasl watch to your startup scriptsWindows-Specific Issues
Section titled “Windows-Specific Issues”Task Scheduler not working
# Check Task Scheduler manually# Open Task Scheduler -> Task Scheduler Library -> kasl
# Try Registry methodkasl autostart disablekasl autostart enableRegistry method issues
# Check Registry manually# HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
# Re-enable with admin privilegeskasl autostart disable# Run as Administratorkasl autostart enableVerification Steps
Section titled “Verification Steps”# 1. Enable autostartkasl autostart enable
# 2. Check statuskasl autostart status
# 3. Test by restarting system# Restart your computer
# 4. Verify kasl is runningkasl watch --stop# If kasl was running, autostart is workingBest Practices
Section titled “Best Practices”Windows Deployment
Section titled “Windows Deployment”- Use administrator privileges when possible for Task Scheduler method
- Test autostart functionality after deployment
- Document deployment method used for each system
- Monitor autostart status regularly
System Management
Section titled “System Management”- Enable autostart on all workstations that need monitoring
- Disable autostart when removing kasl from systems
- Verify functionality after system updates
- Keep autostart configuration documented
Security Considerations
Section titled “Security Considerations”- Task Scheduler method is more secure than Registry
- User-level autostart is sufficient for most use cases
- Monitor autostart entries for unauthorized changes
- Disable autostart on shared systems when appropriate
Integration with Other Commands
Section titled “Integration with Other Commands”The autostart command works with other kasl commands:
watch: The monitoring command that gets started automaticallyinit: Configure kasl before enabling autostartstatus: Check if monitoring is running after autostart