Skip to content

v0.10.0 - Content-level diff, pull request CI

Choose a tag to compare

@aloth aloth released this 03 Sep 19:58
· 114 commits to main since this release

Added

olcli diff [project] [dir] (#45) - see what a push would actually change, not just which files.

push --dry-run answers which files; there was no way to see what changed inside them short of pulling into a scratch directory and running diff(1) by hand.

olcli diff                 # every changed file, as patches
olcli diff --name-only     # just the changed paths, with A/M/D prefixes
olcli diff --file main.tex # one file
olcli diff -U 8            # wider context
  • The remote side is fetched fresh on every run, and the command says so in --help and in its output footer. .olcli.json records remote paths, never remote contents, so there is no snapshot to compare against. Fetching fresh is also what makes the diff describe what a subsequent push will overwrite, which is the question the command exists to answer
  • Cost is one request, not one per file: downloadProject returns the whole project as a single archive, the same call pull and sync already make
  • a/ is the remote and b/ is local, so a + line is content push would upload and a - line is content it would overwrite
  • Binary files are reported as Binary files ... differ, detected by a NUL byte in the first 8000 bytes
  • Both sides pass through the same ignore layers, so a freshly pulled directory reports no differences instead of listing every .aux on Overleaf as a local deletion
  • Remote-only files are reported but flagged as untouched by a plain push, since only push --delete removes them

diff_project MCP tool - the same thing for AI assistants, so they can preview a push without shelling out to the CLI. Read-only. Returns one entry per changed file with path, status, binary and a unified patch, rather than one block of diff text, so an agent can filter by status without parsing output. name_only drops the patch text.

Pull request CI. The repository had no CI for pull requests; only the tag-triggered publish workflow existed, so a change was first executed by a machine other than the author's at release time. npm ci, lint, build and test now run on every pull request across Node 20.18.1 and 24, followed by a check that the build actually emitted its entry points.

A working npm run lint (#46). The script had been defined since the initial release with no eslint in devDependencies and no configuration, so it failed on every clean install.

Fixed

⚠️ Node 18 was never actually supported. olcli did not start on it at all: client.ts imports cheerio at module load, cheerio@1.2.0 depends on undici@7.x, and undici references File as a global, which Node exposes only from 20 onwards. The process died with ReferenceError: File is not defined before printing anything, including --version.

Published 0.9.1 declared engines: { node: ">=18" } while its own lockfile resolved dependencies declaring >=20.18.1. The manifest and the dependency tree contradicted each other, and installing on Node 18 produced a crash rather than an unsupported-version message.

engines is now >=20.18.1, the exact floor every undici release in the required range asks for. Node 18 reached end of life on 2025-04-30.

Changed

Local file scanning extracted into src/scan.ts. push and sync each carried their own copy of the same walk-and-filter loop and the two had already drifted; diff would have made a third.

push --dry-run now notes that its list is selected by modification time and points at olcli diff for content changes. The two commands answer different questions and will disagree: a file touched but not edited appears in one and not the other.

Upgrading

npm i -g @aloth/olcli@0.10.0   # or: brew upgrade olcli

Check your Node version first: node --version must report 20.18.1 or newer. On Node 18 the previous release did not run either, so nothing that worked before stops working.

No configuration changes. No existing command changes behaviour.

Contributors

Full changelog: https://github.com/aloth/olcli/blob/main/CHANGELOG.md