Skip to main content

Obsidian vault CLI via CouchDB/LiveSync — read, write, search, graph traversal, tags, properties

Project description

obsidian-vault-cli

PyPI Python 3.10+ MIT License

A Python CLI that gives agents (and humans) full access to an Obsidian vault synced via Self-hosted LiveSync (CouchDB) — without requiring Obsidian to be installed or running.

Part of the obsctl monorepo.

Install

pip install obsidian-vault-cli

Configure

vault config set vault.host obsidian.yourhost.com
vault config set vault.port 443
vault config set vault.protocol https
vault config set vault.database obsidian
vault config set vault.username admin
vault config set vault.password yourpassword

vault ping   # verify connection

Or use environment variables: VAULT_HOST, VAULT_PORT, VAULT_DATABASE, VAULT_USERNAME, VAULT_PASSWORD, VAULT_PROTOCOL.

Quick start

# Read
vault read --file "north star"
vault read --path "References/Person.md" --json

# Create
vault create --name "New Idea" --folder "References" --content "# Idea"

# Write (requires --force to overwrite)
vault write --path "References/Person.md" --content "..." --force
vault write --path "References/Person.md" --content "..." --diff   # preview only

# Search
vault search --query "agent loop" --context
vault search --query "TODO" --limit 10

# Graph traversal
vault backlinks --file "closedclaw"
vault links --file "closedclaw"
vault unresolved
vault orphans

# Tags & properties
vault tags --counts --sort count
vault properties --file "north star"
vault property:set --name "status" --value "active" --file "north star" --yes

# Delete (requires --yes in scripts)
vault delete --file "old note" --yes

Safety flags

All mutating commands support these flags — designed for safe agent operation:

Flag Behaviour
--force Skip existence guard, overwrite unconditionally
--yes Skip confirmation prompts (for scripts/agents)
--dry-run Print what would happen, do nothing
--diff Show unified diff of content change, do nothing
  • vault write refuses to silently overwrite existing notes without --force
  • vault create aborts if the note already exists
  • vault delete prompts for confirmation (defaults to No)
  • vault property:set shows current → new values before writing

All commands

Command Description
vault read Read note content
vault create Create new note
vault write Write/overwrite note
vault append Append to note
vault prepend Prepend to note
vault delete Soft-delete note
vault move Move note to new path
vault rename Rename note (same folder)
vault files List files
vault folders List folders
vault search Full-text search
vault backlinks Incoming wikilinks
vault links Outgoing wikilinks
vault unresolved Dead wikilinks
vault orphans Notes with no incoming links
vault tags List all tags
vault tag Notes with specific tag
vault properties Note frontmatter
vault property:read Read one property
vault property:set Set a property
vault property:remove Remove a property
vault templates List templates
vault template:read Read template
vault ping Test connectivity
vault config show Show config
vault config set Update config

Programmatic usage

from vault_cli.core.client import VaultClient

client = VaultClient(
    host="obsidian.yourhost.com",
    port=443,
    database="obsidian",
    username="admin",
    password="yourpassword",
    protocol="https"
)

note = client.read_note("north star.md")
client.write_note("References/New.md", "# New note")
results = client.search_notes("agent loop")

License

MIT

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

obsidian_vault_cli-0.2.1.tar.gz (37.7 kB view details)

Uploaded Source

Built Distribution

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

obsidian_vault_cli-0.2.1-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file obsidian_vault_cli-0.2.1.tar.gz.

File metadata

  • Download URL: obsidian_vault_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 37.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for obsidian_vault_cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 187101fd9343139be868b703fe9be8d67d71abb6b35c261f4325989fd63d79a6
MD5 92656efa2244a144118c7f17f22c45e4
BLAKE2b-256 8cc3dfa63aa50ec702c1e86d84246905cef3035137c9055e874d78c423c33ab6

See more details on using hashes here.

Provenance

The following attestation bundles were made for obsidian_vault_cli-0.2.1.tar.gz:

Publisher: cli-publish.yml on HarKro753/obsctl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obsidian_vault_cli-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for obsidian_vault_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 41a58493c03571225e432e5cb8de9700f83f2c6b4e1d07dfd4f12f6933ce7d6e
MD5 e35aaeea5bace3cc3be053746c086798
BLAKE2b-256 aaea90bddf2f1449bc274bc5054151087f511a2edf747343671349675a848611

See more details on using hashes here.

Provenance

The following attestation bundles were made for obsidian_vault_cli-0.2.1-py3-none-any.whl:

Publisher: cli-publish.yml on HarKro753/obsctl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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