Skip to content

ts report

Export one of the built-in administration reports as CSV or PDF. Reach for it when you need the data somewhere else — a spreadsheet, a compliance archive, a scheduled job — rather than on screen.

Usage

text
ts report <sessions | user-usage | repository-usage | performance-traces | shares>
          [--since=DATE] [--until=DATE] [--output-file=PATH] [--pdf]

Description

The five reports are the same ones the Administration site publishes, generated by the same queries and formatters, so an export and the on-screen report always agree.

  • sessions — one row per session: start and end, duration, user, machine, application and version, site, and address.
  • user-usage — per-user totals: session count, usage time, and share of the total.
  • repository-usage — the same totals grouped by application rather than by user.
  • performance-traces — client performance events with their application, user, and duration.
  • shares — share-link visits: which share, which application, outcome, and duration.

CSV is the default and it goes to standard output, so a report pipes straight into another tool. Pass --output-file=PATH to write it to a file instead; ts then prints the path and the byte count rather than the report itself.

--pdf switches the format, and it requires --output-file. A PDF is binary, and writing it to a terminal would corrupt the output and leave your shell in a strange state — so ts refuses up front rather than emitting it. This check happens before the server is contacted, so the error is immediate and nothing is generated.

The two formats are not the same data. CSV carries every column the report has; the PDF is a laid-out subset built for circulation. Export CSV when someone is going to analyze the numbers, PDF when someone is going to read or file the document.

--since and --until bound the window, and both are optional and independent. Leaving one out leaves that side unbounded, so a bare ts report sessions exports the entire retained history — which is usually much larger than you expect on a server that has been running a while. A value the server cannot parse as a date is treated as absent rather than rejected, so a typo in --since silently widens the window instead of failing. Check the row count of any export you did not bound.

Options

FlagDescriptionDefault/ValuesNotes
--output-fileWrite the report to this path.PATHPrints the path and size instead of the report. Required with --pdf.
--pdfExport PDF instead of CSV.Default CSVFails without --output-file. Fewer columns than the CSV.
--sinceWindow start.ISO-8601; default unboundedAn unparseable value is ignored, not rejected.
--untilWindow end.ISO-8601; default unbounded

Examples

bash
# Last month's sessions, straight into a spreadsheet
ts report sessions --since=2026-07-01 --until=2026-08-01 > july-sessions.csv

# The same window as a PDF to circulate
ts report user-usage --since=2026-07-01 --until=2026-08-01 \
  --pdf --output-file=july-user-usage.pdf

# Count the rows before you commit to a full export
ts report shares --since=2026-07-01 | wc -l

# Which applications are actually being used
ts report repository-usage --since=2026-01-01 --output-file=apps.csv

# This fails on purpose — a PDF cannot go to the terminal
ts report sessions --pdf

Output

With --output-file, one line:

text
Wrote july-user-usage.pdf (48,132 bytes)

Without it, the CSV itself, header row first and nothing else, so it pipes and redirects cleanly.

Asking for a PDF without a destination fails before anything is generated:

text
Error: --pdf requires --output-file (PDF is not printable to the console).

--format=json is a poor fit for the CSV-to-stdout form: the report text ends up inside the envelope's messages array rather than as a parseable structure. Redirect the plain CSV, or write a file with --output-file and parse the JSON envelope for the path and size.

Exit Codes

0 on success, including when the window matches nothing and the CSV is just a header row. -2 when no report name is given. -1 when the name is not one of the five, when --pdf is passed without --output-file, or when the file cannot be written. -4 when no account is signed in and -5 when the signed-in account is not a Server Administrator.

  • ts usage — The headline totals, when you do not need the rows.
  • ts sessions — What is running right now, as opposed to what ran.
  • ts audit — Operator actions, which are a separate log from these reports.