No description
Find a file
blamouche df937afe45 Trim release standalone assets to the 5 files that actually matter
After auditing each file, classified them by whether the plugin can
start without them:

- Required (panel will not start): manifest.json, main.js, pty-proxy.js
- Recommended (panel loads but degraded): styles.css, pty-bridge.py
- Optional (only inside zip): versions.json (backwards-compat install
  matching only, not runtime), package.json + package-lock.json
  (only needed for the optional `npm install --omit=dev` native
  node-pty backend)

The release workflow now attaches only the five Required + Recommended
files as standalone assets next to the zip. The other three remain
bundled in the zip so users opting into native node-pty still get them
in one shot, but they don't clutter the release page as if they were
load-bearing.

Reworked the release notes body and the README `Required files`
section to lead with this Required/Recommended/Optional split instead
of presenting every file as "indispensable".

Bumped manifest/version metadata to 0.1.44.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 08:58:13 +02:00
.github/workflows Trim release standalone assets to the 5 files that actually matter 2026-04-27 08:58:13 +02:00
.prompt-hub Trim release standalone assets to the 5 files that actually matter 2026-04-27 08:58:13 +02:00
img Add project banner to the top of the README 2026-04-26 07:14:59 +02:00
tests Add @Active folder button to insert parent folder mention 2026-04-26 07:50:35 +02:00
.gitignore Translate README to English and finalize plugin runtime/test setup 2026-03-05 09:27:44 +01:00
agents.md Install/update prompt-hub 0.4.6 (domains: app-development.md) 2026-03-13 16:44:12 +01:00
CLAUDE.md Install/update prompt-hub 0.4.6 (domains: app-development.md) 2026-03-13 16:44:12 +01:00
esbuild.config.mjs Translate README to English and finalize plugin runtime/test setup 2026-03-05 09:27:44 +01:00
eslint.config.mjs Drop CLIs and Claude Code from descriptions to clear sentence-case flags 2026-04-26 14:44:58 +02:00
LICENSE Align plugin with Obsidian community submission guidelines 2026-04-26 08:24:41 +02:00
main.js Drop parens around No runtime configured to satisfy bot scanner 2026-04-27 08:43:13 +02:00
main.ts Drop parens around No runtime configured to satisfy bot scanner 2026-04-27 08:43:13 +02:00
manifest.json Trim release standalone assets to the 5 files that actually matter 2026-04-27 08:58:13 +02:00
package-lock.json Trim release standalone assets to the 5 files that actually matter 2026-04-27 08:58:13 +02:00
package.json Trim release standalone assets to the 5 files that actually matter 2026-04-27 08:58:13 +02:00
pty-bridge.py Set PTY size explicitly in python bridge fallback 2026-03-13 23:37:40 +01:00
pty-proxy.js Fix node-pty crash by making native dep optional in proxy 2026-04-25 09:26:52 +02:00
README.md Trim release standalone assets to the 5 files that actually matter 2026-04-27 08:58:13 +02:00
runtime-utils.ts Add eslint-plugin-obsidianmd and resolve every recommended-rule violation 2026-04-26 14:20:53 +02:00
styles.css Add blue highlight accent for @Active file and @Active folder buttons 2026-04-26 07:51:49 +02:00
tsconfig.json Translate README to English and finalize plugin runtime/test setup 2026-03-05 09:27:44 +01:00
versions.json Trim release standalone assets to the 5 files that actually matter 2026-04-27 08:58:13 +02:00
vitest.config.ts Translate README to English and finalize plugin runtime/test setup 2026-03-05 09:27:44 +01:00

Any AI CLI

Any AI CLI

Run any local AI coding CLI — Claude, Codex, or your own — inside a right sidebar terminal in Obsidian.

The plugin embeds a real PTY-backed terminal in the sidebar and lets you declare an unlimited list of CLI runtimes from settings (each with a display name and a launch command). Pick one from a dropdown to start it in your active vault folder, switch between them on the fly, and inject the active file or folder as a mention with one click.

Features

  • Dedicated sidebar view with an embedded xterm terminal.
  • Customizable runtime list — declare any number of CLI runtimes from settings (Claude and Codex are pre-populated; add Aider, custom wrappers, anything on PATH) and switch between them via a sidebar dropdown.
  • One-click @active file and @active folder buttons that insert the current note path (or its parent folder) as a mention in the running CLI's stdin.
  • Process controls in the toolbar: Start, Stop, Restart, Clear.
  • Launches the selected runtime in the current active vault folder so the AI sees your notes as the working tree.
  • Resilient PTY stack with multi-tier fallbacks (node-pty → Python PTY bridge → direct pipe → script) so it works on macOS, Linux, and Windows.
  • Visible runtime status (Status: ...) and clear error reporting in the panel.

Requirements

  • Obsidian Desktop 1.7.2 or newer (isDesktopOnly plugin).
  • Node.js available on the machine.
  • At least one AI coding CLI installed on PATH (e.g. claude, codex, aider).
  • For the Python PTY fallback on macOS/Linux: python3 recommended.

Install in a Vault

  1. Open the latest release.

  2. Download any-ai-cli-<version>.zip.

  3. Unzip it directly inside your vault's plugin folder so the resulting path is:

    /PATH/TO/VAULT/.obsidian/plugins/any-ai-cli/
    
  4. In Obsidian, enable the plugin: Settings → Community plugins → Installed plugins → Any AI CLI.

That's it. No commands required — the plugin uses an embedded Python PTY bridge fallback so it works out of the box on macOS / Linux (and falls back to direct pipe mode on Windows).

Optional — install the native PTY backend for best terminal fidelity

The bundle ships without node-pty (a native module that has to be compiled for your specific Node ABI). The plugin works without it, but installing it gives you a fully native PTY (better full-screen TUI rendering and resize behavior). To enable it:

cd "/PATH/TO/VAULT/.obsidian/plugins/any-ai-cli"
npm install --omit=dev

Reload the plugin afterwards.

Manual install / dev clone

  1. Clone or copy the repository into /PATH/TO/VAULT/.obsidian/plugins/any-ai-cli/.
  2. Run npm install and npm run build inside the folder to produce main.js.
  3. Enable the plugin in Settings → Community plugins.

Required files

This plugin spawns a child process for the embedded terminal, so it needs more than the usual main.js / manifest.json / styles.css triple. The bundled release zip already contains everything in the right layout — this list is only useful if you assemble the plugin folder by hand or hot-swap a single file from the GitHub release.

Required — the plugin will not start without them:

  • manifest.json — Obsidian plugin metadata (id, version, minAppVersion).
  • main.js — bundled plugin code.
  • pty-proxy.js — Node child process that runs your CLI inside a PTY. Without it, every Start throws Missing proxy script.

Recommended — the plugin loads without them but the experience is degraded:

  • styles.css — sidebar / toolbar / dropdown styling. Without it, the panel renders with raw browser defaults.
  • pty-bridge.py — Python PTY fallback used on macOS/Linux when node-pty is not installed. Without it the proxy falls through to a plain pipe, which renders full-screen TUIs poorly.

These five are attached individually to each GitHub release alongside the zip, so you can replace one without re-downloading the whole bundle.

Optional — only inside the zip:

  • versions.json — used by Obsidian to find a backwards-compatible plugin version when the current minAppVersion is too high for the user's app; not used at runtime.
  • package.json, package-lock.json — needed only if you opt into the native node-pty backend via npm install --omit=dev.

Usage

  1. Click the bot ribbon icon, or run the command palette entry Open panel, to reveal the panel on the right.
  2. Use the runtime dropdown on the first toolbar row to pick which CLI to launch (Claude, Codex, or any custom entry you added).
  3. Click Start to launch the selected runtime in the active vault folder.
  4. While the CLI is running:
    • Click @active file or @active folder (second toolbar row) to insert the current note path or its parent folder as a mention.
    • Click Restart to relaunch, Stop to terminate, Clear to wipe the terminal output.
  5. Switching the dropdown to another runtime while a process is running automatically restarts it on the new CLI (configurable in settings).

Plugin Settings

General:

  • Default runtime — which configured runtime is selected when the panel opens (and used by auto-start).
  • Auto-start — start the default runtime automatically when the panel opens.
  • Auto-restart on runtime switch — when you change the runtime from the sidebar dropdown while a process is running, restart it immediately to apply the new selection.

Runtimes section (the customizable list of CLIs shown in the sidebar dropdown):

  • Each entry holds a display name and a launch command. Examples:
    • Claudeclaude
    • Codexcodex --no-alt-screen -c check_for_update_on_startup=false ...
    • Aideraider --model openrouter/...
  • Add as many entries as you need with Add runtime. Remove unused ones via the trash icon (the list must keep at least one entry).
  • Claude and Codex are pre-populated on first install. Old command / codexCommand settings from earlier versions are migrated automatically.

Advanced:

  • Node executable — path to the Node binary used to run the PTY proxy. Leave as auto for automatic detection, or override with an explicit path (/opt/homebrew/bin/node, C:\Program Files\nodejs\node.exe, etc.).

Runtime Architecture (Fallback Chain)

The plugin tries multiple strategies to maximize startup success:

  1. PTY via node-pty
  2. Python PTY bridge fallback (pty-bridge.py) on macOS/Linux
  3. Direct pipe fallback (child_process)
  4. script fallback (last resort on Unix)

Status and logs clearly show the active strategy (proxy-warn, proxy-info, etc.).

Troubleshooting

command not found: <cli>

The CLI binary is not in Obsidian's process PATH. Either:

  • Edit the runtime entry in settings and set the Launch command to an absolute path, for example /Users/<you>/.local/bin/claude or /opt/homebrew/bin/codex.
  • Or adjust your shell/Obsidian environment so the CLI resolves on PATH.

Cannot find module 'node-pty'

Since 0.1.25, this no longer crashes the plugin — node-pty is optional and the proxy automatically falls back to the Python bridge (or direct pipe). If you want the native PTY backend anyway:

cd "/PATH/TO/VAULT/.obsidian/plugins/any-ai-cli"
npm install --omit=dev

posix_spawnp failed

Native PTY failed in the current runtime environment.

  • Plugin should automatically fallback to Python/pipe mode.
  • Ensure python3 is installed for Python PTY fallback.

Empty panel

  • Ensure main.js and styles.css are up to date
  • Reload plugin (disable/enable)
  • Open Obsidian developer console if needed

Local Development

npm install
npm run lint
npm run test
npm run build
  • npm run dev: esbuild watch mode
  • npm run build: compile main.ts -> main.js
  • npm run lint: run eslint-plugin-obsidianmd so violations of the Obsidian community-store guidelines are caught locally before submission

Test Stack

  • Framework: Vitest
  • Tests: tests/**/*.test.ts
  • Commands:
    • npm run test
    • npm run test:watch

CI

GitHub Actions workflow: .github/workflows/ci.yml

Triggers:

  • push
  • pull_request

Steps:

  1. npm ci
  2. npm run lint
  3. npm run test
  4. npm run build

Release

GitHub Actions workflow: .github/workflows/release.yml

Triggered by pushing a git tag (e.g. 0.1.25):

git tag 0.1.25
git push origin 0.1.25

The workflow:

  1. Checks out the repo and runs npm ci + npm run build.
  2. Stages every runtime-required file (manifest.json, main.js, styles.css, versions.json, pty-proxy.js, pty-bridge.py, package.json, package-lock.json) into an any-ai-cli/ folder.
  3. Zips it as any-ai-cli-<tag>.zip for one-click install.
  4. Publishes a GitHub Release attaching the zip plus standalone main.js / manifest.json / styles.css (for Obsidian's plugin update protocol and BRAT).
  5. Auto-generates release notes from the commit history.

Before tagging, keep these versions in sync: manifest.json, versions.json, package.json.

Main Files

  • main.ts: Obsidian plugin logic
  • main.js: built distribution file
  • styles.css: terminal panel styling
  • manifest.json: Obsidian plugin metadata
  • pty-proxy.js: runtime proxy (Node)
  • pty-bridge.py: Python PTY fallback
  • runtime-utils.ts: testable shared utilities
  • tests/runtime-utils.test.ts: unit tests

Platform Notes

  • macOS/Linux: full support with Python PTY fallback
  • Windows: support via node-pty or pipe fallback
  • Obsidian Mobile: not supported (isDesktopOnly)

License

MIT