Skip to content

georgebuilds/packrat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Packrat

A TUI-driven archival tool for maintaining local mirrors of Git repositories, IPFS snapshots, OpenStreetMap regions, Wikipedia pages, RSS/Atom feeds, and HuggingFace model repositories โ€” all driven by a single TOML manifest.

Use it to keep a personal, offline-recoverable copy of the upstream content you depend on (source code, datasets, reference pages, news), on local disk or a NAS, refreshed on a schedule.

Install

Binary release (latest tag from GitHub Releases):

curl -sSfL https://raw.githubusercontent.com/georgebuilds/packrat/main/install.sh | bash

Homebrew:

brew install georgebuilds/tap/packrat

Debian/RPM packages are published per release; Chocolatey is published for Windows. See the releases page.

From source (Go 1.26+):

go install github.com/georgebuilds/packrat/cmd/packrat@latest

Quick start

packrat               # launch the TUI; first run prompts for a storage dir
packrat add <git-url> # add a repo to the manifest from the command line
packrat sync          # run every enabled source non-interactively
packrat sync --quiet  # same, but silent โ€” suitable for cron

The manifest lives at ~/.packrat/packrat.toml. A full example is in testdata/packrat.toml.example.

Data model

Everything archived lives under settings.storage_base from the manifest:

Source On-disk layout
Git mirror {base}/mirrors/{host}/{org}/{repo}.git (bare)
HF model {base}/mirrors/huggingface.co/{owner}/{name}.git (bare, LFS)
IPFS snap {base}/snapshots/{cid}/{content,metadata.json}
OSM region {base}/osm/{slug}/{slug}.osm.pbf + region.db
Wikipedia {base}/wikipedia/{slug}/content/*.html + archive.db
RSS/Atom {base}/feeds/{slug}/items/*.html + feed.db

Manifest schema (abridged):

[settings]
storage_base = "/mnt/nas/packrat"

[[repos]]
url      = "https://github.com/charmbracelet/bubbletea"
branches = []          # empty = all refs (currently always all โ€” see below)
lfs      = false       # fetch Git LFS objects
enabled  = true

[[snapshots]]
url = "ipfs://bafy..."
name = "example-dataset"
enabled = true

[[wiki_pages]]
url = "https://en.wikipedia.org/wiki/SQLite"
name = "SQLite"
enabled = true

[[feeds]]
url = "https://go.dev/blog/feed.atom"
name = "Go Blog"
type = "atom"
enabled = true

[[osm_regions]]
name = "Oklahoma"
source = "geofabrik"   # URL resolved from the Geofabrik catalogue
enabled = true

Caveats worth knowing:

  • repos.branches is parsed today but not yet honoured โ€” every clone is a full --mirror. A warning is printed on clone if the field is set.
  • packrat sync runs Git, IPFS, Wikipedia, and RSS. OSM regions are currently synced only from the OSM screen in the TUI or via the dev-only packrat-osm binary.

Scheduling

The TUI's settings screen toggles a recurring sync. Under the hood it edits the user's crontab on Linux/macOS (packrat sync --quiet) or creates a Packrat-Sync task with schtasks on Windows. Supported presets: hourly, 6h, 12h, daily, weekly.

Plugins (experimental)

Dependency-resolution plugins are shell scripts that emit JSON. Built-in plugins for npm, cargo, and go-mod ship under plugins/. They are installed to:

  • ~/.packrat/plugins/ (user overrides)
  • <prefix>/share/packrat/plugins/ (system / built-in)

Override the built-in lookup with PACKRAT_DEV_PLUGINS=/path/to/plugins while developing. Plugins are invoked by packrat-deps <repo-url>, but full end-to-end resolution against bare mirrors is still a work in progress (internal/deps/resolver.go documents the limitation).

Project status

Active. Tagged releases are published to Homebrew, deb/rpm packages, and Chocolatey via GoReleaser. The CLI surface and manifest schema are stable enough for personal use; expect rough edges around dependency resolution and partial-branch mirroring.

Contributing / architecture

See AGENTS.md for the package layout, build/test instructions, and the open issues a contributor is most likely to hit.

About

Archival tool ๐Ÿ€

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors