chezget

command module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 5 Imported by: 0

README

chezget

chezget is a small companion tool for chezmoi. While chezmoi manages your dot files, chezget installs the Go and Rust applications that those dot files depend on. It reads a single INI configuration file listing packages and runs the appropriate package manager (go install or cargo install) for each entry.

Configuration

chezget follows the XDG Base Directory Specification. The configuration file is expected at:

$XDG_CONFIG_HOME/chezget/config.ini

falling back to ~/.config/chezget/config.ini when XDG_CONFIG_HOME is unset. The path can also be overridden with the CHEZGET_CONFIG environment variable or the --config flag.

Format

The file is a minimal INI dialect. Each section corresponds to an installer; chezget ships with [go] (installed via go install <spec>) and [rust] (installed via cargo install <spec>). Each non-empty, non-comment line under a section is a package specification understood by the corresponding package manager. Lines starting with # or ; are comments.

# Go packages (installed via `go install <spec>`)
[go]
github.com/jesseduffield/lazygit@latest
golang.org/x/tools/cmd/goimports

# Rust crates (installed via `cargo install <spec>`)
[rust]
ripgrep
kotlin-lsp

For the example above, chezget runs:

go install github.com/jesseduffield/lazygit@latest
go install golang.org/x/tools/cmd/goimports
cargo install ripgrep
cargo install kotlin-lsp

Unknown sections are ignored so the file can carry extra notes without breaking the parser.

Installation

From source
go install github.com/alexript/chezget@latest
Build locally
git clone https://github.com/alexript/chezget.git
cd chezget
make build      # produces a ./chezget binary (or: go build -o chezget .)
make install    # installs into $(go env GOPATH)/bin
Cross-platform builds

chezget builds and runs on Linux, macOS, Windows, and FreeBSD for both amd64 and arm64. To produce binaries for every supported platform:

make cross      # writes dist/chezget-<os>-<arch>[.exe]

Usage

chezget                 # install everything listed in the config file
chezget --config FILE   # use a specific config file
chezget --version       # print the version

Exit status is 0 when every package installs successfully, and 1 when the configuration cannot be loaded or at least one installation fails. A failure on one package does not stop the remaining packages from being installed.

Development

make test        # run the unit tests
make cover       # run tests with coverage and print a summary
make cover-html  # generate an HTML coverage report in coverage.html
make vet         # run go vet
make fmt         # format the source tree

The project has no external runtime dependencies: the configuration parser is self-contained and the only commands it shells out to are go and cargo, which must be installed and available on PATH for chezget to do its job.

Project layout

main.go              entrypoint
internal/app/         CLI orchestration (loads config, runs installers)
internal/config/      INI parser and XDG path resolution
internal/installer/   installer interface and implementations
                         (go_installer.go, rust_installer.go)
internal/runner/      command-execution abstraction (for testability)

License

MIT © Alex 'Ript' Malyshev

Adding a new installer

Each installer lives in its own file under internal/installer/ and implements the Installer interface (Name() + Install()). To add support for a new package manager:

  1. Create internal/installer/<name>_installer.go with a type implementing Installer. The value returned by Name() is also the config section header that groups specs for this installer.
  2. Add the constructor to DefaultInstallers in installer.go.

No changes to the config parser or app orchestration are needed: recognized sections are derived from the registered installers automatically.

Documentation

Overview

Package main is the entrypoint for the chezget command.

chezget is a companion to chezmoi: it reads a small INI configuration file listing Go and Rust packages and runs `go install` / `cargo install` for each entry. See the project README for the configuration file format.

Directories

Path Synopsis
internal
app
Package app wires together the config loader and the installers and is the single place where the CLI-level orchestration lives.
Package app wires together the config loader and the installers and is the single place where the CLI-level orchestration lives.
config
Package config loads and parses the chezget configuration file.
Package config loads and parses the chezget configuration file.
installer
Package installer turns package specifications loaded from the chezget configuration file into concrete invocations of the appropriate package managers.
Package installer turns package specifications loaded from the chezget configuration file into concrete invocations of the appropriate package managers.
runner
Package runner provides an abstraction over spawning external commands so that callers can be unit-tested without touching the real process tree.
Package runner provides an abstraction over spawning external commands so that callers can be unit-tested without touching the real process tree.

Jump to

Keyboard shortcuts

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