#notes #vaults #obsidian #vault #command-line #properties #database

app obsidian-cli

用于管理 obsidian 保险库、笔记和数据库的 CLI 工具

1 个不稳定版本

新功能 0.1.2 2024 年 8 月 23 日

23数据库实现 中排名 23

Download history 79/week @ 2024-08-17

79 次每月下载

MIT 许可协议

42KB
997

Obsidian CLI

从命令行管理您的 obsidian 保险库、笔记和数据库

Obsidian CLI Demo

功能

  • 从命令行创建、编辑和阅读笔记
  • 查看和导出笔记的属性
  • 即将推出:使用 SQL 查询您的保险库和数据库文件夹

命令

笔记

Commands for interacting with individual notes

Usage: obx notes
       obx notes <COMMAND>

Commands:
  view        Output the raw markdown contents of a note
  open        Open a note in the Obsidian app
  uri         Print the Obsidian URI of a note
  create      Create a new note
  edit        Open a note in your default editor ($EDITOR)
  path        Print the full file-path of the note
  properties  View the properties of a note
  help        Print this message or the help of the given subcommand(s)

用法

# Print a note
> obx notes view simple-note

# Notes commands all accept a --vault specifier
> obx notes view from-another-vault --vault=secondary

> obx notes create new-note

# Edit a note in $EDITOR
> obx notes edit simple-note

# Open the note in Obsidian.app
> obx notes open simple-note

# Print the obsidian:// uri for the note
> obx notes uri simple-note

# Print the absolute path to a note
> obx notes path simple-note

# Print the properties of a note in a table
> obx notes properties with-fm-properties

# Print properties as JSON
> obx notes properties with-fm-properties -f json

保险库

Commands for interacting with vaults

Usage: obx vaults
       obx vaults <COMMAND>

Commands:
  create   Create a new vault and switch to it. The name will be inferred from the last segment unless --name is explicitly provided
  list     List all vaults
  switch   Set a vault as current, to be implicitly used by commands. A vault can be explicitly provided, or chosen interactively
  current  Print the name and path of the current vault
  path     Print the absolute path to the current vault
  help     Print this message or the help of the given subcommand(s)

# Create a new vault called "new-vault"
> obx vaults create path/to/new-vault

# Explicitly name a vault
> obx vaults create path/to/new-vault --name another-vault

# Print a table of vaults
> obx vaults list

# Print the vaults as JSON
> obx vaults list -f json

# Interactively switch vaults
> obx vaults switch

# Switch to a named vault
> obx vaults switch secondary

# Print information about the current vault
> obx vaults current

# Print the absolute path to the current vault
# Useful for combining, e.g. tree $(obx vaults path)
> obx vaults path

路线图

  • 保险库内文件模糊搜索
  • 命令行中笔记的漂亮渲染
    • 找到支持所有我预期特性的 Markdown 渲染器有些棘手,所以目前我建议使用其他工具,例如 glow,例如 obx notes view my-note | glow
  • 使用 SQL 查询保险库
    • 跨保险库查询笔记
    • 查询“数据库文件夹”
  • 从命令行运行 dataview 查询

依赖关系

~11–21MB
~311K SLoC