Skip to content

cli: render kelos logs in a Claude Code-like color layout - #1794

Draft
sperano wants to merge 3 commits into
kelos-dev:mainfrom
sperano:feat/pretty-logs
Draft

sperano wants to merge 3 commits into
kelos-dev:mainfrom
sperano:feat/pretty-logs

Conversation

@sperano

@sperano sperano commented Oct 4, 2026 •

Copy link
Copy Markdown

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR is related to:

Special notes for your reviewer:

Does this PR introduce a user-facing change?



Summary by cubic

Adds a Claude Code-style color renderer to kelos logs for terminal output. Agent NDJSON (Claude Code, Codex, Gemini, OpenCode) is parsed into a common event model and rendered with tool calls, output previews, red/green edit diffs, todo checklists, and a footer with turns, cost, tokens, and duration. The existing plain format is kept when stdout is piped.

  • --color=auto|always|never controls color output (default: auto, which uses the terminal and respects NO_COLOR).
  • -v shows full tool output, reasoning, diffs, and sub-agent activity instead of previews.
  • --raw prints the agent's NDJSON stream unparsed.
  • Control characters are stripped from untrusted agent and tool output before rendering.

Written for commit 02fcaa8. Summary will update on new commits.

Review in cubic

On a terminal, kelos logs now parses each agent's NDJSON into a common
event model and renders it with tool calls and output previews, red and
green edit diffs (with file line numbers for Claude Code), todo
checklists, and a footer with turns, cost, tokens and duration.

--color=auto|always|never picks the output (auto: stdout is a terminal
and NO_COLOR is unset); piped output keeps the existing plain format.
-v shows full output, reasoning and sub-agent activity, and --raw
prints the NDJSON unparsed.
Agent and tool output is untrusted, so control characters are removed
before rendering to keep escape sequences from reaching the terminal.
Sub-agent events are filtered before streamed text is continued, a
result whose call was not seen gets its own header, an unchanged todo
list is not printed again, and Codex calls that never report a result
are no longer tracked.
On 256-color and true-color terminals, added and removed lines get a
green or red background, after Claude Code's dark and light themes,
padded to the terminal width so the tint spans the line. Other
terminals keep green and red text. Tabs in diff lines are expanded so
the padding lines up.
@CLAassistant

CLAassistant commented Oct 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added needs-triage needs-kind Indicates an issue or PR lacks a kind/* label needs-priority needs-actor needs-release-note Indicates a PR lacks a release-note block labels Oct 4, 2026
@sperano sperano changed the title Feat/pretty logs cli: render kelos logs in a Claude Code-like color layout Oct 4, 2026

This branch is waiting to be deployed

1 waiting deployment
ok-to-test — 02fcaa8a Waiting Oct 4, 2026 by sperano via fork-e2e / e2e-with-environment #1829
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-actor needs-kind Indicates an issue or PR lacks a kind/* label needs-priority needs-release-note Indicates a PR lacks a release-note block needs-triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants