Terminal

by polyipseity
5
4
3
2
1
Score: 79/100

Description

Category: Coding & Technical Tools

The Terminal plugin for Obsidian integrates powerful terminal functionality directly into your notes. It allows you to run external or integrated terminals, manage multiple terminal profiles, and provides an emulated developer console that works across all platforms. Features include terminal history saving, keyboard shortcuts for quick access, and the ability to customize terminal appearance. Users can also find text in the terminal, clear the terminal, and restart it. The plugin supports shell and terminal emulator profiles and offers various commands for a seamless terminal experience within Obsidian.

Reviews

  • theFoxCost
    Reviewed on Dec 26th, 2025
    ahh that let me use the AI cli tool directly

Stats

788
stars
241,913
downloads
84
forks
1,214
days
8
days
62
days
60
total PRs
9
open PRs
13
closed PRs
38
merged PRs
94
total issues
29
open issues
65
closed issues
64
commits

Latest Version

2 months ago

Changelog

3.23.0

Minor Changes

  • b66f9d4: Document and require Python 3.9 or above; use 3.9 for development (macOS ships 3.9 by default).
    • Update README badge and install instructions to state Python 3.9 or above.
    • Lower minimum Python version in plugin requirements (magic.ts) from 3.10 to 3.9 so the settings UI and checks reflect the same minimum.
    • Use Python 3.9 for development: .python-version, Pyright pythonVersion in pyproject.toml; runtime and requires-python remain 3.9 or above.
    • Add Python version sync notes in AGENTS.md and comments in pyproject.toml.

