Skip to main content
This page covers data queries. OpenShell service installation, status, logs and safe removal use the separate aiv plugin commands described in Deploy the OpenShell plugin. The plugin HTTP token is not a query SpaceKey.

Prepare query credentials

Account login manages accounts and Spaces; data queries use a SpaceKey. These credentials serve different purposes. Prepare the client using Install aiv CLI. These examples query Codex. Replace the platform URL, email, and SPACE_ID with your own values. A Web login or Web-generated installation command does not establish a CLI account session.
Enter your password at the prompt. Find the same space as the Web UI with aiv space list, then select it with space use. space list lists spaces without switching the current one. Choose one of the following paths. You already have a full Key, copied from the Web creation dialog or provided by an administrator: run this command and paste that Key at the hidden prompt. Import verifies and saves it for the current space. Use this path to verify a Key created on the website.
You do not have a Key yet: administrators and developers can create and save a new query Key. Without creation permission, obtain an authorized full Key from an administrator and import it as above.
The following commands explicitly use --agent-product Codex. For another Agent, use its actual platform product identifier, such as langfuse for SDK ingestion; do not supply an individual Agent UUID. Successful onboarding may save a default product, but a first query or a space switch should not depend on one. For Web Key creation, verification and rotation, see Spaces and permissions.

Follow one record from list to detail

  1. List Traces in the time range containing your task and copy one complete ID.
  1. Replace TRACE_ID with that ID and run trace get first. Copy a span_id from the returned spans, replace SPAN_ID, then read that Span. span list fetches a batch by ID and also requires at least one Span ID. Replace placeholders before execution.
  1. To inspect a session, list Sessions first and replace SESSION_ID with an ID from that result. Keep the same time range for session usage.
Success: the detail ID matches the list, and its name, time and status match the same record in the Web UI. An empty list does not confirm onboarding: check Space, product and time range, then use no-data troubleshooting. Inspect query metadata with aiv query metadata traces --agent-product Codex. --since / --until accept RFC3339, timestamps and relative durations such as 15m, 6h and 2d. The default window is the last hour. Use --format json for scripts.

Batch exports

Run in the local directory where you want to save the data. ./dataset is relative to that directory and is created by the CLI. Use a new empty directory for each export; an existing JSONL file with the same name is overwritten.
Defaults produce traces.jsonl (one Trace detail per line) and events.jsonl (one event per line). Check that the reported exported N matches the line count, and open one JSON record to verify its ID and time. An empty Trace result prints no traces to export and may create no file; an old file is not evidence of this run.
--limit caps the current list; exports do not automatically paginate. Reaching that limit does not establish a complete export. For an archive, use fixed --since / --until bounds, then use supported backend pagination or split time windows into separate directories. Errors may leave partial files; fix the cause and retry into a new directory. Exports may contain raw context; review collection mode and content before sharing.

Multiple platforms

Each profile binds a platform and account, and each Space saves its own Key. For 401 check Key validity; for 403 check that the Key belongs to the requested Space. Account login alone does not configure a query Key.