Skip to content

Codex Diff

A codex-like change: plain numbered rows, the added lines green and the removed red, with no frame around them.

On this page

Examples

The shared grammar with the look fixed: the same as <CliDiff preset="codex-like" />, so it reads as the codex-like look on its own or inside a session. Every part in all eight looks is on Agent CLI.

Installation

npx knowns-ui@latest add agent-cli-codex
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

path
string
The file.
before / after
string
The file's text before and after.
patch
string
A unified patch instead.
maxRows
number
Default14
Rows before +N lines.

When to use

When to use

  • Showing what an edit changed, inline under the call that made it.

When not to use

  • Reviewing a whole file's change side by side: use Inline Diff.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Codex Diff to my app and wire it to my own data.
  • I need showing what an edit changed, inline under the call that made it. Set that up with the Knowns UI Codex Diff.
  • Which Codex Diff props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "codex-diff" }) and search_docs({ query: "codex diff" }).

Need help?

Stuck on Codex Diff, or found something off? We read every message.