2025-10-28 11:14:35 -04:00
2025-10-28 11:14:35 -04:00
2025-10-28 11:14:35 -04:00
2025-10-28 11:14:35 -04:00
2025-10-28 11:14:35 -04:00
2025-10-28 11:14:35 -04:00
2025-10-28 11:14:35 -04:00

Onyx Python Helper

A Python-based command-line interface tool for interacting with Obsidian vaults. This tool allows you to manage your Obsidian notes directly from the terminal.

Installation

  1. Clone this repository
  2. Install dependencies:
pip install -r requirements.txt

Usage

Set Default Vault

First, you need to set up your vault with both its name and path:

# Set up a new vault with its path (required for first use)
ob-cli set-default "vault-name" --path "/path/to/vault"

# Print current default vault and its path
ob-cli print-default

# Switch to another existing vault (only works for already configured vaults)
ob-cli set-default "another-vault"

Open Notes

# Open a note in Obsidian
python src/obsidian_cli.py open "note-name"

# Open a note in specific vault
python src/obsidian_cli.py open "note-name" --vault "vault-name"

Daily Notes

# Create and open today's daily note
python src/obsidian_cli.py daily

# Create daily note in specific vault
python src/obsidian_cli.py daily --vault "vault-name"

Create/Update Notes

# Create a new note
python src/obsidian_cli.py create "note-name"

# Create note with content
python src/obsidian_cli.py create "note-name" --content "Your content here"

# Create note in specific vault
python src/obsidian_cli.py create "note-name" --vault "vault-name"

# Overwrite existing note
python src/obsidian_cli.py create "note-name" --content "New content" --overwrite

# Append to existing note
python src/obsidian_cli.py create "note-name" --content "Additional content" --append

# Create and open note
python src/obsidian_cli.py create "note-name" --content "content" --open

View Notes

# Print note contents
python src/obsidian_cli.py print-note "note-name"

# Print note from specific vault
python src/obsidian_cli.py print-note "note-name" --vault "vault-name"

Move/Rename Notes

# Move/rename a note
python src/obsidian_cli.py move "old-path" "new-path"

# Move in specific vault
python src/obsidian_cli.py move "old-path" "new-path" --vault "vault-name"

# Move and open note
python src/obsidian_cli.py move "old-path" "new-path" --open

Delete Notes

# Delete a note
python src/obsidian_cli.py delete "note-path"

# Delete from specific vault
python src/obsidian_cli.py delete "note-path" --vault "vault-name"

Frontmatter Management

# Edit frontmatter
python src/obsidian_cli.py frontmatter "note-name" --edit --key "tags" --value "project"
python src/obsidian_cli.py frontmatter "note-name" --edit --key "tags" --value "project,urgent"
python src/obsidian_cli.py frontmatter "note-name" --edit --key "status" --value "in-progress"

# View frontmatter
python src/obsidian_cli.py frontmatter "note-name" --view --key "tags"
python src/obsidian_cli.py frontmatter "note-name" --view --key "tags" --value "project"

# Clear frontmatter values
python src/obsidian_cli.py frontmatter "note-name" --clear --key "tags"
python src/obsidian_cli.py frontmatter "note-name" --clear --key "date,status,tags"

# Delete frontmatter keys
python src/obsidian_cli.py frontmatter "note-name" --delete --key "tags"
python src/obsidian_cli.py frontmatter "note-name" --delete --key "date,status,tags"

Features

The tool now includes all major features from the original Obsidian CLI tool:

  • Set and manage default vault
  • Open notes in Obsidian
  • Create and manage daily notes
  • Create/update notes with content
  • Print note contents
  • Move/rename notes (with automatic link updates)
  • Delete notes
  • Complete frontmatter management (edit, view, clear, delete)

Requirements

  • Python 3.7+
  • click
  • pyyaml

Development

Running Tests

To run the tests:

# Install test dependencies
pip install -r requirements.txt

# Run tests
python -m pytest

# Run tests with coverage report
python -m pytest --cov=src tests/

The test suite includes tests for:

  • Vault management
  • Note creation and modification
  • Frontmatter operations
  • Note movement and link updates
  • Daily notes
  • Platform-specific note opening
  • Note deletion
S
Description
CLI for interacting with Obsidian vaults from the terminal
Readme
19 MiB
0 Stars 1 Watchers 0 Forks
v0.4.3
Latest
2026-11-05 17:22:25 +01:00
Languages
Python 100%