[Feature] Accept or discard reviewer changes from the CLI
It would be useful if olcli provided commands to programmatically accept or discard changes suggested by reviewers in an Overleaf project.
Currently, olcli can retrieve reviewer comments/changes, but workflows that process review feedback from the command line would benefit from being able to resolve the corresponding changes directly.
A possible interface could look like:
olcli changes list --status open --json <project_id>
olcli changes accept <change_id> <project_id>
olcli changes discard <change_id> <project_id>
Alternatively, if reviewer changes are represented as part of the comments/review API:
olcli comments accept-change <comment_id> <project_id>
olcli comments discard-change <comment_id> <project_id>
Ideally, the commands should:
- accept or discard a specific reviewer change using its ID;
- return a non-zero exit code if the operation fails;
- support
--jsonoutput for scripting and automation; - expose enough information through the existing
listcommand to associate a reviewer comment/change with the corresponding ID.
Motivation
This would make it possible to build automated review workflows around olcli. For example, an agent could:
- Retrieve open Overleaf comments and suggested changes.
- Inspect the corresponding LaTeX source.
- Propose a fix to the user.
- Wait for explicit user approval.
- Apply the modification locally.
- Accept or discard the corresponding reviewer change/comment through
olcli.
This would allow olcli to support human-in-the-loop workflows where an automated tool assists with reviewer feedback while the user retains control over which changes are accepted.
Thanks, this is a well-shaped request - the proposed surface reads like it was written against the existing commands rather than from scratch.
One correction to the premise, because it changes the size of the work: olcli reads comment threads, not tracked changes. The document join decodes ranges.comments and nothing reads ranges.changes, so there is no change id to accept or discard yet. olcli comments today has list, reply and resolve, and all three operate on threads. The first half of this is surfacing tracked changes at all, and olcli comments list is the natural place for it.
I am scheduling this for the October release and will look into the API side before committing to a surface. Accepting and discarding are mutations of someone else's review, so I want to understand what Overleaf actually exposes before designing around it.
The human-in-the-loop workflow you describe is the right motivation and matches where the comments commands were already heading.
This landed in v0.15.0.
As mentioned above, listing went into comments list rather than a separate changes list:
olcli comments list --changesadds tracked changes next to the threads, each with an id, kind, author, and position. With--jsonthe output becomes{ comments, changes }.olcli changes accept <ids...>andolcli changes reject <ids...>take those ids. Both exit non-zero if an id is unknown or the change is still there afterwards.rejectshows a diff and only writes with--yes, which should fit the approval step in your workflow. It is calledrejectrather thandiscardto match Overleaf's wording.
The MCP server has the same: include_changes on list_comments, plus accept_tracked_changes and reject_tracked_changes.
One limitation: track changes is an Overleaf premium feature, so only projects whose owner has a premium plan have any. Elsewhere the list is simply empty.
Thanks for the well-specified request. If anything misbehaves on real review rounds, reopen this or file a new issue.