Development
Building
bash
go build -o mctui main.goRunning
bash
go run main.goProject Layout
The codebase follows Go standard layout conventions using an internal/ directory to encapsulate domain logic.
text
/
├── main.go # UI Entrypoint (Bubble Tea)
└── internal/
├── config/ # Persistence & Paths
├── fabric/ # Modloader API
├── java/ # JRE Discovery
├── launcher/ # Execution Engine
├── mojang/ # Vanilla API & Downloads
├── nbt/ # Binary Parser
├── roadmap/ # GitHub Integration
├── ui/ # TUI State Machine & Views
└── worlds/ # Saves MetadataContributing
- Adhere to the Single Responsibility Principle (SRP).
- Do not introduce CGO or external dependencies unless strictly necessary.
- Keep the UI layer separate from domain logic.
Coding Standards
- UI State Machine: UI changes must occur through the Bubble Tea
Updatefunction altering the currentstate. - Input Validation: Network-sensitive inputs (like LAN names) must be strictly validated before storage.
- ANSI Styling: Use
lipglossexclusively. Avoid raw ANSI escapes. Clean concatenations to prevent color bleed. - Concurrency: Always use buffered channels acting as semaphores for network calls to avoid file descriptor exhaustion.
Release Process
- Update Roadmap: Ensure
roadmap.jsonand the embedded fallback ininternal/roadmap/roadmap.goare up to date. - Cross-compile Binaries: Compile utilizing size optimization flags:
- Linux:
go build -ldflags="-s -w" -o mctui-linux-amd64 main.go - Windows:
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o mctui-windows-amd64.exe main.go
- Linux:
- Publish: Tag the release, publish the notes on GitHub, and attach both generated binaries.