ai-scheduler

Kodachi Scheduler Daemon - Cron-based command scheduling with security whitelist

Version: 9.8.4 | Size: 5.5MB | Author: Warith Al Maawali

License: Proprietary | Website: https://www.digi77.com


File Information

Property Value
Binary Name ai-scheduler
Version 9.8.4
Build Date REDACTED-BUILD-TIME
Rust Version 1.82.0
File Size 5.5MB
Author Warith Al Maawali
License Proprietary
Category Kodachi Binary
Description Kodachi Scheduler Daemon - Cron-based command scheduling with security whitelist
Git Commit unknown
Metadata Generated 2026-06-28T11:16:29Z
Binary Timestamp Unknown
JSON Data View Raw JSON

SHA256 Checksum

312320c071286aa2f120d0e3ad358d9ffd3459c7e2e8d9b75b4caa9b146343f5

Features

# Feature
1 Cron expression parsing ("0 * * * *")
2 Event-driven triggers
3 Command whitelist validation
4 Execution history tracking

Security Features

Feature Description
Input Validation Argument parsing via clap; per-command validation is the consumer's responsibility
Rate Limiting Not provided by cli-core
Authentication Not provided by cli-core (see online-auth)
Encryption Not provided by cli-core

System Requirements

Requirement Value
OS Linux (Debian-based)
Privileges root/sudo for system operations
Dependencies OpenSSL, libcurl

Global Options

Flag Description
-h, --help Print help information
-v, --version Print version information
-n, --info Display detailed information
-e, --examples Show usage examples
--json Output in JSON format
-o, --output-format <FORMAT> Force output format (text|json)
--json-pretty Pretty-print JSON output with indentation
--json-human Enhanced JSON output with improved formatting (like jq)
--fields <FIELD_LIST> Select specific fields to include in output (comma-separated)
--limit <NUMBER> Limit number of results returned
--offset <NUMBER> Skip first N results (for pagination)
-d, --work-dir <PATH> Working directory (defaults to auto-detected base directory)
--port <PORT> Set custom port number (1024-65535)
--log-level <LEVEL> Set log level (error|warn|info|debug)
--verbose Enable verbose output
--quiet Suppress non-essential output
--no-color Disable colored output
--config <FILE> Use custom configuration file
--timeout <SECS> Set operation timeout in seconds (optional; no default applied)
--retry <COUNT> Retry attempts (optional; no default applied)

Commands

Daemon Control

start

Start the scheduler daemon

Usage:

ai-scheduler start [OPTIONS]

Schedule Management

add

Add a new scheduled task

Usage:

ai-scheduler add [OPTIONS]

list

List all scheduled tasks

Usage:

ai-scheduler list [OPTIONS]

remove

Remove a scheduled task

Usage:

ai-scheduler remove [OPTIONS]

Operational Scenarios

Scenario-oriented workflows generated from the binary's built-in -e --json examples.

Scenario 1: Daemon Control

Start and manage the scheduler daemon

Step 1: Start scheduler daemon

sudo ai-scheduler start
Expected Output: Scheduler daemon started successfully

Note

Runs as background service

Step 2: Start in foreground mode for debugging

sudo ai-scheduler start --foreground
Expected Output: Scheduler running in foreground with live output

Note

Useful for debugging and testing scheduled tasks

Step 3: Foreground mode with JSON status output

sudo ai-scheduler start --foreground --json
Expected Output: JSON events as tasks are scheduled and executed

Note

Combines debug visibility with structured output

Step 4: Start daemon with JSON status output

sudo ai-scheduler start --json
Expected Output: JSON response with daemon process info

Note

Useful for automated monitoring

Scenario 2: Schedule Management

Add, list, and remove scheduled tasks

Step 1: Schedule a daily network check at 8 AM

ai-scheduler add --name "daily-check" --command "health-control net-check" --cron "0 8 * * *"
Expected Output: Task scheduled successfully with ID

Note

Cron syntax: minute hour day month weekday

Step 2: Check Tor status every hour

ai-scheduler add --name "hourly-tor" --command "tor-switch tor-status" --cron "0 * * * *"
Expected Output: Hourly task created successfully

Note

Executes at the start of each hour

Step 3: Schedule DNS leak check every 30 minutes with JSON output

ai-scheduler add --name "dns-check" --command "dns-leak test" --cron "*/30 * * * *" --json
Expected Output: JSON with task ID and schedule details

Note

Full add command with all parameters and structured output

Step 4: Schedule weekly cleanup every Sunday at 2 AM

ai-scheduler add --name "weekly-cleanup" --command "health-control cleanup" --cron "0 2 * * 0" --json
Expected Output: Task details in JSON format

Note

Weekday 0 = Sunday, 1 = Monday, etc.

Step 5: List all scheduled tasks

ai-scheduler list
Expected Output: Table of scheduled tasks with IDs and status

Note

Shows task name, command, schedule, and next run

Step 6: List scheduled tasks as JSON

ai-scheduler list --json
Expected Output: Task list in JSON format

Note

Structured output for automation

Step 7: Remove scheduled task by ID

ai-scheduler remove 1
Expected Output: Task removed successfully

Note

Use 'list' command to find task IDs

Step 8: Remove task with JSON confirmation

ai-scheduler remove 2 --json
Expected Output: JSON response confirming task removal

Scenario 3: Gateway Core Policy Validation

Scheduler command validation is aligned with shared ai-gateway core policy and sanitization rules

Step 1: Valid passive command accepted by shared gateway-core validator

ai-scheduler add --name "tor-health" --command "tor-switch tor-status" --cron "*/15 * * * *" --json
Expected Output: Task created successfully

Step 2: Unknown service is rejected by shared validator before scheduling

ai-scheduler add --name "blocked-test" --command "malicious-binary run" --cron "0 * * * *" --json
Expected Output: Validation error indicating service is blocked

Environment Variables

Variable Description Default Values
RUST_LOG Set logging level info error|warn|info|debug|trace
NO_COLOR Disable all colored output when set unset 1|true|yes (any value disables color)

Exit Codes

Code Description
1 General error
0 Success
4 Network error
3 Permission denied
2 Invalid arguments
5 File not found