ai-discovery
Kodachi Auto-Discovery Daemon - Monitors and indexes Rust service binaries
File Information
| Property | Value |
|---|---|
| Binary Name | ai-discovery |
| Version | 9.8.4 |
| Build Date | Not disclosed |
| Rust Version | 1.82.0 |
| File Size | 1.7MB |
| Author | Warith Al Maawali |
| License | Proprietary |
| Category | Kodachi Binary |
| Description | Kodachi Auto-Discovery Daemon - Monitors and indexes Rust service binaries |
| Git Commit | unknown |
| Metadata Generated | 2026-08-10T13:22:51Z |
| Binary Timestamp | Unknown |
| JSON Data | View Raw JSON |
SHA256 Checksum
0ff8e201b2ed80fa2c6c63ffc293ad60f0d126908b00132991a331199f5ca9c2
Features
| # | Feature |
|---|---|
| 1 | Binary file watching with inotify |
| 2 | Automatic command extraction from -e --json |
| 3 | Live command registry updates |
| 4 | Daemon process management |
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) |
--json-filter <FIELD1,FIELD2> |
Return only specified JSON fields (comma-separated) |
--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) |
Commands
Daemon Control
start
Start the auto-discovery daemon
Usage:
ai-discovery start [OPTIONS]
Options:
-f, --foreground: Run the watch loop in this terminal instead of detaching (blocks until Ctrl+C)--json: Emit status, mode, binaries_watched, commands_indexed, pid and already_running as JSON
Examples:
sudo ai-discovery start
sudo ai-discovery start --foreground
sudo ai-discovery start --json
status
Show daemon status
Usage:
ai-discovery status [OPTIONS]
Options:
--json: Emit the status envelope as JSON (running, pid, binaries_watched, watch_paths)
Examples:
ai-discovery status
ai-discovery status --json
Registry Management
reindex
Force reindex all binaries
Usage:
ai-discovery reindex [OPTIONS]
Options:
--service <NAME>: Reindex only this service. NAME is the deployed binary filename and must match exactly--json: Emit status, binaries_scanned, commands_indexed and errors as JSON
Examples:
ai-discovery reindex
ai-discovery reindex --json
ai-discovery reindex --service health-control
Operational Scenarios
Scenario-oriented workflows generated from the binary's built-in -e --json examples.
Scenario 1: Quick Start
The three things you will actually run: check the daemon, start it, reindex.
Step 1: Check whether the discovery daemon is running
ai-discovery status
Step 2: Start the daemon in the background
sudo ai-discovery start
Note
Needs root: the PID file and daemon log are written under the install directory.
Step 3: Rescan every watched binary and count its commands
ai-discovery reindex
Scenario 2: Daemon Control
Start the auto-discovery daemon and check its state. The daemon watches the deployed Rust service binaries and re-reads their command lists when they change.
Step 1: Start the daemon detached in the background
sudo ai-discovery start
Note
Needs root (writes the PID file and log under the install directory). If a daemon is already running its PID is reused and 'Existing daemon reused' is printed.
Step 2: Run the watch loop in this terminal instead of detaching
sudo ai-discovery start --foreground
Note
Blocks until Ctrl+C. -f is the short form of --foreground.
Step 3: Start in the background and get the result as JSON
sudo ai-discovery start --json
Step 4: Check daemon liveness and the watch configuration
ai-discovery status
Note
Liveness is read from the PID file plus /proc, so a stale PID file still reports Stopped.
Step 5: Machine-readable daemon status for scripts and the dashboard
ai-discovery status --json
Scenario 3: Registry Management
Force a rescan of the watched binaries. Each binary is invoked with -e --json and its commands are extracted and deduplicated.
Step 1: Reindex every watched Rust service binary
ai-discovery reindex
Note
Per-binary progress goes to stderr so it does not pollute --json on stdout.
Step 2: Reindex everything and capture the totals as JSON
ai-discovery reindex --json
Step 3: Reindex a single service instead of the whole set
ai-discovery reindex --service health-control
Note
--service takes the deployed binary FILENAME and must match exactly. A name outside the configured indexable set is rejected before scanning.
Step 4: Targeted reindex of one service with structured output
ai-discovery reindex --service ai-monitor --json
Environment Variables
| Variable | Description | Default | Values |
|---|---|---|---|
NO_COLOR |
Disable all colored output when set | unset | 1|true|yes (any value disables color) |
Exit Codes
| Code | Description |
|---|---|
| 4 | Network error |
| 5 | File not found |
| 3 | Permission denied |
| 2 | Invalid arguments |
| 0 | Success |
| 1 | General error |