Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:23:29 +08:00
commit de569d33fc
8 changed files with 808 additions and 0 deletions

36
commands/auth.md Normal file
View File

@@ -0,0 +1,36 @@
---
description: Validate Obsidian API authentication
---
Verify that the API key is valid and authentication is working.
## Usage
```bash
obsidian-search-tool auth [--json|--text] [-v|-vv|-vvv]
```
## Options
- `--json`: JSON output (default)
- `--text` / `-t`: Markdown text output
- `-v`: INFO level logging
- `-vv`: DEBUG level logging
- `-vvv`: TRACE level with library internals
## Examples
```bash
# Basic auth check
obsidian-search-tool auth
# With text output
obsidian-search-tool auth --text
# With debug logging
obsidian-search-tool auth -vv
```
## Output
Returns authentication status, API URL, timestamp, and message.

34
commands/completion.md Normal file
View File

@@ -0,0 +1,34 @@
---
description: Generate shell completion script
argument-hint: bash|zsh|fish
---
Generate shell completion scripts for bash, zsh, or fish.
## Usage
```bash
obsidian-search-tool completion SHELL
```
## Arguments
- `SHELL`: Shell type (bash, zsh, or fish)
## Examples
```bash
# Generate bash completion
eval "$(obsidian-search-tool completion bash)"
# Install zsh completion permanently
echo 'eval "$(obsidian-search-tool completion zsh)"' >> ~/.zshrc
# Install fish completion
mkdir -p ~/.config/fish/completions
obsidian-search-tool completion fish > ~/.config/fish/completions/obsidian-search-tool.fish
```
## Output
Outputs shell-specific completion script to stdout.

43
commands/search.md Normal file
View File

@@ -0,0 +1,43 @@
---
description: Search vault with Dataview DQL or JsonLogic
argument-hint: query
---
Search Obsidian vault using Dataview DQL TABLE queries or JsonLogic.
## Usage
```bash
obsidian-search-tool search QUERY [--type dataview|jsonlogic] [--json|--text|--table] [-v|-vv|-vvv]
obsidian-search-tool search --stdin [OPTIONS]
```
## Arguments
- `QUERY`: Search query (required, or use --stdin)
- `--type`: Query type - dataview (default) or jsonlogic
- `--stdin` / `-s`: Read query from stdin
- `--json`: JSON output (default)
- `--text` / `-t`: Markdown text output
- `--table`: Pretty-printed table output
- `-v/-vv/-vvv`: Verbosity (INFO/DEBUG/TRACE)
## Examples
```bash
# Dataview TABLE query
obsidian-search-tool search 'TABLE file.name FROM "daily" LIMIT 5'
# JsonLogic content search
obsidian-search-tool search --type jsonlogic '{"in": ["Claude", {"var": "content"}]}'
# From stdin
echo 'TABLE file.name WHERE file.size > 1000' | obsidian-search-tool search --stdin
# With table output
obsidian-search-tool search 'TABLE file.name, file.size' --table
```
## Output
Returns query, search type, timestamp, result count, and matching files.

36
commands/status.md Normal file
View File

@@ -0,0 +1,36 @@
---
description: Check Obsidian API connectivity status
---
Check if the Obsidian Local REST API is reachable and responding.
## Usage
```bash
obsidian-search-tool status [--json|--text] [-v|-vv|-vvv]
```
## Options
- `--json`: JSON output (default)
- `--text` / `-t`: Markdown text output
- `-v`: INFO level logging
- `-vv`: DEBUG level logging
- `-vvv`: TRACE level with library internals
## Examples
```bash
# Basic status check
obsidian-search-tool status
# With text output
obsidian-search-tool status --text
# With verbose logging
obsidian-search-tool status -vv
```
## Output
Returns connection status, API URL, timestamp, and message.