Skip to content

juliocesar/piglet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐷 Piglet

A tiny pig that watches your Chrome bookmarks and lets you grep them.

Piglet runs quietly in the background, watches Chrome's Bookmarks file, keeps a local SQLite FTS5 index in sync, and gives you instant full-text and fuzzy search over every bookmark from the terminal. Zero cloud, all local.

Why

Browser bookmark UIs are bad at search. If you have thousands of bookmarks, finding the one you saved months ago is hopeless. Piglet makes them queryable in milliseconds, with fuzzy matching so a typo still finds what you meant.

Requirements

  • macOS
  • Google Chrome
  • Node >= 24

Piglet depends on better-sqlite3, a native module. On install, npm pulls a prebuilt binary when one exists; otherwise it compiles via node-gyp, which needs the Xcode Command Line Tools (xcode-select --install). If you install with pnpm, you may need to approve the native build once with pnpm approve-builds -g. npm is the simplest path.

Install

npm i -g @julio_ody/piglet
# or
pnpm add -g @julio_ody/piglet

(The command is piglet; the package is scoped because the bare piglet name was taken on npm.)

Quick start

piglet react                      # full-text search
piglet "github typescript"        # multi-term
piglet reakt                      # fuzzy: still finds "react"
piglet --by-relevance postgres    # rank by FTS relevance instead of date
piglet reindex                    # rebuild the index from the live file
piglet status                     # is the watcher running? how many indexed?

Results are line-oriented and easy to read (and to pipe):

  sindresorhus/css-extras: Useful CSS custom functions using the new @function rule
  https://github.com/sindresorhus/css-extras
  other/Dev  ·  added 7 months ago (Oct 27, 2025, 10:08:13 AM)

Each hit shows the bookmark name, its URL, the parent folder, and when you added it. Matched terms are highlighted.

Run it in the background

piglet install      # registers a macOS LaunchAgent, starts now and at login
piglet uninstall    # remove it

The watcher keeps the index live as you add and remove bookmarks in Chrome, and appends a change log to ~/Library/Logs/Piglet/changes.log. Re-run piglet install after upgrading piglet so the agent points at the new version.

Why a CLI is LLM-friendly

Piglet exposes your bookmarks as a composable command, which is exactly the interface coding agents and LLM tools already know how to drive.

  • Agents already run shell commands. Tools like Claude Code, Cursor, and any function-calling setup can call piglet <query> directly. No API keys, no MCP server to stand up, no auth dance. If the model can run a terminal command, it can reach your bookmarks.
  • Plain-text in, plain-text out. Results are line-oriented stdout that an LLM parses trivially and that pipes into grep, head, fzf, or anything else. The model can compose Piglet with the rest of the shell.
  • Stateless and fast. Each query is a single synchronous SQLite read. An agent can fire many piglet calls in a loop while researching, with no session state to manage.
  • Local and private. The index lives on-device, so an agent can search your bookmark history without anything leaving the machine.

A real example: ask your coding agent "find the postgres connection-pool article I bookmarked" and it runs piglet postgres connection pool, reads the URL from stdout, and fetches it. That round trip is the whole pitch: bookmarks become a queryable tool surface for an LLM, not a GUI a model cannot click.

Where it stores things

What Where
Index (SQLite) ~/Library/Application Support/Piglet/bookmarks.db
Change log ~/Library/Logs/Piglet/changes.log
Watcher stdout/stderr ~/Library/Logs/Piglet/{stdout,stderr}.log

License

MIT

About

Search and watch your Chrome bookmarks from the command line (macOS)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors