Skip to content

CLI System Resource

CLISystemResource(cli)

Bases: BaseCLIResource

CLI resource for general system commands.

Attributes:

Name Type Description
_cli

Reference to the parent ObsidianCLI instance.

Source code in src/aiobsidian/cli/_base.py
def __init__(self, cli: ObsidianCLI) -> None:
    self._cli = cli

version() async

Get the Obsidian version.

Returns:

Type Description
str

Obsidian version string.

Source code in src/aiobsidian/cli/system.py
async def version(self) -> str:
    """Get the Obsidian version.

    Returns:
        Obsidian version string.
    """
    return await self._cli._execute("version")

help() async

List all available CLI commands.

Returns:

Type Description
list[dict[str, Any]]

List of command descriptions.

Source code in src/aiobsidian/cli/system.py
async def help(self) -> list[dict[str, Any]]:
    """List all available CLI commands.

    Returns:
        List of command descriptions.
    """
    output = await self._cli._execute("help")
    result: list[dict[str, Any]] = json.loads(output)
    return result

reload() async

Reload the Obsidian window.

Source code in src/aiobsidian/cli/system.py
async def reload(self) -> None:
    """Reload the Obsidian window."""
    await self._cli._execute("reload")

restart() async

Restart the Obsidian application.

Source code in src/aiobsidian/cli/system.py
async def restart(self) -> None:
    """Restart the Obsidian application."""
    await self._cli._execute("restart")

vaults() async

List all known vaults (desktop only).

Returns:

Type Description
list[dict[str, Any]]

List of vault objects.

Source code in src/aiobsidian/cli/system.py
async def vaults(self) -> list[dict[str, Any]]:
    """List all known vaults (desktop only).

    Returns:
        List of vault objects.
    """
    output = await self._cli._execute("vaults")
    result: list[dict[str, Any]] = json.loads(output)
    return result