hermes-agent/hermes_cli/subcommands/trace.py
Teknium 2aa908e867
feat(trace): upload sessions to HF Agent Trace Viewer
Salvage trace upload as a smaller CLI-first feature: deterministic Claude Code JSONL export, fail-closed redaction, lazy Hugging Face dependency, and no gateway slash-command wiring.
2026-07-06 06:01:17 -07:00

40 lines
1.2 KiB
Python

"""``hermes trace`` subcommand parser."""
from __future__ import annotations
from typing import Callable
def build_trace_parser(subparsers, *, cmd_trace: Callable) -> None:
"""Attach the ``trace`` subcommand to ``subparsers``."""
trace_parser = subparsers.add_parser(
"trace",
help="Upload session transcripts to Hugging Face Agent Trace Viewer",
description=(
"Export a Hermes session transcript as Claude Code JSONL and upload "
"it to a private Hugging Face dataset for the Agent Trace Viewer."
),
)
trace_sub = trace_parser.add_subparsers(dest="trace_command")
upload = trace_sub.add_parser(
"upload",
aliases=["up"],
help="Upload a session transcript",
)
upload.add_argument(
"session_id",
nargs="?",
help="Session id to upload (default: most recent session)",
)
upload.add_argument(
"--public",
action="store_true",
help="Create/update a public trace dataset instead of private",
)
upload.add_argument(
"--no-redact",
action="store_true",
help="Upload without secret redaction; only use after manual review",
)
trace_parser.set_defaults(func=cmd_trace)