Skip to content

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.

Terminal window
kasl autostart [COMMAND]
Terminal window
kasl autostart enable

Configures 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”
Terminal window
kasl autostart disable

Removes any existing autostart configuration, ensuring kasl will not automatically start on system boot.

Terminal window
kasl autostart status

Checks and displays whether autostart is currently enabled or disabled on the system.

Terminal window
# Enable autostart
kasl autostart enable
# Check current status
kasl autostart status
# Disable autostart
kasl autostart disable
Terminal window
# Enable with admin privileges (recommended)
# Run as Administrator
kasl autostart enable
# Enable without admin (user-level only)
kasl autostart enable
# Check which method was used
kasl autostart status

Supported Methods:

  1. Windows Task Scheduler (Primary)

    • Requires administrator privileges
    • More reliable and configurable
    • Can be managed through Windows Task Manager
  2. 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

Future Implementation:

  • LaunchAgent: User-level autostart
  • Configuration in ~/Library/LaunchAgents/
  • Integration with macOS system preferences

Future Implementation:

  • systemd user service: Modern Linux systems
  • init.d scripts: Legacy systems
  • Integration with desktop environment autostart

Enable Autostart (Windows - Task Scheduler)

Section titled “Enable Autostart (Windows - Task Scheduler)”
✅ Autostart enabled successfully!
Method: Windows Task Scheduler
Status: Active
Next run: On system startup

Enable Autostart (Windows - Registry Fallback)

Section titled “Enable Autostart (Windows - Registry Fallback)”
⚠️ Autostart enabled with limited functionality
Method: Registry Run Key (user-level)
Status: Active
Note: Task Scheduler method requires administrator privileges
Autostart Status: Enabled
Method: Windows Task Scheduler
Configuration: Active
Next startup: Will start automatically on system boot
✅ Autostart disabled successfully!
Removed: Task Scheduler entry
Removed: Registry entries
Status: Disabled
❌ Autostart not supported on this platform
Platform: macOS
Status: Not implemented
Note: This feature is planned for future releases
Terminal window
# Set up autostart for seamless monitoring
kasl autostart enable
# Verify it's working
kasl autostart status
# Start monitoring manually for first time
kasl watch
Terminal window
# Deploy to multiple workstations
kasl autostart enable
# Verify deployment
kasl autostart status
# Remove from decommissioned systems
kasl autostart disable
Terminal window
# Enable for testing
kasl autostart enable
# Test autostart functionality
# Restart system and verify kasl starts
# Disable after testing
kasl autostart disable

Insufficient privileges (Windows)

Terminal window
# Run as Administrator
# Right-click Command Prompt/PowerShell -> "Run as Administrator"
kasl autostart enable
# Or use user-level fallback
kasl autostart enable
# Will use Registry method automatically

Autostart not working after enable

Terminal window
# Check status
kasl autostart status
# Verify system startup
# Restart system and check if kasl starts
# Re-enable if needed
kasl autostart disable
kasl autostart enable

Platform not supported

Terminal window
# Check current platform support
kasl autostart status
# Manual startup alternative
# Add kasl watch to your startup scripts

Task Scheduler not working

Terminal window
# Check Task Scheduler manually
# Open Task Scheduler -> Task Scheduler Library -> kasl
# Try Registry method
kasl autostart disable
kasl autostart enable

Registry method issues

Terminal window
# Check Registry manually
# HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
# Re-enable with admin privileges
kasl autostart disable
# Run as Administrator
kasl autostart enable
Terminal window
# 1. Enable autostart
kasl autostart enable
# 2. Check status
kasl autostart status
# 3. Test by restarting system
# Restart your computer
# 4. Verify kasl is running
kasl watch --stop
# If kasl was running, autostart is working
  1. Use administrator privileges when possible for Task Scheduler method
  2. Test autostart functionality after deployment
  3. Document deployment method used for each system
  4. Monitor autostart status regularly
  1. Enable autostart on all workstations that need monitoring
  2. Disable autostart when removing kasl from systems
  3. Verify functionality after system updates
  4. Keep autostart configuration documented
  1. Task Scheduler method is more secure than Registry
  2. User-level autostart is sufficient for most use cases
  3. Monitor autostart entries for unauthorized changes
  4. Disable autostart on shared systems when appropriate

The autostart command works with other kasl commands:

  • watch: The monitoring command that gets started automatically
  • init: Configure kasl before enabling autostart
  • status: Check if monitoring is running after autostart
  • watch - The monitoring command that autostart enables
  • init - Configure kasl before setting up autostart
  • update - Update kasl while preserving autostart settings