Skip to main content

A small CLI for reading and writing notes in a local Obsidian vault.

Project description

odcli

odcli is a command-line tool for reading and writing notes in a local Obsidian vault.

It works directly on Markdown files inside the vault, so you can use it without any private Obsidian API.

Install

From PyPI:

pip install odcli

Or with uv:

uv tool install odcli

After installation, both command names are available:

odcli --help
obsidian-cli --help

Quickstart

If your vault is already in a common location, odcli can usually find it automatically:

odcli check
odcli list

If you want to set the vault explicitly:

export OBSIDIAN_VAULT="/path/to/MyVault"
odcli check

You can also override the vault per command:

odcli --vault "/path/to/MyVault" list

Remote Vault over SSH

You can operate on an Obsidian vault stored on another machine over SSH.

Example:

odcli \
  --ssh-host your-server \
  --ssh-user your-user \
  --vault /path/to/ObsidianVault \
  list

Read a remote note:

odcli \
  --ssh-host your-server \
  --ssh-user your-user \
  --vault /path/to/ObsidianVault \
  read Inbox/today.md

Write a remote note:

odcli \
  --ssh-host your-server \
  --ssh-user your-user \
  --vault /path/to/ObsidianVault \
  write Inbox/today.md --content "# Remote note"

Optional SSH flags:

  • --ssh-port
  • --ssh-identity

In SSH mode, --vault or OBSIDIAN_VAULT should point to the remote vault path.

Common Commands

Read a note:

odcli read Inbox/today.md

Read specific lines:

odcli read-lines Inbox/today.md 3 8

Create or overwrite a note:

odcli write Inbox/today.md --content "# Today"

Replace a line range:

odcli write-lines Inbox/today.md 3 4 --content "- replaced\n- lines\n"

Append content:

odcli append Inbox/today.md --content "\n- new item"

Search across the vault:

odcli search "project alpha"

Skill Install

odcli can install helper skills for local coding tools.

Install into Codex:

odcli plugin install codex-skill

Install into Claude Code:

odcli plugin install claude-skill

Install both:

odcli plugin install all-skills

Installed paths:

  • Codex: ~/.codex/skills/odcli/SKILL.md
  • Claude Code: ~/.claude/skills/odcli/SKILL.md

Vault Discovery

Resolution priority:

  1. --vault /path/to/vault
  2. OBSIDIAN_VAULT
  3. The most recently opened vault recorded by local Obsidian config
  4. Common default directories

Built-in default locations:

  • macOS: ~/Documents/Obsidian Vault
  • macOS: ~/Documents/Obsidian
  • macOS iCloud: ~/Library/Mobile Documents/iCloud~md~obsidian/Documents
  • Windows: %USERPROFILE%\\Documents\\Obsidian Vault
  • Windows: %USERPROFILE%\\Documents\\Obsidian

Command Summary

check

Validate that the vault exists and report whether .obsidian is present.

list

List Markdown notes in the vault.

Optional arguments:

  • --limit N

read

Read a note.

Arguments:

  • note_path: path relative to the vault root

write

Overwrite a note. Parent directories are created automatically if needed.

Arguments:

  • note_path
  • --content TEXT
  • --stdin

Optional arguments:

  • --create-only

read-lines

Read a line range. Line numbers are 1-based and inclusive.

Arguments:

  • note_path
  • start_line
  • end_line

write-lines

Replace a line range. Line numbers are 1-based and inclusive.

Arguments:

  • note_path
  • start_line
  • end_line
  • --content TEXT
  • --stdin

append

Append content to the end of a note.

Arguments:

  • note_path
  • --content TEXT
  • --stdin

search

Search across all Markdown notes in the vault.

Arguments:

  • query
  • --case-sensitive

Global Options

  • --vault
  • --ssh-host
  • --ssh-user
  • --ssh-port
  • --ssh-identity

For Developers

Run from source:

cd path/to/obsidian_cli
uv sync
uv run odcli --help

Run tests:

cd path/to/obsidian_cli
uv run python -m unittest discover -s tests

Build distributions:

cd path/to/obsidian_cli
uv build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odcli-0.1.7.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odcli-0.1.7-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file odcli-0.1.7.tar.gz.

File metadata

  • Download URL: odcli-0.1.7.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for odcli-0.1.7.tar.gz
Algorithm Hash digest
SHA256 37ba6b9bb604694be46e53ccd4f1f30c238ecceb6073dfe4d295c8394d22fa4d
MD5 4f8c5f78c34e2fa307fa0d47ed4080da
BLAKE2b-256 bf3f12fac89913ed9d44b9802c82658583894dd446e903960681743b8979bd00

See more details on using hashes here.

File details

Details for the file odcli-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: odcli-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for odcli-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3da9c91dc42a5852e9799144d45eed2f2fc9e03eb776c41e6f9d83a8ebe9c36b
MD5 e4991acb5e6857b49b0bdd1bf1eeab40
BLAKE2b-256 c8367baaa3febf487d3a5f0b7e211558a0e033ddf9224f6f8114eb98f0a5c034

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page