Obsidian is a powerful and extensible knowledge base application that works on top of your local folder of plain text notes. This CLI tool (written in Go) will let you interact with the application using the terminal. You are currently able to open, search, move, create, update and delete notes.
You will need to have Scoop installed. On powershell run:
scoop bucket add scoop-yakitrak https://github.com/yakitrak/scoop-yakitrak.git
scoop install obsidian-cli
You will need to have Homebrew installed.
brew tap yakitrak/yakitrakbrew install yakitrak/yakitrak/obsidian-cliFor full installation instructions, see Mac and Linux manual.
# See All command instructions
obsidian-cli --helpDefines default vault for future usage. If not set, pass --vault flag for other commands. You don't provide the path to vault here, just the name.
obsidian-cli set-default "{vault-name}"Note: open and other commands in obsidian-cli use this vault's base directory as the working directory, not the current working directory of your terminal.
Prints default vault and path. Please set this with set-default command if not set.
obsidian-cli print-defaultOpen given note name in Obsidian. Note can also be an absolute path from top level of vault.
# Opens note in obsidian vault
obsidian-cli open "{note-name}"
# Opens note in specified obsidian vault
obsidian-cli open "{note-name}" --vault "{vault-name}"
Open daily note in Obsidian. It will create one (using template) if one does not exist.
# Creates / opens daily note in obsidian vault
obsidian-cli daily
# Creates / opens daily note in specified obsidian vault
obsidian-cli dauly --vault "{vault-name}"
Starts a fuzzy search displaying notes in the terminal from the vault. You can hit enter on a note to open that in Obsidian
# Searches in default obsidian vault
obsidian-cli search
# Searches in specified obsidian vault
obsidian-cli search --vault "{vault-name}"
Prints the contents of given note name in Obsidian.
# Prints note in default vault
obsidian-cli print "{note-name}"
# Prints note in specified obsidian
obsidian-cli print "{note-name}" --vault "{vault-name}"
Creates note (can also be a path with name) in vault. By default, if the note exists, it will create another note but passing --overwrite or --append can be used to edit the named note.
# Creates empty note in default obsidian and opens it
obsidian-cli create "{note-name}"
# Creates empty note in given obsidian and opens it
obsidian-cli create "{note-name}" --vault "{vault-name}"
# Creates note in default obsidian with content
obsidian-cli create "{note-name}" --content "abcde"
# Creates note in default obsidian with content - overwrite existing note
obsidian-cli create "{note-name}" --content "abcde" --overwrite
# Creates note in default obsidian with content - append existing note
obsidian-cli create "{note-name}" --content "abcde" --append
# Creates note and opens it
obsidian-cli create "{note-name}" --content "abcde" --open
Moves a given note(path from top level of vault) with new name given (top level of vault). If given same path but different name then its treated as a rename. All links inside vault are updated to match new name.
# Renames a note in default obsidian
obsidian-cli move "{current-note-path}" "{new-note-path}"
# Renames a note and given obsidian
obsidian-cli move "{current-note-path}" "{new-note-path}" --vault "{vault-name}"
# Renames a note in default obsidian and opens it
obsidian-cli move "{current-note-path}" "{new-note-path}" --openDeletes a given note (path from top level of vault).
# Renames a note in default obsidian
obsidian-cli delete "{note-path}"
# Renames a note in given obsidian
obsidian-cli delete "{note-path}" --vault "{vault-name}"Edits or creates a YAML frontmatter key in a note. The value is optional:
- If omitted and key is
tags, an empty list will be set: [] - If omitted for other keys, an empty string will be set: ""
Value (when provided) can be a YAML literal (string/number/bool), a sequence like [a, b], or a comma-separated list for tags.
# Add an empty tags key
obsidian-cli frontmatter edit "{note-name}" --key "tags"
# Add an empty custom key
obsidian-cli frontmatter edit "{note-name}" --key "status"
# Add multiple empty keys at once (comma-separated keys)
obsidian-cli frontmatter edit "{note-name}" --key "tags,status,reviewer"
# Set tags to a single tag
obsidian-cli frontmatter edit "{note-name}" --key "tags" --value "project"
# Set tags to multiple tags via comma-separated shorthand
obsidian-cli frontmatter edit "{note-name}" --key "tags" --value "project,urgent"
# Set an arbitrary key using YAML syntax
obsidian-cli frontmatter edit "{note-name}" --key "status" --value "in-progress"
# Specify a vault explicitly
obsidian-cli frontmatter edit "{note-name}" --vault "{vault-name}" --key "tags" --value "project"View a specific YAML frontmatter key from a note, or check if it matches/includes an expected value.
# View value of a frontmatter key (prints YAML/scalar)
obsidian-cli frontmatter view "{note-name}" --key "tags"
# Check whether a key matches/includes a value (prints true/false)
obsidian-cli frontmatter view "{note-name}" --key "tags" --value "project"
# Specify a vault explicitly
obsidian-cli frontmatter view "{note-name}" --vault "{vault-name}" --key "status"Clear the content/value of a frontmatter key, keeping the key present.
# Clear tags (becomes an empty list if it was a list; otherwise becomes empty string)
obsidian-cli frontmatter clear "{note-name}" --key "tags"
# Clear multiple keys (comma-separated)
obsidian-cli frontmatter clear "{note-name}" --key "date, status, tags"
# Clear multiple keys (bracketed list)
obsidian-cli frontmatter clear "{note-name}" --key "[date, status, tags]"Remove a frontmatter key entirely. If this was the last key, the whole frontmatter block is removed.
# Remove the tags key from frontmatter
obsidian-cli frontmatter remove "{note-name}" --key "tags"
# Remove multiple keys (comma-separated)
obsidian-cli frontmatter remove "{note-name}" --key "date, status, tags"
# Remove multiple keys (bracketed list)
obsidian-cli frontmatter remove "{note-name}" --key "[date, status, tags]"Fork the project, add your feature or fix and submit a pull request. You can also open an issue to report a bug or request a feature.
Available under MIT License
