Help us shape the future of Go! Take the 2026 Go Developer Survey

bearkit

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: MIT

README

bearkit (Go)

A companion CLI for Bear notes — orphan/duplicate/dangling-wikilink reports, a Markdown linter, a find-and-replace across notes, and a random-note opener. This is a from-scratch Go rewrite of bearkit (Python), built for single-binary, zero-runtime-dependency distribution.

All five commands from the Python original are ported: orphans, duplicates, wikilinks, lint, random. Plus one new one: replace, a literal find-and-replace across notes.

Install

No packaged releases yet. For now, build from source:

git clone https://github.com/i-am-fran/bearkit.git
cd bearkit
go build -o bearkit ./cmd/bearkit
mv bearkit /usr/local/bin/   # or anywhere on your PATH

Requires Go 1.23+ to build. Requires Bear 2.8+ and its bundled bearcli binary at runtime.

Usage

bearkit --help
bearkit orphans
bearkit duplicates
bearkit wikilinks
bearkit wikilinks --mark
bearkit lint
bearkit lint -t work -n
bearkit replace --find "old text" --replace "new text"
bearkit replace --find "old text" --replace "new text" -t work -y
bearkit random 4 -t evergreen
bearkit --selftest

Run bearkit with no arguments, or any command with no flags, in a terminal to be walked through the options interactively; pass any flag to run non-interactively. See bearkit --help for the full flag reference.

Development

go build ./...
go vet ./...
go test ./...

Requires bearcli (Bear's bundled binary) for any command that reads/writes real notes; the test suite uses a fake in-process implementation and never touches Bear.

Directories

Path Synopsis
cmd
bearkit command
Command bearkit is a companion CLI for Bear.app notes.
Command bearkit is a companion CLI for Bear.app notes.
internal
bear
Package bear wraps bearcli, Bear.app's bundled CLI binary, which is the only way bearkit reads or writes notes.
Package bear wraps bearcli, Bear.app's bundled CLI binary, which is the only way bearkit reads or writes notes.
cli
Package cli wires up bearkit's command-line surface: the Cobra-based subcommands, plus a handful of flags (--help, --version, --selftest) that are intercepted before Cobra ever parses argv, mirroring the Python original's pre-argparse sys.argv scan.
Package cli wires up bearkit's command-line surface: the Cobra-based subcommands, plus a handful of flags (--help, --version, --selftest) that are intercepted before Cobra ever parses argv, mirroring the Python original's pre-argparse sys.argv scan.
lint
Package lint is bearkit's Markdown lint engine: 16-step rule pipeline, protected-region masking (fenced code/frontmatter), and the emphasis/ heading/HR matchers hand-rewritten from Python regexes Go's RE2-based regexp package can't run (lookaround, backreferences).
Package lint is bearkit's Markdown lint engine: 16-step rule pipeline, protected-region masking (fenced code/frontmatter), and the emphasis/ heading/HR matchers hand-rewritten from Python regexes Go's RE2-based regexp package can't run (lookaround, backreferences).
report
Package report holds the summary-note formatting and writing logic shared by bearkit's List/Edit commands: per-command render helpers, --group-by-tag grouping (GroupByTag/RenderGroupedSections), and WriteNote, which saves a report as a new tagged Bear note.
Package report holds the summary-note formatting and writing logic shared by bearkit's List/Edit commands: per-command render helpers, --group-by-tag grouping (GroupByTag/RenderGroupedSections), and WriteNote, which saves a report as a new tagged Bear note.
textutil
Package textutil holds small line-splitting helpers shared by the lint and wikilink packages.
Package textutil holds small line-splitting helpers shared by the lint and wikilink packages.
version
Package version holds bearkit's version string, overridden at build time via -ldflags for tagged releases.
Package version holds bearkit's version string, overridden at build time via -ldflags for tagged releases.
wikilink
Package wikilink resolves Bear [wikilink] syntax to note titles: target extraction (used by orphans' incoming-link scan), dangling-link detection with typo suggestions, and marking (used by the `wikilinks` command).
Package wikilink resolves Bear [wikilink] syntax to note titles: target extraction (used by orphans' incoming-link scan), dangling-link detection with typo suggestions, and marking (used by the `wikilinks` command).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL