Coding Agents are really good at using example code and documentation for libraries
Mount GitHub repositories as a local filesystem.
ghfs daemon is the foreground daemon entry point. It does not daemonize itself; use your
platform service manager (systemd or launchd) for backgrounding and restarts.
cargo install ghfs --lockedcargo binstall ghfsbrew tap rgodha24/tap
brew install ghfscurl --proto '=https' --tlsv1.2 -LsSf https://github.com/rgodha24/ghfs/releases/latest/download/ghfs-installer.sh | shnix run github:rgodha24/ghfsFor managed per-user daemon setup, use the Home-Manager module documented below and set:
services.ghfs.enable = true;GitHub reads use an in-process HTTPS Git protocol-v2 client. Git is not a runtime
requirement. Tokens come from GH_TOKEN, GITHUB_TOKEN, or a cached gh auth token
lookup when available; public repositories work without credentials.
Fetched objects live as loose objects in the v3 cache. Temporary transfer packs
are decoded with bounded buffers and disk-backed deltas, then removed; there is
no repacking. The previous v2 cache is retained unused and can be removed manually
after verifying the new version, so the first visit refetches its objects.
Release CI is generated by dist and publishes:
- GitHub release artifacts (for
cargo-binstalland shell installer) - Homebrew formula to
rgodha24/homebrew-tap - crates.io package via a custom publish job
Required repository secrets:
HOMEBREW_TAP_TOKEN: PAT with write access torgodha24/homebrew-tapCRATES_TOKEN: crates.io API token for publishingghfs
Release trigger:
git tag v0.0.1
git push --tagsFor non-Nix installs, use ghfs service to install/manage a user service:
ghfs service install
ghfs service statusLinux runtime requirements: /dev/fuse must exist and a fusermount helper (fusermount3 or
fusermount) must be installed.
Available commands:
ghfs service install [--no-start]
ghfs service uninstall
ghfs service start
ghfs service stop [--force]
ghfs service restart
ghfs service status
ghfs service logsCache maintenance:
ghfs gcghfs gc drops cached file contents unused for a week (they're
rebuilt from the local git objects on demand, without the network).
ghfs service install is idempotent. Running it again rewrites service config with the current
binary path and restarts the daemon.
After updating the ghfs binary, use one of:
ghfs service restartor:
ghfs service installrestart is the lightweight option when binary path is unchanged. install always works (it
rewrites service files, then starts/restarts).
This flake exports:
packages.<system>.default-ghfspackagedevShells.<system>.default- development shellhomeManagerModules.default- home-manager module (Linux + macOS)nixosModules.default- NixOS module (system-level Linux daemon)
Both module wrappers default services.ghfs.package to
self.packages.${pkgs.system}.default, so the daemon binary always comes from this flake.
Enable per-user service:
{
services.ghfs.enable = true;
}- Linux: creates
systemd.user.services.ghfs - macOS: creates
launchd.agents.ghfs
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
home-manager.url = "github:nix-community/home-manager";
ghfs.url = "github:rgodha24/ghfs";
};
outputs = { nix-darwin, home-manager, ghfs, ... }: {
darwinConfigurations.myMac = nix-darwin.lib.darwinSystem {
modules = [
home-manager.darwinModules.home-manager
{
home-manager.sharedModules = [ ghfs.homeManagerModules.default ];
home-manager.users.myuser = {
services.ghfs.enable = true;
};
}
];
};
};
}{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
ghfs.url = "github:rgodha24/ghfs";
};
outputs = { nixpkgs, home-manager, ghfs, ... }: {
nixosConfigurations.myBox = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
home-manager.nixosModules.home-manager
{
home-manager.sharedModules = [ ghfs.homeManagerModules.default ];
home-manager.users.myuser = {
services.ghfs.enable = true;
};
}
];
};
};
}Enable system daemon:
{
inputs.ghfs.url = "github:rgodha24/ghfs";
outputs = { nixpkgs, ghfs, ... }: {
nixosConfigurations.myBox = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
ghfs.nixosModules.default
{ services.ghfs.enable = true; }
];
};
};
}