nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Feature] Public session sharing (/share command)

Open akramcodez opened this issue 2 months ago • 4 comments

Description

A /share command that serializes the current session into a deterministic JSON format and hosts a tiny static viewer (or uploads it to a community hosting service) so users can share their agent's thought process.

Use Case

Users frequently want to share impressive agent trajectories, debugging sessions, or workflows with colleagues. Currently, they have to copy-paste raw markdown from the terminal.

Proposed Solution

Implement /share. The simplest version serializes the session to a deterministic JSON file and boots a tiny static local viewer (since source/daemon/ already has IPC/HTTP). Alternatively, allow uploading to a pastebin-style service.

Alternatives Considered

Screenshots, which are difficult to read and cannot contain long context or hidden tool calls.

Additional Context

  • [x] I have searched existing issues to ensure this is not a duplicate
  • [x] This feature aligns with the project's goals (local-first AI assistance)

Implementation Notes (optional)

Nanocoder's session JSON format (source/session/session-manager.ts) is already very close to what a frontend would need to render a session timeline.

akramcodez avatar Sep 25 '26 09:09 akramcodez

@akramcodez shall i pick this up ?

diyaavirmani avatar Sep 29 '26 17:09 diyaavirmani

@akramcodez @addyCooks I'd like to take this if it's still open. #1504 was closed, so nothing is in flight that I can see.

/export already writes JSON, so my plan is the viewer:

  • /share [filename] writes one self-contained .html file locally. There's no upload and no network, and it reuses /export's message handling and file writing.
  • Turns are shown in order. Tool calls are collapsible, with their arguments and output.
  • All content is escaped, and the data is embedded with < written as < so </script> can't break out. A CSP blocks outside loads.
  • Secrets are redacted by default with the existing redactSecrets, and --no-redact turns it off.
  • Tests cover deterministic output, escaping, redaction, and excluding system messages. Plus a changeset.

Would you prefer a separate /share, or /export --html? I'll wait for your go-ahead before starting.

macjayz avatar Nov 05 '26 06:11 macjayz

Hi @macjayz, thanks so much for your interest in this issue! @diyaavirmani asked to be assigned first, so I’m assigning it to them. In the meantime, please feel free to look through the other open issues. We’d love to have your help! 🙌

addyCooks avatar Nov 05 '26 07:11 addyCooks

@diyaavirmani, go for it

addyCooks avatar Nov 05 '26 07:11 addyCooks