Thanks for contributing to lstk! This document covers contribution guidelines for the lstk CLI.
- Go 1.21+ (or latest stable)
- Docker (for integration tests)
- Make
make build # Compiles to bin/lstkmake test # Run unit tests (cmd/ and internal/) via gotestsum
make test-integration # Run integration tests (requires Docker)
make lint # Run golangci-lintTo run a single integration test:
make test-integration RUN=TestStartCommandSucceedsWithValidToken- Comments: only for non-obvious "why" decisions
- Error handling: always check returned errors (except in tests)
- No package-level global variables; use constructors and dependency injection
- No direct stdout/stderr printing; use
output.Sinkfor user output,log.Loggerfor diagnostics
cmd/— CLI wiring only (Cobra), no business logicinternal/— all business logic:container/— emulator container handlingruntime/— container runtime abstraction (Docker)auth/— authentication (env token, keyring, browser login)config/— Viper-based TOML configoutput/— event/sink system for CLI/TUI renderingui/— Bubble Tea viewsupdate/— self-update logiclog/— internal diagnostic logging
See CLAUDE.md for full architecture details.
Use the skill:
/add-command <name>
This scaffolds a new CLI subcommand with proper wiring, domain logic, and tests.
Use the skill:
/add-event <EventName>
This adds a new typed event to the output/ event system.
Use the skill:
/add-component <name>
This scaffolds a new Bubble Tea TUI component.
- Prefer integration tests for most behavior
- Unit tests for isolated logic where integration is impractical
- When fixing a bug, always add an integration test that reproduces the scenario
- Fork the repository
- Create a feature branch from
main - Run
make lintandmake testbefore submitting - Review your own PR first — run
/review-pr <number> - Open a PR against
main
Check README.md for usage docs and CLAUDE.md for architecture.