oh-my-twin-cli
v0.4.84
Published
Wrapper that installs the omtw (oh-my-twin) coding agent CLI binary on demand.
Maintainers
Readme
oh-my-twin-cli
Tiny npm wrapper that installs the omtw (oh-my-twin) coding agent CLI.
The wrapper is a few kilobytes. On npm install -g oh-my-twin-cli, the postinstall step downloads the prebuilt omtw binary from the v0.4.80 GitHub Release, SHA-256-verifies it, and places it at ~/.omtw/omtw[.exe]. The omtw command on your PATH is a Node shim that spawns the binary, after first triggering a fast (TTL-gated) sync that makes twinRouter the single source of truth for omtw's model catalog, base URL, and API key.
Note: the wrapper version (oh-my-twin-cli) and the omtw (binary) version are independent. The wrapper is the one in package.json; the omtw binary version is the GitHub Release tag that the postinstall fetches (OMTW_VERSION in install.js).
Install
npm install -g oh-my-twin-cli
omtw --version # -> omtw/16.0.1Windows users on PowerShell: the same two commands work; npm generates omtw.cmd automatically.
Auto-sync with twinRouter
Before spawning the omtw binary, the omtw shim triggers a fast (TTL-gated) sync that:
- Reads twinRouter's local SQLite database (
%APPDATA%/twinrouter/db/data.sqlite) to discover the active API key +mitmRouterBaseUrl. - Fetches the live
/v1/modelscatalog. - Writes
~/.omtw/agent/models.ymland~/.omtw/.env.
This means twinRouter is the single source of truth for omtw's model catalog — no hand-maintained YAML, no drift.
For manual control, use omtw-sync:
omtw-sync # sync (idempotent, TTL-gated)
omtw-sync --force # bypass TTL, force re-sync
omtw-sync --verbose # print what changed
omtw-sync --check # exit 0 if in sync, 1 otherwiseHow it works
install.js(postinstall) downloadsomtw.exe(Windows) or the appropriateomtw-<os>-<arch>.tar.gz(macOS / Linux) from the GitHub Release, verifies SHA-256, and writes to~/.omtw/.bin/omtw.jsis a 50-line spawner. It does not need to be in the binary's directory; it just resolves~/.omtw/omtw, runs the sync (see above), and forwards all args.- Re-running
npm install -g oh-my-twin-cliis idempotent: if the binary is already at the expected path with the expected hash, the download is skipped.
Uninstall
npm uninstall -g oh-my-twin-cli
rm -rf ~/.omtw # optional, removes the downloaded binaryLicense
MIT. See LICENSE.
