⚙️ Autonomy CLI
Command-line interface for signal management and system operations.
What is the Autonomy CLI?
The Autonomy CLI is a command-line tool for managing signals, running imports, and performing system operations. It provides a Laravel Artisan-style interface with configuration persistence and sensible defaults.
Built with Commander.js, it remembers your preferences (default realm, author, API URL) so you don't have to repeat them with every command.
Installation
After running npm link, the autonomy command will be available globally in your terminal.
Configuration
The CLI stores user-specific configuration in .autonomy.json at the project root. This file is gitignored and contains your preferences.
First Time Setup
Configuration Commands
autonomy config:set <key> <value>Set a configuration value
autonomy config:get <key>Get a configuration value
autonomy config:listList all configuration values
autonomy config:resetReset all configuration
Import Commands
import:docs
Scan a directory recursively for text files and generate a JSON file of DOCUMENT signals ready for import.
Supported formats: .txt, .md, .markdown, .text, .log, .json, .yml, .yaml, .xml, .csv
Output: signals-import-1735689234567.json
import:bulk
Import signals from a JSON file generated by import:docs or created manually.
Database Commands
autonomy db:migrateRun Prisma database migrations
autonomy db:seedSeed database with sample data
autonomy db:studioOpen Prisma Studio (visual database browser)
autonomy db:reset⚠️ Reset database (destroys all data)
Architecture
File Structure
scripts/
autonomy.js # Main CLI entry point
lib/
config.js # Configuration helpers
commands/
import-docs.js # Document import logic
import-bulk.js # Bulk import logic
db.js # Database commands
.autonomy.json # User configuration (gitignored)How It Works
- Commander.js parses command-line arguments and options
- Config helper loads user preferences from
.autonomy.json - Command modules execute the requested operation
- Results are displayed with formatted output and status indicators