mirror of
https://github.com/blamouche/obsidian-any-ai-code.git
synced 2026-07-22 06:53:38 +00:00
No description
| .github/workflows | ||
| .prompt-hub | ||
| tests | ||
| .gitignore | ||
| agents.md | ||
| CLAUDE.md | ||
| esbuild.config.mjs | ||
| main.js | ||
| main.ts | ||
| manifest.json | ||
| package-lock.json | ||
| package.json | ||
| pty-bridge.py | ||
| pty-proxy.js | ||
| README.md | ||
| runtime-utils.ts | ||
| styles.css | ||
| tsconfig.json | ||
| versions.json | ||
| vitest.config.ts | ||
Obsidian Any AI Code
Obsidian desktop plugin that opens your local Claude Code CLI in a right sidebar panel.
Goal
Use Claude Code directly inside your active Obsidian vault without leaving Obsidian.
Features
- Dedicated
Claude Codeview in the right sidebar - Embedded terminal (xterm)
- Quick actions:
Start,Stop,Restart,Clear - Launches Claude in the current active vault folder
- Visible UI status (
Status: ...) - Explicit runtime error messages in the panel
- Runtime fallbacks for macOS / Linux / Windows
Requirements
- Obsidian Desktop (
isDesktopOnlyplugin) - Node.js installed on the machine
- Claude Code CLI installed (
claudeavailable) - For advanced macOS/Linux fallback:
python3recommended
Install in a Vault
- Create the plugin folder:
mkdir -p "/PATH/TO/VAULT/.obsidian/plugins/obsidian-any-ai-code"
-
Copy the repository content into this folder (or use a symlink).
-
In that plugin folder, install runtime dependencies:
npm install --omit=dev
- Verify at least these files exist:
manifest.jsonmain.jsstyles.cssversions.jsonpty-proxy.jspty-bridge.pynode_modules/node-pty/...
- Enable the plugin in Obsidian:
Settings -> Community plugins
Usage
- Click the terminal ribbon icon, or run command:
Open Claude Code panel
- The panel opens on the right.
- Click
Startto launch Claude.
Plugin Settings
Command: command to run (default:claude)Auto-start: starts automatically when panel opensNode executable:auto(recommended): automatic detection- or 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:
- PTY via
node-pty - Python PTY bridge fallback (
pty-bridge.py) on macOS/Linux - Direct pipe fallback (
child_process) scriptfallback (last resort on Unix)
Status and logs clearly show the active strategy (proxy-warn, proxy-info, etc.).
Troubleshooting
command not found: claude
Claude binary is not in Obsidian process PATH.
- Set
Commandto an absolute path, for example:/Users/<you>/.local/bin/claude
- Or adjust your shell/Obsidian environment.
Cannot find module 'node-pty'
node-pty is not installed in the active vault plugin folder.
cd "/PATH/TO/VAULT/.obsidian/plugins/obsidian-any-ai-code"
npm install --omit=dev
posix_spawnp failed
Native PTY failed in the current runtime environment.
- Plugin should automatically fallback to Python/pipe mode.
- Ensure
python3is installed for Python PTY fallback.
Empty panel
- Ensure
main.jsandstyles.cssare up to date - Reload plugin (disable/enable)
- Open Obsidian developer console if needed
Local Development
npm install
npm run test
npm run build
npm run dev: esbuild watch modenpm run build: compilemain.ts->main.js
Test Stack
- Framework: Vitest
- Tests:
tests/**/*.test.ts - Commands:
npm run testnpm run test:watch
CI
GitHub Actions workflow: .github/workflows/ci.yml
Triggers:
pushpull_request
Steps:
npm cinpm run testnpm run build
Main Files
main.ts: Obsidian plugin logicmain.js: built distribution filestyles.css: terminal panel stylingmanifest.json: Obsidian plugin metadatapty-proxy.js: runtime proxy (Node)pty-bridge.py: Python PTY fallbackruntime-utils.ts: testable shared utilitiestests/runtime-utils.test.ts: unit tests
Platform Notes
- macOS/Linux: full support with Python PTY fallback
- Windows: support via
node-ptyor pipe fallback - Obsidian Mobile: not supported (
isDesktopOnly)
License
MIT