Skip to content

enixCode/obsidian-cli

Repository files navigation

Obsidian CLI

Embed a full interactive terminal inside Obsidian. Run shell commands, REPLs (Node, Python), and CLI tools without leaving your vault.

Desktop-only. Uses node-pty + xterm.js.

Features

  • Full PTY terminal (not just piped output) — interactive programs work
  • Opens at the bottom of the editor, like VS Code
  • Toggle with a customizable hotkey or the ribbon icon
  • Follows your Obsidian theme automatically (light/dark)
  • Configurable shell path, working directory, and font size

Installation

From Community Plugins (recommended)

  1. Open Settings > Community plugins
  2. Search for Obsidian CLI
  3. Install and enable

Manual

  1. Download main.js, manifest.json, styles.css, pty-host.js from the latest release
  2. Create folder: <vault>/.obsidian/plugins/obsidian-cli/
  3. Copy the downloaded files into that folder
  4. Also copy the node_modules/node-pty/ directory from the release
  5. Reload Obsidian and enable the plugin

Usage

  • Click the terminal icon in the left ribbon, or
  • Open command palette and run Toggle terminal
  • Assign a hotkey in Settings > Hotkeys (search "Toggle terminal")

Settings

Setting Description Default
Shell path Shell executable to use cmd.exe (Win) / /bin/bash (Mac/Linux)
Working directory Starting directory Vault root
Font size Terminal font size in px 14

Architecture

The plugin runs node-pty in a separate Node.js process (pty-host.js) because Obsidian's Electron renderer doesn't support Worker threads. Communication happens via JSON over stdin/stdout.

Development

npm install
npm run dev    # watch mode
npm run build  # production build
npm run lint   # eslint

License

0-BSD

About

Embed a full interactive terminal. Run shell commands, AI coding agents, vim, python REPL and more.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors