Skip to content

Context CLI

CLI for logging in and fetching Graphsignal signal context.

Install as an isolated CLI tool with uv:

Terminal window
uv tool install graphsignal-context

Store your Graphsignal API key in ~/.graphsignal/config.yml.

Terminal window
graphsignal-context login

You will be prompted for your API key.

Login is not required if the GRAPHSIGNAL_API_KEY environment variable is set.

Fetch information about signals.

Terminal window
graphsignal-context guide

Behavior:

  • Requires a saved API key (graphsignal-context login).
  • Calls GET /api/v1/context/guide/ on https://api.graphsignal.com.
  • Prints the returned text content to stdout.

Fetch signal context for a time range.

Terminal window
graphsignal-context signals --start 2026-03-10T00:00:00Z --end 2026-03-12T00:00:00Z

Optional --tags filter:

Terminal window
graphsignal-context signals \
--start 2026-03-10T00:00:00Z \
--end 2026-03-12T00:00:00Z \
--tags "env:prod;service:inference"

Options:

  • --start (required): Start of time range in ISO 8601 format (for example, 2026-03-10T00:00:00Z).
  • --end (required): End of time range in ISO 8601 format.
  • --tags (optional): Semicolon-separated key:value pairs for exact tag filtering.

Behavior:

  • Requires a saved API key (graphsignal-context login).
  • Converts --start and --end into nanosecond timestamps.
  • Calls GET /api/v1/context/signals/ on https://api.graphsignal.com.
  • Prints the returned context payload to stdout.

Common errors:

  • Not logged in: run graphsignal-context login.
  • Invalid datetime format for --start or --end.
  • --start must be before --end.
  • API request errors (for example, invalid API key).