Patch Changes

  • e023673: Complete macOS Option key handling and migrate to public xterm.js API.

    • Add Option+Arrow word navigation
    • Add Option+Backspace/Delete word deletion
    • Replace internal _core.coreService.triggerDataEvent() with public terminal.input()
    • Fix Shift+Enter regression caused by attachCustomKeyEventHandler conflict
    • Consolidate all custom key handlers into MacOSOptionKeyPassthroughAddon

    (GH#106 by @janah01)

  • 58bda3d: Use Python 3.9-compatible type annotations in unix_pseudoterminal.py.

    Commit ab83e53 introduced from typing import Self (Python 3.11) and type[X] | None (Python 3.10) in a refactor. The plugin runs on the user's system Python, which on macOS defaults to 3.9.6 (Command Line Tools). Both Python 3.9 and 3.10 crash with ImportError at startup.

    Replace with from __future__ import annotations and forward-reference class name. Three lines changed, zero behavioral impact.

    (GH#107 by @janah01)

  • 3785050: Rename MacOSOptionKeyPassthroughAddon to CustomKeyEventHandlerAddon.

    The addon handles multiple custom key behaviors (macOS Option key passthrough, Shift+Enter, Option+Arrow/Backspace/Delete); the new name reflects its role as the single custom key event handler addon. The addon slot is renamed from macOptionKeyPassthrough to customKeyEventHandler. The macOSOptionKeyPassthrough setting (and its behavior) is unchanged.

README file from

Github

Terminal for Obsidian release Obsidian downloads Python

Integrate consoles, shells, and terminals inside Obsidian.

Buy Me a Coffee/embed

Repository · Changelog · Community plugin · Related · Features · Installation · Usage · Contributing · Security

Trailer

For first time users, read the installation section first!

This file is automatically opened on first install. You can reopen it in settings or command palette.

Features

  • Start external terminals from Obsidian.
  • Integrate terminals into Obsidian.
  • Has an emulated developer console usable on all platforms.
  • Supports multiple terminal profiles.
  • Has built-in keyboard shortcuts.
  • Automatically save and restore integrated terminal history.
  • Find in terminal.
  • Save terminal history as file.
  • Customize terminal appearance.

Installation

  1. Install plugin.
    • Community plugins
      1. Install the plugin from community plugins directly.
    • Manual
      1. Create directory terminal under .obsidian/plugins of your vault.
      2. Place manifest.json, main.js, and styles.css from the latest release into the directory.
    • Building (rolling)
      1. Clone this repository, including its submodules.
      2. Install bun. See https://bun.sh for installation.
      3. Run bun install in the root directory.
      4. Run bun run obsidian:install <vault directory> in the root directory.
    • Obsidian42 - BRAT (rolling)
  2. (optional for Windows, recommended) Install Python and dependencies.
    1. Install Python 3.9 or above.
    2. (Windows only) Run pip3 install psutil==5.9.5 pywinctl==0.0.50 typing_extensions==4.7.1.
    3. Configure Python executable in profile settings. Press the "Check" button to validate the Python configuration. Each profile needs to be configured separately.
  3. Enable plugin.
  4. (optional) Configure plugin settings.

Usage

  • To start a new external or integrated terminal
    • Ribbon
      1. Click on the Open terminal ribbon.
      2. Opens the default terminal if you have set up one. Otherwise, choose the desired profile.
    • Context menu
      1. Right-click on files, folders, or tab headers.
      2. Choose the desired action (and profile).
    • Command palette
      1. Press Ctrl+P or click on the Open command palette ribbon next to the left window border.
      2. Choose the desired action (and profile).
    • Select profile modal
      1. Choose the desired profile. Press Ctrl to edit the profile before use. The item (Temporary profile) starts a terminal with a temporary profile.
  • To save and restore integrated terminal history
    1. Keep the terminal open when exiting Obsidian.
    2. Terminal history will be restored next time Obsidian is opened.
  • Additional actions
    • Includes
      • Clear terminal: (1), (4)
      • Copy terminal: (1)
      • Edit terminal: (1)
      • Export, import, or edit settings: (2), (3)
      • Find in terminal: (1), (4)
      • Open documentation: (2), (3)
      • Restart terminal: (1)
      • Save terminal history: (1)
    • Available by
      • (1) Right-click on tab header/More options
      • (2) Open settings
      • (3) Open command palette
      • (4) Use keyboard shortcuts

Keyboard shortcuts

The keyboard shortcuts can be customized in hotkeys settings.

Global

  • Toggle focus on last terminal: Ctrl+Shift+`
    • Focus on last terminal: (unbound; useful if you want separate keys for focus and unfocus)

Terminal is focused

When a terminal is focused, other keyboard shortcuts (including Obsidian and plugin hotkeys) are disabled. Only the following keyboard shortcuts work. Thus you can ignore Obsidian complaining about conflicting keys for the following keyboard shortcuts.

  • Clear terminal: Ctrl+Shift+K, Command+Shift+K (Apple)
  • Close terminal: Ctrl+Shift+W, Command+Shift+W (Apple)
  • Find in terminal: Ctrl+Shift+F, Command+Shift+F (Apple)
  • Toggle focus on last terminal: Ctrl+Shift+` (same as above)
    • Unfocus terminal: (unbound; useful if you want separate keys for focus and unfocus)

Theming

Theming is possible. However, there is no user-friendly interface for now.

  1. Open the profile editing modal.
  2. Click on the Edit button labeled Data. It should open up a new modal in which there is a large textbox.
  3. Notice terminalOptions in the text area labeled Data. Refer to the xterm.js documentation (ITerminalOptions) to set the options. Nested objects may need to be used.
    • You can also configure global defaults via the plugin settings page (see Profile defaults). Those options act as a fallback for every profile unless a profile explicitly overrides them.
  4. Save the profile. Changes should apply immediately.

Profiles

This plugin comes with several profile presets that you can reference.

When setting up a terminal profile, you need to distinguish between shells and terminal emulators. (Search online if needed.) Generally, integrated profiles only work with shells while external ones only work with terminal emulators.

Examples

Shells

  • Bash: bash --login
  • Bourne shell: sh
  • Command Prompt: cmd
  • Dash: dash
  • Git Bash: <Git installation>\bin\bash.exe --login (e.g. C:\Program Files\Git\bin\bash.exe)
  • PowerShell Core: pwsh
  • Windows PowerShell: powershell
  • Windows Subsystem for Linux: wsl or wsl -d <distribution name>
  • Z shell: zsh --login

Terminal emulators

  • Command Prompt: cmd
  • GNOME Terminal: gnome-terminal
  • Konsole: konsole
  • Terminal (macOS): /System/Applications/Utilities/Terminal.app/Contents/macOS/Terminal "$PWD"
  • Windows Terminal: wt
  • iTerm2: /Applications/iTerm.app/Contents/MacOS/iTerm2 "$PWD"
  • xterm: xterm

Miscellaneous

This plugin patches require so that require("obsidian") and other Obsidian modules work in the developer console. It is toggleable as Expose internal modules in settings.

In the developer console, a context variable $$ is passed into the code, which can be used to dynamically change terminal options.

The full API is available from src/@types/obsidian-terminal.ts.

Troubleshooting

  • Is the plugin useful on mobile?
    • Compared to on desktop, it is much less useful. The only use for it for now is opening a developer console on mobile.
  • Why do hotkeys not work?
    • If the terminal is in focus, all Obsidian hotkeys are disabled so that you can type special characters into the terminal. You can unfocus the terminal by pressing Ctrl+Shift+`, then you can use Obsidian hotkeys again.

Contributing

Contributions are welcome!

Changesets

This project uses changesets to manage the changelog. When creating a pull request, please add a changeset describing the changes. Add multiple changesets if your pull request changes several things. End each changeset with ([PR number](PR link) by [author username](author link)). For example, the newly created file under the directory .changeset should look like:

---
"example": patch
---

This is an example change. ([GH#1](https://github.com/ghost/example/pull/1) by [@ghost](https://github.com/ghost))

Linting, Commit, and Hooks

This project uses the following tools to ensure code and commit quality:

  • ESLint: Linting for TypeScript/JavaScript. Run with bun run check (lint only) or bun run fix (auto-fix lint issues).
  • Prettier: Code formatting. Run with bun run format (format all files) or bun run format:check (check formatting only).
  • markdownlint: Lints Markdown files. Run with bun run markdownlint or auto-fix with bun run markdownlint:fix.
  • commitlint: Enforces conventional commit messages. Used automatically on commit via Husky.
  • husky: Manages Git hooks. Pre-commit runs lint-staged and pre-push runs commitlint.
  • lint-staged: Runs linters on staged files. Markdown files are auto-fixed before commit.

Lint-staged note: The lint-staged configuration (.lintstagedrc.mjs) invokes formatter/linter binaries directly (for example prettier --write, eslint --cache --fix, markdownlint-cli2 --fix) so that the list of staged files is passed through to the tool. Invoking these via bun run would prevent lint-staged from forwarding filenames and cause the tool to operate on its default glob (or the entire repo). Use bun run format to format the entire repository when needed.

To set up locally:

  1. Run bun install to install dependencies and set up hooks.
  2. On commit, staged Markdown files will be linted and auto-fixed.
  3. Commit messages are checked for conventional format.

You can manually run:

  • bun run check — lint all code (no formatting)
  • bun run fix — auto-fix lint issues (no formatting)
  • bun run format — format all code with Prettier
  • bun run format:check — check formatting with Prettier
  • bun run markdownlint — check all Markdown files
  • bun run markdownlint:fix — auto-fix Markdown files
  • bun run commitlint — check commit messages in range

Configuration files:

  • .eslintrc.* or eslint.config.mjs — ESLint rules
  • .prettierrc — Prettier rules
  • .prettierignore — Prettier ignore patterns
  • .markdownlint.jsonc — markdownlint rules
  • .commitlintrc.js — commitlint config
  • .husky/ — Git hooks

Testing

This repository uses Vitest for fast unit tests. Tests live under tests/ and should be named *.spec.ts or *.spec.js.

  • Run locally (non-interactive, coverage): bun run test (runs vitest run --coverage).
  • Run locally (interactive / watch): bun run test:watch.
  • Git hooks: The pre-push hook runs bun run test (see .husky/pre-push) and will block pushes if tests fail.

See vitest.config.mts for minimal config and further instructions.

Todos

The todos here, ordered alphabetically, are things planned for the plugin. There are no guarantees that they will be completed. However, we are likely to accept contributions for them.

  • Connect to remote shells.
  • Detect sandboxed environment and notify users.
  • External link confirmation.
  • Filter console log by severity in the developer console.
  • Indicate that the terminal resizer has crashed or is disabled.
  • Shared terminal tabs.
  • Vim mode switch.

Translating

See assets/locales/README.md.

Security

We hope that there will never be any security vulnerabilities, but unfortunately it does happen. Please report them!

Supported versions

Version Supported
rolling
latest
outdated

Reporting a vulnerability

Please report a vulnerability by opening an new issue. We will get back to you as soon as possible.

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Advanced Debug Mode
a year ago by mnaoumov
Obsidian plugin that enhances debugging experience.
Asciinema Player
4 months ago by Dinu Gherman
Asciinema player plugin to render asciicasts in Obsidian.
Command Line
a year ago by Steven Stallion
Copy command lines from your notes to the clipboard.
Console Markdown Plugin
3 years ago by Daniel Ellermann
An Obsidian plugin which renders console commands and their output.
GH Links Shortener
6 months ago by David Barnett
Obsidian plugin to set shortened link text for pasted GitHub URLs
GitHub Integration
a year ago by Kirill Zhuravlev
Plugin that fetch your github stars into notes
Gnome Terminal Loader
3 years ago by David Carmichael
HK Code Block
3 years ago by Heekang Park
Obsidian plugin developed by Heekang Park; Make code block looking good on reading view
Open in Terminal
4 months ago by ChenFeng
Open your vault in a new terminal window or launch Claude Code, Codex CLI, or Gemini CLI from Obsidian
Pieces for Developers
3 years ago by Pieces For Developers
Pieces' powerful extension for Obsidian-MD that allows users to access their code snippets directly within the Obsidian workspace
Plugin REPL
a year ago by readwithai
An in-note Read Evaluate Print Loop to execute JavaScript within Obsidian
Shell commands
5 years ago by Jarkko Linnanvirta
Execute system commands via hotkeys or command palette in Obsidian (https://obsidian.md). Some automated events are also supported, and execution via URI links.
YouTrack Fetcher
a year ago by Forketyfork
Obsidian plugin for creating notes out of YouTrack issues