obsidian-cli

Use the Obsidian CLI to debug, inspect, and test Obsidian plugins during development. Covers plugin reloading, console inspection, runtime evaluation, and common debugging recipes for the gemini-scribe plugin.

290 stars

Best use case

obsidian-cli is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use the Obsidian CLI to debug, inspect, and test Obsidian plugins during development. Covers plugin reloading, console inspection, runtime evaluation, and common debugging recipes for the gemini-scribe plugin.

Teams using obsidian-cli should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/obsidian-cli/SKILL.md --create-dirs "https://raw.githubusercontent.com/allenhutchison/obsidian-gemini/main/.agents/skills/obsidian-cli/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/obsidian-cli/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How obsidian-cli Compares

Feature / Agentobsidian-cliStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use the Obsidian CLI to debug, inspect, and test Obsidian plugins during development. Covers plugin reloading, console inspection, runtime evaluation, and common debugging recipes for the gemini-scribe plugin.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Obsidian CLI

The Obsidian CLI (`obsidian` command) provides direct access to a running Obsidian instance from the terminal. It is invaluable for plugin development — you can reload plugins, inspect state, evaluate expressions, and view console output without leaving your editor.

## When to use this skill

- Debugging runtime errors during plugin development
- Verifying plugin state after code changes
- Testing migration logic or settings changes
- Inspecting secrets, settings, and vault state
- Reloading the plugin after a rebuild
- Viewing console errors without opening DevTools

## Quick reference

### Plugin development essentials

```bash
# Reload the plugin after rebuilding (use after `npm run build` or `npm run dev`)
obsidian plugin:reload id=gemini-scribe

# Enable DevTools debugger
obsidian dev:debug on

# View recent console output (errors, warnings, logs)
obsidian dev:console
obsidian dev:console level=error
obsidian dev:console level=warn
obsidian dev:console limit=100

# View captured errors
obsidian dev:errors

# Clear console buffer
obsidian dev:console clear
```

### Evaluating expressions

Use `eval` to run JavaScript against the live Obsidian instance. The expression has access to the full `app` object.

```bash
# Basic eval
obsidian eval code="app.vault.getName()"

# Check plugin is loaded
obsidian eval code="app.plugins.plugins['gemini-scribe'] !== undefined"

# Read plugin settings
obsidian eval code="JSON.stringify(app.plugins.plugins['gemini-scribe'].settings, null, 2)"

# Check the plugin's API key (via SecretStorage getter)
obsidian eval code="app.plugins.plugins['gemini-scribe'].apiKey"
```

### Secret storage

```bash
# List all secrets in the vault
obsidian eval code="app.secretStorage.listSecrets()"

# Read a specific secret value
obsidian eval code="app.secretStorage.getSecret('my-secret-name')"

# Set a secret
obsidian eval code="app.secretStorage.setSecret('my-secret-name', 'my-secret-value')"
```

### Vault and file operations

```bash
# Vault info
obsidian vault

# List files
obsidian files
obsidian files folder=gemini-scribe
obsidian files ext=md total

# Read a file
obsidian read path="gemini-scribe/Agent-Sessions/session.md"

# Search vault contents
obsidian search query="apiKey"
obsidian search:context query="apiKey" limit=5

# Check file info
obsidian file path="data.json"
```

### Plugin management

```bash
# List all plugins
obsidian plugins
obsidian plugins filter=community versions

# Get plugin info
obsidian plugin id=gemini-scribe

# Enable/disable
obsidian plugin:enable id=gemini-scribe
obsidian plugin:disable id=gemini-scribe

# Reload after code changes
obsidian plugin:reload id=gemini-scribe
```

## Common recipes

### Test a fresh install

Remove `data.json` to simulate a new install, then reload:

```bash
# Remove plugin settings (simulates fresh install)
obsidian eval code="app.vault.adapter.remove('.obsidian/plugins/gemini-scribe/data.json')"

# Reload the plugin
obsidian plugin:reload id=gemini-scribe

# Verify settings are defaults
obsidian eval code="JSON.stringify(app.plugins.plugins['gemini-scribe'].settings, null, 2)"
```

### Debug a settings migration

```bash
# Check current settings before migration
obsidian eval code="JSON.stringify(app.plugins.plugins['gemini-scribe'].settings, null, 2)"

# Rebuild and reload
npm run build && obsidian plugin:reload id=gemini-scribe

# Check settings after migration
obsidian eval code="JSON.stringify(app.plugins.plugins['gemini-scribe'].settings, null, 2)"

# Check console for migration logs
obsidian dev:console level=log
```

### Inspect agent session state

```bash
# List session files
obsidian files folder=gemini-scribe/Agent-Sessions

# Check current session context
obsidian eval code="JSON.stringify(app.plugins.plugins['gemini-scribe'].agentView?.currentSession?.context, null, 2)"
```

### Check for errors after a change

```bash
# Full cycle: build, reload, check for errors
npm run build && obsidian plugin:reload id=gemini-scribe && sleep 1 && obsidian dev:errors
```

### Inspect DOM for UI debugging

```bash
# Query DOM elements
obsidian dev:dom selector=".gemini-agent-view"
obsidian dev:dom selector=".gemini-agent-input" text

# Check CSS values
obsidian dev:dom selector=".gemini-agent-view" css=display

# Take a screenshot
obsidian dev:screenshot path=debug-screenshot.png
```

### Target a specific vault

If you have multiple vaults open, target a specific one:

```bash
obsidian plugin:reload id=gemini-scribe vault="My Vault"
obsidian eval code="app.vault.getName()" vault="Test Vault"
```

## CLI syntax notes

- Arguments use `key=value` format (no dashes)
- Quote values containing spaces: `code="app.vault.getName()"`
- Boolean flags are bare keywords: `obsidian files total`
- File resolution: `file=` resolves by name (like wikilinks), `path=` is exact
- Most commands default to the active file when `file`/`path` is omitted
- Use `\n` for newline and `\t` for tab in content values

## Troubleshooting

### CLI not found

The Obsidian CLI requires Obsidian desktop. Ensure it's installed and accessible from your terminal. Check `obsidian version` to verify.

### Eval returns undefined

The expression may not return a value. Wrap in `JSON.stringify()` for objects, or ensure the expression actually produces a result.

### Plugin not found after reload

Check that the plugin ID is correct (`gemini-scribe`, not `obsidian-gemini`) and that the plugin is enabled:

```bash
obsidian plugins:enabled filter=community
```

Related Skills

obsidian-properties

290
from allenhutchison/obsidian-gemini

Work with Obsidian note properties (frontmatter). Activate this skill when users want to add, modify, or organize properties, understand property types, format YAML frontmatter, or use properties with templates, search, or Bases.

obsidian-bases

290
from allenhutchison/obsidian-gemini

Create and configure Obsidian Bases — database-like views of notes. Activate this skill when users want to create bases, write filters, formulas, or set up table/cards/list/map views.

obsidian-plugin-development

290
from allenhutchison/obsidian-gemini

Build, modify, and debug Obsidian plugins using the TypeScript API. Use this skill when working with Obsidian plugin source code, the obsidian npm package, plugin UI (views, modals, settings, commands, ribbons), vault file operations, editor manipulation, workspace management, metadata cache, events, markdown rendering, or the Obsidian CLI. Covers plugin lifecycle, best practices, common patterns, and the full TypeScript API surface.

vault-semantic-search

290
from allenhutchison/obsidian-gemini

Search vault notes by meaning using semantic search (RAG). Activate this skill when users want to find notes by concept or topic rather than exact keywords, or when keyword search tools return poor results.

recall-sessions

290
from allenhutchison/obsidian-gemini

Search past agent conversations to recall prior discussions, decisions, and context. Activate this skill when users ask about previous conversations, want to resume past work, or reference earlier decisions.

image-generation

290
from allenhutchison/obsidian-gemini

Generate images from text descriptions and save them to the vault. Activate this skill when users want to create illustrations, diagrams, visual content, or any AI-generated images.

gemini-scribe-help

290
from allenhutchison/obsidian-gemini

Answer questions about Gemini Scribe plugin features, settings, and usage. Activate this skill when users ask how to use the plugin, configure settings, or troubleshoot issues.

deep-research

290
from allenhutchison/obsidian-gemini

Conduct comprehensive, multi-source research and generate cited reports. Activate this skill when users want in-depth research on a topic, need synthesis across web and vault sources, or want a structured research report saved to their vault.

audio-transcription

290
from allenhutchison/obsidian-gemini

Transcribe audio and video files into structured notes. Activate this skill when users want to transcribe recordings, meetings, podcasts, voice memos, or any audio/video content in their vault.

ui-ux-guidelines

290
from allenhutchison/obsidian-gemini

UI/UX best practices for obsidian-gemini plugin development. Covers modal sizing, text overflow, message formatting, collapsible UI, animations, icons, file chips, session state, CSS containment, and theme compatibility. Use this skill when building or modifying UI components.

release-process

290
from allenhutchison/obsidian-gemini

Full release workflow for obsidian-gemini: update release notes, run checks, bump version with npm, create a GitHub release, and verify. Use this skill when preparing a new plugin release.

gemini-api-dev

290
from allenhutchison/obsidian-gemini

Use this skill when building applications with Gemini models, Gemini API, working with multimodal content (text, images, audio, video), implementing function calling, using structured outputs, or needing current model specifications. Covers SDK usage (google-genai for Python, @google/genai for JavaScript/TypeScript, com.google.genai:google-genai for Java, google.golang.org/genai for Go), model selection, and API capabilities.