docs

Commands

CLI commands and scheduled tasks, their executions, failures, duration, and the arguments each run received.

Commands shows every CLI command your services ran: migrations, imports, scheduled cleanups, one-off scripts. Use it to confirm a nightly task ran, see how long it took, and find the arguments of the run that failed.

The list lives at /o/:org/projects/:project/commands and a command at /o/:org/projects/:project/commands/detail?key=orders:sync.

Where the data comes from

A command is a span with entry_point.type=cli. The key is cli.command.name, or the span name when it is missing.

The AdonisJS agent traces Ace commands as spans named cli <name> with these attributes:

AttributeValue
entry_point.typecli
cli.command.nameCommand name
cli.command.descriptionCommand description
cli.args.<name>Each positional argument
cli.flags.<name>Each flag

A failed command is reported as an exception too, so it shows up in Issues.

Which commands are traced

The agent's cli option decides. By default it includes * and excludes make:*, generate:*, queue:work and queue:listen, because scaffolding commands are noise and workers run for hours. Commands that set staysAlive are never traced, whatever the rules say.

ts
// config/unhandled.ts
import env from '#start/env'
import { defineConfig } from '@unhandled/agent-adonisjs'

export default defineConfig({
  dsn: env.get('UNHANDLED_DSN'),
  environment: env.get('APP_ENV'),
  cli: {
    include: ['orders:*', 'invoices:*', 'migration:run'],
  },
})

include and exclude take globs where * matches anything. Setting exclude replaces the default list. cli: false turns command tracing off. See Configuration.

Other languages and SDKs can report commands by setting entry_point.type=cli and cli.command.name on the span that covers the run. Every such span counts as one execution.

The list

CardValueHint
Total ExecutionsRuns in range
Unique CommandsDistinct command names
Error RateShare of failed runsNumber of failed runs
Avg DurationMean run timeP95

Command Executions Over Time stacks succeeded and failed runs per bucket. Duration plots average and P95.

The table lists up to 200 rows, one per command and service, with Command, Executions, Error rate, Avg, Last run and Service. Sort by Executions (the default), Failures, Avg or P95. The Service column is hidden when exactly one service is selected.

Command detail

The detail page repeats the cards and charts for one command. When several services run it and you arrived without a service, it asks you to choose one first.

Failure reasons groups failed runs by error.type, falling back to the span status message, with a count and last seen time for the top 20.

Recent executions lists the 50 latest runs with Time, Arguments and flags, Status, Duration and a trace link. Arguments and flags are rebuilt from the span attributes: positional values as plain text, --flag for a flag set to true and --flag=value for the rest. Filter by All or Failed. Show switches between Recent, the default, and Slowest.

Answering "did last night's sync run, and why did it fail?"

  1. Open orders:sync and check Last run in the list.
  2. Set Recent executions to Failed and read the arguments of the failed run.
  3. Read Failure reasons for the error type, then open the trace to see which query or call failed.
  4. Open the matching exception in Issues for the stack trace.