cmd/irail/: CLI entrypointinternal/: implementationcmd/: command routing (kong CLI framework, 13 command files)api/: iRail API client + rate limitingtui/: terminal UI (Charmbracelet bubbletea)output/: time formatting + output renderingerrfmt/: error formatting
bin/: build outputs
make build: compile tobin/irailmake install: install to systemmake fmt/make lint/make test/make ci: format, lint, test, full local gatemake tools: install pinned dev tools into.tools/make clean: remove bin/ and .tools/
Note: Tests run with -race flag for race condition detection.
- Formatting:
make fmt(goimports local prefixgithub.com/dedene/irail-cli+ gofumpt) - Output: keep stdout parseable (
--json); send human hints/progress to stderr - Linting: golangci-lint with project config
- TUI: use Charmbracelet ecosystem (bubbletea)
- Unit tests: stdlib
testingwith-raceflag - Coverage areas: stations, time formatting, rate limiting
- 3 test files; focus on core logic
- No authentication: iRail is a public API
- Stateless: no config file needed
- Rate limiting: built-in to prevent API abuse
stations: station lookups and searchliveboard: live train departures/arrivalsconnections: train connections between stationscomposition: train composition detailsvehicle: vehicle/train informationdisturbances: service disruptions
- Conventional Commits:
feat|fix|refactor|build|ci|chore|docs|style|perf|test - Group related changes; avoid bundling unrelated refactors
- PR review: use
gh pr view/gh pr diff; don't switch branches
- No credentials to manage (public API)
- Rate limiting protects against accidental API abuse