

Bark
“Stamp path headers onto every source file — safely, idempotently”
A Rust CLI that adds standardized, template-driven path headers to 74+ file types and generates a directory tree of your project. Idempotent by design, parallel with rayon, and non-destructive: atomic writes, timestamped backups, and a one-command restore.
Installation Guide
Pre-built binaries for five platform targets, or build from source with cargo.
Requirements
Bark ships as a single static binary — nothing else to install for the pre-built releases.
Only needed if you build from source or install via cargo.
https://rustup.rsOptional — used to resolve the {{author}} template variable from git config and to power --staged mode. Bark works without it.
One-liner install (recommended)
Downloads the pre-built binary for your platform from the latest GitHub release. Supported targets: Linux x86_64 and ARM64, macOS Intel and Apple Silicon, Windows x86_64.
curl -fsSL https://raw.githubusercontent.com/lordofthemind/bark/master/install.sh | bashInstall with cargo
Builds from the latest source and installs to ~/.cargo/bin (already in PATH if you use rustup).
cargo install --git https://github.com/lordofthemind/barkBuild from source
Clone and install locally — the release profile uses LTO and symbol stripping for a small, fast binary.
Quick Start Guide
From nothing installed to a fully tagged project in three steps.
Install the binary
The installer detects your platform (Linux/macOS/Windows, x86_64/ARM64), downloads the latest release binary, and installs it to ~/.local/bin.
curl -fsSL https://raw.githubusercontent.com/lordofthemind/bark/master/install.sh | bash💡 Tips
- •Make sure ~/.local/bin is in your PATH, or set BARK_INSTALL_DIR to somewhere that is
- •Rust users can instead run: cargo install --git https://github.com/lordofthemind/bark
Create a config (optional but recommended)
bark init --detect inspects the directory for project markers (Cargo.toml, go.mod, package.json, tsconfig.json, .tf files, Dockerfile) and writes a .bark.toml with sensible excludes pre-filled for your stack. Bark also works with zero config — built-in defaults apply.
bark init --detect💡 Tips
- •Config resolution: --config FILE → .bark.toml (searched upward) → ~/.config/bark/config.toml → built-in defaults
Preview, then tag
Always dry-run first on an existing codebase — it prints exactly which files would be tagged or updated without writing anything. Then run bark for real: every supported file gets a header, and a bark.txt directory tree is generated.
bark tag --dry-run # preview — writes nothing
bark # tag everything + generate bark.txt💡 Tips
- •Running bark again is a no-op — headers are only rewritten when the path changes or the template changes
- •Every modified file is backed up to .barks/ first; bark restore undoes any run
You're all set! Check out the detailed usage guide below for more advanced features.
Usage Guide
From first tag to templates, watch mode, and monorepo workflows.
Tag a project
bark with no subcommand is bark tag: every supported source file gets a header on line 0 (or line 1 after a shebang), and bark.txt is regenerated. The summary shows exactly what happened.
bark
# bark done
# 12 tagged ← headers added
# 3 updated ← stale headers refreshed (e.g. renamed files)
# 8 current ← already correct, untouched
# 1 skippedNotes
- Files over 1 MB, binary files, and gitignored paths are skipped automatically
Check headers in CI
bark check verifies every file without writing anything and exits 1 if any header is missing or stale — drop it straight into CI or a pre-commit hook.
bark check
# missing src/new_module.rs
# stale src/renamed_file.rs
# 2 issues → exit code 1Strip, tree, and undo
Headers are fully reversible, the tree can be generated standalone, and every run can be rolled back from the timestamped backups in .barks/.
bark strip --dry-run # preview header removal
bark strip --backup # remove all headers (with backups)
bark tree # regenerate bark.txt only, touch nothing else
bark restore --latest # revert every file to its most recent backup
bark clean --keep 3 # prune old backups, keep 3 per fileCommand Reference
All nine subcommands. Every command accepts -v/--verbose and --config <FILE>; most accept one or more [DIR] roots.
tag (default)
Add or update headers across a directory tree and generate bark.txt. Running bark with no subcommand is equivalent to bark tag.
Signature
bark tag [OPTIONS] [DIR]...Parameters
--dry-run, -nflagPreview what would change; write nothing
--force, -fflagSkip backups before modifying files
--templatestringOverride the header template for this run
--stagedflagOnly process files staged in git (pre-commit mode)
--no-treeflagSkip bark.txt generation
--threadsnumberDefault: 0Rayon thread count (0 = all cores)
--max-sizebytesDefault: 1048576Skip files larger than this
Returns
exit 0Examples
barkbark tag --dry-run --no-treebark tag --staged --no-treebark tag services/api services/workerstrip
Remove all bark-managed headers from every file in the tree. Reversible with --backup.
Signature
bark strip [OPTIONS] [DIR]...Parameters
--dry-run, -nflagPreview which headers would be removed
--backup, -bflagCreate backups before stripping
Returns
exit 0Examples
bark strip --dry-runbark strip --backuptree
Generate the directory tree file without touching any headers. Honors the same ignore rules as tagging.
Signature
bark tree [OPTIONS] [DIR]...Parameters
--output, -opathDefault: bark.txtOutput path for the tree
Returns
exit 0Examples
bark treebark tree --output docs/structure.txtwatch
Watch directories and tag files automatically as they're saved. Debounces editor burst-saves and never re-processes its own writes.
Signature
bark watch [OPTIONS] [DIR]...Parameters
--debouncemillisecondsDefault: 500Wait after a change before processing
--dry-run, -nflagLog what would be tagged without writing
Returns
runs until Ctrl-CExamples
bark watchbark watch --debounce 200check
Verify every file has a current header. Read-only. Exits 1 if any header is missing or stale — built for CI and hooks.
Signature
bark check [DIR]...Returns
exit 0 (all current) | exit 1 (issues found)Examples
bark checkbark check services/api services/workerclean
Remove old backups from .barks/, keeping the N most recent per source file.
Signature
bark clean [OPTIONS] [DIR]...Parameters
--keepnumberDefault: 1Backups to keep per file
--dry-run, -nflagPreview deletions
Returns
exit 0Examples
bark cleanbark clean --keep 3 --dry-runrestore
Restore files from timestamped backups — interactively (numbered list) or automatically with --latest.
Signature
bark restore [OPTIONS]Parameters
--latestflagAuto-restore the most recent backup of each file
--filepathFilter to backups of a specific file
--dry-run, -nflagPreview what would be restored
Returns
exit 0Examples
bark restorebark restore --latestbark restore --file src/main.rsinit
Write a .bark.toml config. With --detect, inspects the directory for project markers and pre-fills stack-appropriate excludes.
Signature
bark init [OPTIONS] [DIR]Parameters
--detectflagAuto-detect project type (React/TS/Go/Rust/Terraform/Docker)
--forceflagOverwrite an existing .bark.toml
Returns
exit 0Examples
bark init --detectbark init --forceconfig
Print the fully resolved configuration for a directory — the fastest way to debug which config file is being used and what the effective values are.
Signature
bark config [OPTIONS] [DIR]Parameters
--sourceflagAlso print the path of the loaded config file
Returns
exit 0Examples
bark configbark config --sourceExamples Gallery
Real-world code examples and use cases
Tag a project with a custom one-off template
beginnerSkip the config file entirely and pass the template on the command line.
bark tag --dry-run --no-tree --template "File: {{file}} | {{author}} | {{date}}"
# happy with the preview? drop --dry-run:
bark tag --no-tree --template "File: {{file}} | {{author}} | {{date}}"Undo everything
beginnerBackups make bark safe to experiment with — one command reverts the last run.
bark restore --dry-run --latest # see what would be restored
bark restore --latest # revert every file to its last backupFrequently Asked Questions
6 questions answered
Still have questions?
Check out the source code or open an issue on GitHub
AI-readable content
Learn more →This content is available via the AI Content API as JSON or token-efficient Markdown. Feed it directly into LLM workflows.
/api/content/docs/barkRelated Content
Explore related articles, projects, and tools.