Command-line tool for working with mdbase collections. Validates, queries, and performs CRUD operations on markdown document collections. Can also execute Obsidian .base files.
Requires Node.js 22+ and the mdbase library.
git clone https://github.com/callumalpass/mdbase.git
git clone https://github.com/callumalpass/mdbase-cli.git
cd mdbase && npm ci && cd ..
cd mdbase-cli && npm ci && npm run buildThe CLI is available as mdbase via the bin entry, or run directly with:
node dist/cli.jsmdbase <command> [options]
| Command | Description |
|---|---|
validate |
Validate documents against their type schemas |
query |
Query documents with filters and sorting |
read |
Read a single document by path or ID |
create |
Create a new document |
update |
Update an existing document |
delete |
Delete a document |
rename |
Rename a document |
types |
List or inspect registered types |
| Command | Description |
|---|---|
base run |
Execute an Obsidian .base file |
| Command | Description |
|---|---|
init |
Initialize a new mdbase collection |
lint |
Lint documents for common issues |
fmt |
Format document frontmatter |
export |
Export documents to CSV or JSON |
import |
Import documents from CSV or JSON |
graph |
Show link graph between documents |
stats |
Print collection statistics |
watch |
Watch for file changes and re-validate |
diff |
Show differences between document versions |
schema |
Generate or inspect type schemas |
Validate all documents in the current directory:
mdbase validate .Query documents of a given type:
mdbase query . --type note --where "status = published" --sort created --limit 10Execute an Obsidian .base file:
mdbase base run my-view.baseExport to CSV:
mdbase export . --type note --format csv -o notes.csvmdbase-cli implements the mdbase specification.
MIT