obsidian-ai-starter

obsidian-ai-starter

Claudian alternative at 1/10 the cost — Pi agent inside Obsidian, BYOK, auto-saves to vault.

Obsidian AI Starter

Notes, a chat window and a small tool arranged on a workbench

English | 中文

A small, reproducible setup that brings the Pi coding agent into an existing Obsidian vault on Windows or macOS.

It gives you:

  • an AI chat panel inside Obsidian;
  • bounded Obsidian vault tools through pi-obsidian-vault;
  • Markdown copies of conversations in Pi-Sessions/;
  • your choice of Pi-supported model provider, using your own account or API key.

This repository is an installer and integration layer. It does not fork Pi or the Obsidian plugin.

Platform support

PlatformInstallerStatus
Windows 10/11scripts/setup.ps1Supported
macOSscripts/setup.shSupported
Linux—Not currently supported
Obsidian mobile—Not supported

Prerequisites

  • Obsidian Desktop and an existing vault
  • Node.js >= 22.19.0
  • npm
  • Git
  • Windows only: Git for Windows, which provides the bash shell required by Pi
  • a Pi-supported subscription or API key

The installers never ask for or store your API key.

Install

Clone this repository, then run the installer for your platform.

macOS

git clone https://github.com/alexliu072903-bit/obsidian-ai-starter.git
cd obsidian-ai-starter
chmod +x scripts/setup.sh
./scripts/setup.sh --vault "/absolute/path/to/your/Obsidian Vault"

Windows

git clone https://github.com/alexliu072903-bit/obsidian-ai-starter.git
cd obsidian-ai-starter
Set-ExecutionPolicy -Scope Process Bypass
.\scripts\setup.ps1 -VaultPath "D:\path\to\your\Obsidian Vault"

The installer:

  1. verifies the selected folder is an Obsidian vault;
  2. verifies Node.js, npm, Git, and the platform requirements;
  3. installs a pinned Pi release and pi-obsidian-vault;
  4. fetches a pinned obsidian-pi-plugin commit;
  5. applies the cross-platform compatibility patch and builds the plugin;
  6. prepares all three plugin files and validates/merges existing settings in a temporary candidate;
  7. publishes into .obsidian/plugins/pi-plugin/, recording the Pi binary path while retaining custom settings and unrelated plugin files.

Any failed native command stops the installer. Temporary build files are isolated and removed when the script exits.

Reinstallation and failure recovery

  • Existing settings must be a valid JSON object. Unknown fields, already-set defaults (including false / null) and unrelated plugin files are preserved. piBinaryPath is updated to this installation's Pi path.
  • Patch/build failures, missing artifacts or invalid settings leave the installed plugin/settings untouched. Before publication the old files are checked again. Ordinary copy/replace failures restore this run's published files while preserving later user edits.
  • If restoration fails, the backup location is reported and retained. Four-file publication is not a power-loss or forced-kill transaction; inspect the plugin files and rerun after such an interruption.
  • Global Pi/vault-tool installation happens before plugin publication and is not rolled back when the plugin fails. An optional backup failure also leaves the successfully installed plugin in place.

Finish in Obsidian

  1. Open the vault in Obsidian Desktop.
  2. Go to Settings → Community plugins and enable community plugins.
  3. Enable the Pi plugin.
  4. Go to Settings → General → Advanced → Command line interface, enable it, then choose Register for PATH.
  5. Open a terminal, run pi, then use /login to select a subscription or API-key provider.
  6. In Obsidian, open the command palette and run Pi: Open chat.

Test the integration:

Find my notes about <topic> and summarize the relevant context.

If Pi cannot find the vault, run this inside Pi:

/obsidian-vault set-vault /absolute/path/to/your/Obsidian Vault

Optional private GitHub backup

GitHub backup is disabled by default. Only use an empty private repository.

macOS

./scripts/setup.sh \
  --vault "/absolute/path/to/your/Obsidian Vault" \
  --github-url "https://github.com/username/private-vault.git" \
  --push

Windows

.\scripts\setup.ps1 `
  -VaultPath "D:\path\to\your\Obsidian Vault" `
  -GitHubUrl "https://github.com/username/private-vault.git" `
  -PushToGitHub

Before pushing, the installer:

  • refuses a non-empty remote;
  • refuses to replace an existing mismatched origin;
  • previews candidate backup files using a disposable index;
  • requires you to type push.

Existing repositories keep their current branch and every ref; a non-main branch is never renamed and another main ref is never replaced. Only new repos start main. Detached HEAD, a parent repository, pre-staged input, an origin conflict or a non-empty remote is refused before Git writes. Cancelling confirmation stages/pushes nothing. Backup success requires push exit 0; failures retain the local commit for retry. Existing history is pushed too: ignore rules do not clean history. Confirm that history may leave your machine. Existing .gitignore is preserved; newly created rules exclude only some internals and do not scan for secrets.

The installer cannot verify whether a GitHub repository is private. Confirm that yourself before approving the push.

Security boundary

Pi is a local coding agent, not a vault sandbox. It runs with the filesystem, shell, network, and credential permissions of your user account. The working directory is the vault, but that does not prevent Pi from accessing other paths available to your account.

Review requests before allowing changes, keep private notes out of public repositories, and use a container or VM if you need a real isolation boundary.

See the official Pi security documentation.

Pinned components

ComponentVersion/ref
@earendil-works/pi-coding-agent0.82.1
pi-obsidian-vault0.2.3
sigilmakes/obsidian-pi-plugin3ccd701160009d256528ee7794e80ee95b380a74

Pinning keeps installations reproducible. Version changes should be tested on Windows and macOS before these values are updated.

Validation scope

bash tests/test-macos-installer.sh exercises real Node settings merge, temporary Git repositories and local bare remotes. Only network/npm/Pi/build boundaries are replaced. tests/test-windows-installer.ps1 exercises real PowerShell JSON merge and Git. CI defines Windows PowerShell 5.1, PowerShell 7 and macOS Bash jobs; Windows results require the corresponding CI run. These fixtures do not start user Obsidian, access a real vault, download external dependencies or verify login/chat integration.

License

MIT

Related

How to Install

  1. Download the ZIP or clone the repository
  2. Open the folder as a vault in Obsidian (File → Open Vault)
  3. Obsidian will prompt you to install required plugins

Stats

Stars

0

Forks

0

License

MIT

Last updated 1d ago

Categories

Tags

ai-agentsinstallerobsidianpi-agent