This project implements hotenv, a tool for caching environment
variables in a local per-session server. The full specification is in
SPEC.md.
- Language: Go
- CLI Framework: Kong (github.com/alecthomas/kong)
- Testing: testscript (for CLI integration tests)
.
├── hotenv.go # Main implementation (single file)
├── hotenv_test.go # Test harness (TestScript)
├── tests/*.txtar # Tests
└── SPEC.md # Early specification (might be outdated)
The entire program is implemented in a single Go file with:
- Kong CLI definition with all subcommands and flags
- Complete implementation of all hotenv functionality
- Comments to guide code reviewers through the implementation
Run all tests (hotenv_test.go with go test).
The just check command should pass after every change. It runs:
- Code formatting (gofmt)
- Linting (golangci-lint)
- All tests (with --timout 10s)
When writing or modifying tests in tests/*.txtar:
Avoid --timeout in tests - these slow down the test suite. Instead,
use named background processes with kill to stop the server when done.
# Start server with a name
exec hotenv serve --force -q &serve&
# ... run tests ...
# Signal the named server and wait for termination
kill -INT serve
wait serve