Complete reference for all Sleepless Agent command-line interface commands.
The Sleepless Agent CLI is accessed through the sle command:
sle [OPTIONS] COMMAND [ARGS]These options can be used with any command:
| Option | Description | Default |
|---|---|---|
--help |
Show help message | - |
--version |
Show version number | - |
--config FILE |
Path to config file | ./config.yaml |
--db-path PATH |
Database file path | ./workspace/data/tasks.db |
--results-path PATH |
Results directory | ./workspace/data/results |
--log-level LEVEL |
Logging level | INFO |
--verbose |
Enable verbose output | False |
--quiet |
Suppress output | False |
Start the agent daemon for continuous operation.
sle daemon [OPTIONS]Options:
--test- Run in test mode (dry run)--test-slack- Test Slack connection only--no-slack- Run without Slack integration--poll-interval MS- Queue polling interval (default: 250ms)--max-workers N- Maximum parallel tasks (default: 5)
Examples:
# Start daemon normally
sle daemon
# Test mode without executing tasks
sle daemon --test
# Run without Slack
sle daemon --no-slack
# Custom polling interval
sle daemon --poll-interval 500Submit a new task or thought.
sle think DESCRIPTION [OPTIONS]Arguments:
DESCRIPTION- Task description (required)
Options:
-p, --project NAME- Assign to project (makes it serious)--priority LEVEL- Set priority (low/normal/high)--deadline DATETIME- Set deadline--depends-on ID- Dependency on another task--dry-run- Preview without creating
Examples:
# Random thought
sle think "Research async patterns in Python"
# Serious project task
sle think "Implement caching layer" -p backend
# High priority with deadline
sle think "Fix critical bug" --priority high --deadline "2024-10-25 18:00"
# Task with dependency
sle think "Deploy to production" --depends-on 42Check system status and queue.
sle check [OPTIONS]Options:
--detailed- Show detailed information--queue- Show queue details only--metrics- Show performance metrics--json- Output as JSON
Examples:
# Basic status check
sle check
# Detailed status with metrics
sle check --detailed --metrics
# Queue status as JSON
sle check --queue --jsonOutput includes:
- System health status
- Claude usage (current/limit)
- Queue depth by priority
- Active tasks
- Recent completions
- Performance metrics
View task reports and summaries.
sle report [IDENTIFIER] [OPTIONS]Arguments:
IDENTIFIER- Task ID, date (YYYY-MM-DD), or project name (optional)
Options:
--list- List all available reports--format FORMAT- Output format (text/markdown/json)--output FILE- Save to file--last N- Show last N reports
Examples:
# Today's report
sle report
# Specific task report
sle report 42
# Date report
sle report 2024-10-24
# Project report
sle report backend
# List all reports
sle report --list
# Save report to file
sle report --output report.mdCancel a task or entire project.
sle cancel IDENTIFIER [OPTIONS]Arguments:
IDENTIFIER- Task ID or project name (required)
Options:
--force- Skip confirmation--cascade- Cancel dependent tasks--reason TEXT- Cancellation reason
Examples:
# Cancel specific task
sle cancel 42
# Cancel entire project
sle cancel backend
# Force cancel with reason
sle cancel 42 --force --reason "No longer needed"
# Cancel with dependencies
sle cancel 42 --cascadeManage cancelled/deleted tasks.
sle trash SUBCOMMAND [OPTIONS]Subcommands:
List items in trash.
sle trash list [OPTIONS]Options:
--type TYPE- Filter by type (task/project)--days N- Items older than N days
Restore items from trash.
sle trash restore IDENTIFIERPermanently delete trash items.
sle trash empty [OPTIONS]Options:
--older-than DAYS- Only items older than N days--force- Skip confirmation
Examples:
# List trash contents
sle trash list
# Restore a project
sle trash restore backend
# Empty old items
sle trash empty --older-than 30Initialize workspace and database.
sle init [OPTIONS]Options:
--force- Overwrite existing setup--workspace PATH- Custom workspace path
Examples:
# Initialize default workspace
sle init
# Custom workspace location
sle init --workspace /data/sleeplessManage configuration.
sle config SUBCOMMAND [OPTIONS]Subcommands:
Display current configuration.
sle config show [--section SECTION]Validate configuration files.
sle config validateExport configuration.
sle config export [--output FILE]Test configuration components.
sle config test --component COMPONENTComponents: slack, git, claude, database
Examples:
# Show all configuration
sle config show
# Show specific section
sle config show --section claude_code
# Validate configuration
sle config validate
# Test Slack connection
sle config test --component slackMigrate database schema.
sle migrate [OPTIONS]Options:
--target VERSION- Target schema version--dry-run- Preview migration
Examples:
# Run migrations
sle migrate
# Preview migration
sle migrate --dry-runView and manage logs.
sle logs [OPTIONS]Options:
--tail N- Show last N lines--follow- Follow log output--level LEVEL- Filter by log level--task ID- Filter by task ID--since TIME- Logs since timestamp
Examples:
# View recent logs
sle logs --tail 100
# Follow logs in real-time
sle logs --follow
# Filter errors only
sle logs --level ERROR
# Task-specific logs
sle logs --task 42View performance metrics.
sle metrics [OPTIONS]Options:
--period PERIOD- Time period (hour/day/week)--export FILE- Export to file--json- JSON output
Examples:
# Current metrics
sle metrics
# Daily metrics
sle metrics --period day
# Export metrics
sle metrics --export metrics.json --jsonSystem health check.
sle health [OPTIONS]Options:
--verbose- Detailed health information--component NAME- Check specific component
Examples:
# Basic health check
sle health
# Verbose health check
sle health --verbose
# Check specific component
sle health --component databaseTest Slack connection.
sle test-slack [OPTIONS]Options:
--verbose- Show detailed test results--channel CHANNEL- Test specific channel
Examples:
# Basic Slack test
sle test-slack
# Verbose test
sle test-slack --verboseClean up workspaces and old data.
sle clean [OPTIONS]Options:
--workspaces- Clean task workspaces--logs- Clean old logs--results- Clean old results--older-than DAYS- Items older than N days--dry-run- Preview cleanup
Examples:
# Clean old workspaces
sle clean --workspaces --older-than 7
# Preview full cleanup
sle clean --workspaces --logs --results --dry-runExport data from the system.
sle export TYPE [OPTIONS]Types:
tasks- Export task datareports- Export reportsmetrics- Export metrics
Options:
--format FORMAT- Output format (csv/json/excel)--output FILE- Output file--since DATE- Start date--until DATE- End date
Examples:
# Export tasks as CSV
sle export tasks --format csv --output tasks.csv
# Export last week's reports
sle export reports --since 2024-10-17 --until 2024-10-24Import tasks from file.
sle import FILE [OPTIONS]Options:
--format FORMAT- Input format (csv/json)--project NAME- Assign to project--dry-run- Preview import
Examples:
# Import tasks from CSV
sle import tasks.csv --format csv
# Import to specific project
sle import tasks.json --project backendStart interactive shell.
sle shellFeatures:
- Command history
- Tab completion
- Direct database queries
- Real-time status
Example session:
$ sle shell
Sleepless Agent v0.1.0
>>> check
System Status: ACTIVE
>>> think "New task from shell"
Task created: ID 43
>>> exitEnable debug output:
SLEEPLESS_LOG_LEVEL=DEBUG sle daemonUse custom config file:
sle --config custom.yaml daemonDirect database access:
# Backup database
sle db backup --output backup.db
# Query database
sle db query "SELECT * FROM tasks WHERE status='pending'"
# Vacuum database
sle db vacuum| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Configuration error |
| 3 | Database error |
| 4 | Connection error |
| 5 | Authentication error |
| 10 | Task failed |
| 11 | Task timeout |
| 20 | Resource limit |
Commands respect these environment variables:
SLEEPLESS_CONFIG- Config file pathSLEEPLESS_LOG_LEVEL- Log levelSLEEPLESS_WORKSPACE- Workspace directorySLEEPLESS_DB_PATH- Database pathNO_COLOR- Disable colored output
Add to your shell profile:
alias sla="sle daemon"
alias slc="sle check"
alias slt="sle think"
alias slr="sle report"Enable tab completion:
# Bash
eval "$(_SLE_COMPLETE=bash_source sle)"
# Zsh
eval "$(_SLE_COMPLETE=zsh_source sle)"Monitor status continuously:
watch -n 5 sle check# Function for quick tasks
task() {
sle think "$@"
}
# Usage
task "Quick thought about caching"- Slack Commands - Slack slash commands
- Python API - Programmatic access
- Configuration - Configuration reference
- Examples - Usage examples