VS Code and Cursor extension
Twain ships an extension for VS Code, Cursor, and other VS Code-compatible editors. It opens the file you are editing in the Twain app, and runs the checker so results appear in the Problems panel.
The extension is built but not yet on any marketplace. For now, install it from a packaged VSIX (see below). It also relies on the CLI, which is not yet published either, so you will need to point it at the CLI from a checkout.
Commands
Open the command palette and search for these (all under the Twain category), or use the editor and Explorer context menus:
| Command | What it does |
|---|---|
| Open in Twain | Opens the current file in the Twain macOS app, rendered. macOS only. |
| Show Changes in Twain | Opens the current file in the Twain app with its changes marked against the last saved version. See Showing changes. macOS only. |
| Check with Twain | Runs the checker and shows the findings in the Problems panel. Saves the file first if needed. |
| Clear Twain Diagnostics | Removes the findings this extension added. |
Open in Twain hands the file to the app with macOS open, using the configured app path
or, when that path does not exist, the bundle identifier md.twain-md.app. Show Changes in
Twain asks the app to open the file through its twain-md:// URL scheme instead. On the
Mac App Store edition, the sandbox only lets the app open a file it has already been granted
access to, so handing it a file through the URL scheme works best for files inside a folder you
have opened in Twain. The direct download has no such restriction. See Editions.
Findings in the Problems panel
Check with Twain runs the CLI's check and turns each finding into a Problems-panel entry:
warnings appear as warnings, informational findings as information, each labelled with its kind. You
can turn on Check on Save in the settings to run it automatically every time you save.
Settings
| Setting | Default | Purpose |
|---|---|---|
twain-md.appPath | /Applications/Twain.app | Where the app is installed |
twain-md.cliPath | (empty) | Path to the CLI; needed while the CLI is unpublished |
twain-md.nodePath | node | Node.js used to run the CLI |
twain-md.checkOnSave | false | Run the checker on every save |
twain-md.strict | false | Pass --strict to the checker |
twain-md.checkRemoteLinks | false | Pass --remote to the checker |
twain-md.componentMap | (empty) | A component map; otherwise auto-detected |
Because the CLI is not yet on your PATH, set twain-md.cliPath to cli/twain-md.mjs in a
Twain checkout. The extension will remind you if it cannot find the CLI.
Installing from a VSIX
cd editors/vscode
npx @vscode/vsce package
code --install-extension twain-md-vscode-0.1.0.vsix
In Cursor, use Extensions: Install from VSIX and pick the packaged file.