LogoRobo.js

CLI for AI

Robo.js CLI commands produce structured JSON output that AI coding tools can parse and reason over programmatically.

The Robo.js CLI includes commands designed for AI tool consumption. When invoked with --json, these commands produce structured output that AI agents can parse and reason over — no screen-scraping or regex needed.

Skills reference these CLI commands in their workflows. For example, the robo-debug skill uses robo inspect --json and robo logs --json as its primary diagnostic tools.

robo inspect

Display your project's structure, plugins, routes, hooks, configuration, and environment variable health.

npx robo inspect --json

Options

FlagDescription
--json, -jOutput as structured JSON
--mode, -mWhich mode manifest to inspect (development, production, or custom)

Without --json, the command prints a human-readable summary.

JSON output schema

{
  "project": {
    "name": "my-bot",
    "version": "1.0.0",
    "language": "typescript",
    "roboVersion": "0.11.0",
    "mode": "production",
    "buildTime": "2025-03-15T10:30:00.000Z"
  },
  "plugins": [
    {
      "name": "@robojs/discordjs",
      "version": "0.11.0",
      "namespace": "discord",
      "routes": ["commands", "events", "context", "middleware"],
      "hooks": ["start", "stop", "prepare", "hmr"]
    }
  ],
  "routes": {
    "commands": ["ping", "help", "admin ban"],
    "events": ["messageCreate", "ready"],
    "api": ["/api/health", "/api/users"],
    "context": ["user/Report"],
    "middleware": ["logger"]
  },
  "hooks": ["start", "stop", "prepare"],
  "config": {
    "type": "robo",
    "namespace": "my-bot"
  },
  "env": {
    "summary": { "total": 5, "set": 4, "empty": 0, "missing": 1 },
    "missing": ["OPENAI_API_KEY"],
    "satisfied": ["DISCORD_TOKEN", "DATABASE_URL", "NODE_ENV", "PORT"]
  }
}

Key fields

FieldDescription
projectProject name, version, language, Robo version, build mode, and build time
pluginsArray of installed plugins with their namespaces, routes, and hooks
routesAll registered routes grouped by type (commands, events, api, context, middleware)
hooksLifecycle hooks present in the project
configMerged project configuration
envEnvironment variable health: total count, how many are set, empty, or missing

The env.missing array is one of the most useful fields for diagnostics. Missing environment variables are a common source of runtime errors.

robo logs

Query, filter, and stream local log files from .robo/logs/.

npx robo logs --json --level error

Options

FlagDescription
--json, -jOutput as NDJSON (one JSON object per line)
--level, -lFilter by minimum log level (trace, debug, info, warn, error)
--source, -pFilter by source/plugin name (case-insensitive substring match)
--grep, -gFilter log messages by text or regex pattern
--mode, -mWhich mode logs to read (development, production, or custom)
--limit, -nMaximum number of entries to output
--tail, -tWatch for new log entries in real time (stream mode)

NDJSON output format

Each line is a standalone JSON object:

{"timestamp":"10:15:32.000","level":"error","source":"discordjs","message":"Failed to connect to gateway"}
{"timestamp":"10:15:33.100","level":"warn","source":"api","message":"Rate limit approaching for /api/users"}
{"timestamp":"10:15:34.200","level":"info","source":null,"message":"Reconnecting..."}
FieldTypeDescription
timestampstringLog entry timestamp
levelstringLog level (trace, debug, info, warn, error, event, ready, wait)
sourcestring | nullPlugin or logger fork name (e.g., discordjs, api, ai)
messagestringThe log message content

Filter examples

# Recent errors only
npx robo logs --json --level error

# Logs from the Discord plugin
npx robo logs --json --source discordjs

# Search for connection issues
npx robo logs --json --grep "ECONNREFUSED"

# Combine filters: warnings from the API layer, last 20 entries
npx robo logs --json --level warn --source api --limit 20

# Stream new errors in real time
npx robo logs --json --level error --tail

Log level priority

Levels are ordered by priority. The --level filter shows entries at or above the specified level:

LevelPriorityDescription
trace0Fine-grained debugging
debug1Development diagnostics
info2General information
wait3Waiting/loading indicators
other4Standard output
event5Event-driven messages
ready6Startup/ready signals
warn7Warnings
error8Errors

robo skills

Manage AI coding skills from plugins.

CommandDescription
npx robo skillsList installed and available skills
npx robo skills listList installed and available skills
npx robo skills install --allInstall from all registered plugins
npx robo skills install <plugin>Install from a specific plugin
npx robo skills remove <plugin>Remove skills from a plugin
npx robo skills updateUpdate all installed skills
npx robo skills update <plugin>Update skills from a specific plugin

Install options

FlagDescription
--all, -aInstall from all registered plugins
--force, -fOverwrite existing skills from other plugins
--yes, -ySkip confirmation prompts
--silent, -sSuppress output
--verbose, -vShow debug information

How AI tools use these

The workflow is circular: skills reference CLI commands, CLI commands produce structured output, and AI tools reason over that output.

  1. A skill (e.g., robo-debug) instructs the AI tool to run npx robo inspect --json
  2. The CLI reads manifest files and outputs structured JSON
  3. The AI tool parses the JSON to understand project topology
  4. The tool runs npx robo logs --json --level error to check for issues
  5. The tool cross-references errors with the project structure and suggests fixes

This pattern means AI tools can diagnose issues, understand your project, and generate correct code without relying on file-reading heuristics alone.

Next steps

On this page