LogoRobo.js

Terminal Commands

Terminal commands provide an interactive interface within the Robo.js development server, with built-in and plugin-provided commands.

When running robo dev or robo start in a TTY environment, Robo.js launches an interactive terminal. Type / followed by a command name to interact with your project at runtime — inspect state, manage data, check plugin status, and more.

Terminal commands are available to both humans typing in the console and AI tools reasoning about your project's runtime state.

Built-in commands

These commands are hardcoded into the interactive terminal and always available:

CommandDescription
/helpList all available commands
/clearClear the log output
/outputToggle shell output drawer
/restartFull rebuild and restart (dev mode only)
/stateInspect and modify runtime state
/flashcoreInspect and modify Flashcore storage
/envShow loaded environment variables
/statusShow system status and info
/pluginsList installed plugins

The core robo.js package also ships file-based terminal commands that are always present:

CommandDescription
/skillsManage AI coding skills
/skills listList installed and available skills
/skills installInstall skills from plugins

Plugin-provided commands

Plugins can ship their own terminal commands. Here are some examples from official plugins:

PluginCommands
@robojs/discordjs/discord, /discord status, /discord commands, /discord events, /discord guilds, /discord intents
@robojs/server/server status, /server routes, /server curl, /server openapi, /open, /tunnel start, /tunnel stop, /tunnel list
@robojs/analytics/analytics, /analytics status, /analytics fire, /analytics test
@robojs/ai/ai, /ai status, /ai usage
@robojs/mock/mock, /mock status, /mock command, /mock actions, /mock sessions, /mock stage, /mock use, /mock reset
@robojs/cli/cli, /cli link, /cli list, /cli run

Creating custom commands

Plugins define terminal commands by placing files in src/robo/terminal/commands/. The file name becomes the command name, and subdirectories create subcommands.

status.ts/status
migrate.ts/db migrate
seed.ts/db seed

Each file exports a config and a default handler function:

src/robo/terminal/commands/status.ts
import { createTerminalCommandConfig } from 'robo.js'
import type { TerminalContext } from 'robo.js'

export const config = createTerminalCommandConfig({
  description: 'Show plugin status',
  options: [
    { alias: '-v', name: '--verbose', description: 'Show detailed info', type: 'boolean' }
  ]
} as const)

export default async (context: TerminalContext<typeof config>) => {
  const { verbose } = context.options

  context.write('Plugin status: active\n')

  if (verbose) {
    context.write('Connections: 42\n')
    context.write('Uptime: 3h 15m\n')
  }
}

TerminalContext fields

FieldTypeDescription
argsstring[]Positional arguments
optionsTyped from configParsed option flags
configConfigProject configuration
runtimeRuntimeProvider?Runtime provider for state/flashcore access
write(text: string) => voidWrite output to the terminal
drawerobject?Persistent drawer UI (show, hide, isOpen)

Features

The interactive terminal includes several quality-of-life features:

  • Command history -- Use arrow keys to navigate previous commands
  • Autocomplete -- Tab completion for command names
  • Status indicator -- Shows system status below the input prompt
  • Drawer UI -- Commands can display persistent information below the prompt using context.drawer

Activation conditions

The interactive terminal activates when all of these conditions are met:

  • stdout and stdin are TTY (not piped or redirected)
  • Terminal is at least 10 rows by 40 columns
  • Not running in CI (no CI environment variable)
  • ROBO_NON_INTERACTIVE environment variable is not set

For the full terminal command reference, see Interactive Terminal.

Next steps

On this page