[codex] Add agent review CLI and review API - #286
Conversation
73f6226 to
9af5884
Compare
|
@agavra What if we wrote it in Rust to plug into the current CLI? I use Codex's CLI at work and the Codex desktop app at home and I'd like to be able to use Tuicr from the Codex app without breaking flow-state. With an MCP app, I can do the code review in my application and also paste it directly back into the desktop app, could you let me know your concerns about adding MCP App Support per chance? |
|
adding node/javascript dependencies is definitely a concern with all of the recent supply chain vulnerabilities. Rust isn't immune from that but it's at least slightly better. In general this would add a lot of surface area for tuicr, which means more potential "weird" interactions and a higher test burden. For now I've been testing most PRs manually, adding a server (and especially a frontend) adds a component that is quite a bit tougher to verify. But I admit I don't totally understand your workflow because I don't use the Codex or Claude apps myself, what is the workflow problem you're trying to solve? Is running a terminal window and then copying from that into the Codex app no good? |
|
I hear you on that and that's a fair concern with all of the supply chain risks these days. That's pretty much it, I don't like context switching in tools I use, personally. When I'm in the terminal, I use tmux and the like. I guess I could do it from a terminal and copy and paste it in there, but having it streamlined would've been nice as well. For MCP apps, it interfaces with Claude and Codex similarly to the CLI review skill itself And can directly send feedback back into the chat interface, so it's the same as my cli flow with tmux. |
|
Got it, you are the second person to request MCP support so it might be worth designing something for that. I'm pretty firm on the "no frontend" outside of a TUI line, but I can be open to a minimal rust server that implements the MCP protocol for shipping feeback to an agent. |
9af5884 to
143ce8e
Compare
|
Still working on the MCP Server, but I was able to record a video of the MCP App flow for posterity at least, as you can see, it makes it a lot more streamlined and all of that for addressing review comments and loading them back up and in tandem with MCP itself, it could be published right back into the application itself. CleanShot.2026-05-12.at.22.24.06.mp4 |
b2ed0cd to
1695917
Compare
53ea5fc to
6716e11
Compare
|
@agavra This is ready for review. As a middleground, I exposed the |
|
thanks @iheanyi - I'm getting excited about this change, I'll need to set aside some time to review and test it so may not get around to it immediately but it's on my radar |
6716e11 to
40e0e15
Compare
Replace the experimental Node MCP App package with a Rust stdio MCP server exposed through tuicr mcp. The server reuses tuicr diff loading, review state, comments, reviewed marks, and Markdown export format while exposing model-readable tools for agentic review. Remove the MCP Apps frontend/plugin bundle so this stays a lightweight MCP server rather than a UI app.
40e0e15 to
689a61a
Compare
|
Thanks @iheanyi for the back and forth on this. I spent some time playing around with this and reviewing it and I'm back to being unconvinced we need this. An alternative if we want a native interaction with agents would be to expose a CLI with the following commands: That way the agent can use the The CLI has various benefits (here's what codex says): The core workflow seems to be: let an agent inspect the active review, add comments, mark files reviewed, and export the final review. A small CLI that mutates tuicr’s existing session files through the same Rust validation code could support that without introducing a long-lived server/protocol surface.
That said, I don't mind the refactor into a library (I actively like it) where you could then write a tuicr-mcp using the published cargo crates as a dependency if the MCP is something you absolutely need. Alternatively, you can build an MCP server around the CLI directly. I admit I never use MCPs over CLIs, and I'm pretty stuck in the TUIs for Claude/Codex. Maybe I'll start playing around more with the desktop apps eventually and then understand the need. |
|
Addressed the CLI pivot suggested above. What changed:
Validation:
One behavior I tightened while smoke-testing: if a review is opened with a file/path filter, later commands by |
|
@iheanyi I think you told me you have a bot that addresses review comments automatically, so i just want to make sure you (the human) are OK with this new approach. |
|
@agavra Yeah, haha, that's cool with me. I had read it yesterday before bed and forgot to respond, oops. |
|
I do like having it exposed as a CLI in this case at least. And having |
|
@iheanyi if you don't mind, now that we've agreed on an approach, I'm going to take this feature on. I think it's a pretty critical core feature to tuicr UX and I'd like to do a proper design exercise and think through how it works. I spent a little time reviewing codex's approach to it and I'm not super thrilled. I'll try to get it going tonight so it can unblock your agent-driven review workflow. |
|
That's perfectly fine @agavra! All I request is that make sure the service is exported/public so I can use it in a crate! |
Summary
Pivots the agentic review integration from a long-lived MCP server to a lightweight
tuicr reviewCLI, following the maintainer suggestion in the latest review discussion.tuicr review open --repo . --diff-source working-tree --json.tuicr review diff --session <id> --path <path> --max-lines <n>.tuicr review comment add --session <id> --path <path> --line <n> --side new --type issue --body "...".tuicr review file reviewed --session <id> --path <path> --set true.tuicr review export --session <id>andtuicr review clear --session <id>.tuicr::review_api::ReviewServiceas the public Rust API for external integrations.rmcp/tokiodependency additions.Design
The CLI is now the first-party agent integration surface. It uses the same shared review service as the public Rust API, so an external
tuicr-mcpor app package can either depend on the crate API or wrap the CLI without adding a protocol server to this repository.The persisted-session reload path preserves the originally opened file set. For example, opening a narrow review with
--path src/review_cli.rskeeps laterdiff,comment,export, andclearcommands scoped to that same loaded review instead of expanding to the full working tree.Validation
cargo fmtcargo checkcargo test review_clicargo testtarget/debug/tuicr review open --repo . --diff-source working-tree --path src/review_cli.rs --jsontarget/debug/tuicr review diff --session <id> --path src/review_cli.rs --max-lines 12target/debug/tuicr review comment add --session <id> --path src/review_cli.rs --line 2 --side new --type note --body "..."target/debug/tuicr review file reviewed --session <id> --path src/review_cli.rs --set truetarget/debug/tuicr review export --session <id>target/debug/tuicr review clear --session <id>