CLI Search Resource¶
CLISearchResource(cli)
¶
Bases: BaseCLIResource
CLI resource for vault search operations.
Attributes:
| Name | Type | Description |
|---|---|---|
_cli |
Reference to the parent |
Source code in src/aiobsidian/cli/_base.py
open(query)
async
¶
Open the search panel in the Obsidian UI with a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Search query string. |
required |
query(query, *, path=None, limit=None, case=False, matches=False)
async
¶
Search the vault.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Search query string. |
required |
path
|
str | None
|
Restrict search to files under this path. |
None
|
limit
|
int | None
|
Maximum number of results to return. |
None
|
case
|
bool
|
If |
False
|
matches
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
List of search result dictionaries. |
Source code in src/aiobsidian/cli/search.py
context(query, *, lines=None, path=None, limit=None, case=False)
async
¶
Search the vault with surrounding context lines.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Search query string. |
required |
lines
|
int | None
|
Number of context lines to include around matches. |
None
|
path
|
str | None
|
Restrict search to files under this path. |
None
|
limit
|
int | None
|
Maximum number of results to return. |
None
|
case
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
List of search result dictionaries with context. |