-
Notifications
You must be signed in to change notification settings - Fork 0
Development
iDorgham edited this page Nov 28, 2025
·
3 revisions
Complete guide for contributors to DoPlan CLI development.
- Go >= 1.23.0
- Git (for version detection)
- Make (optional, for build commands)
# Build for current platform
make build
# Or use Go directly
go build -o doplan ./cmd/doplan# Using Make
make build-all
# Or using build script
bash scripts/build.sh
# On Windows
scripts\build.bat# Set version explicitly
VERSION=1.0.0 make build
# Or with Go (resolve module path dynamically to keep casing accurate)
MODULE_PATH=$(go list -m)
go build -ldflags "-X ${MODULE_PATH}/internal/version.Version=1.0.0" -o doplan ./cmd/doplangit clone https://github.com/DoPlan-dev/CLI.git
cd CLIgo mod downloadmake build./doplan --versionCLI/
├── cmd/doplan/ # Main application entry point
├── internal/
│ ├── cli/ # CLI command definitions
│ ├── tui/ # Terminal UI (Bubbletea)
│ ├── generator/ # Project generation logic
│ └── rules/ # Rules library management
├── pkg/models/ # Data models
├── scripts/ # Build and utility scripts
├── docs/ # Documentation
└── test/ # Test files
-
cmd/doplan/main.go- Application entry point -
internal/cli/root.go- CLI root command -
internal/tui/wizard.go- TUI wizard -
internal/generator/generator.go- Main generator -
internal/rules/rules.go- Rules extraction
make test
# Or
go test ./...make test-coverage
# Or
go test -cover ./...go test -run TestName ./internal/generatorgo test -tags=integration ./...Enable debug logging:
export DOPLAN_DEBUG=1
./doplan# Install Delve
go install github.com/go-delve/delve/cmd/dlv@latest
# Debug
dlv debug ./cmd/doplanAdd debug prints:
if os.Getenv("DOPLAN_DEBUG") == "1" {
fmt.Printf("Debug: %v\n", value)
}Update version in:
internal/version/version.gopackage.json
Add release notes to CHANGELOG.md
git tag -a v1.0.0 -m "Release v1.0.0"
git push origin v1.0.0The release workflow automatically:
- Builds binaries for all platforms
- Creates GitHub Release
- Uploads binaries and checksums
git checkout -b feature/your-feature- Write code
- Add tests
- Update documentation
make test
make buildUse Conventional Commits:
git commit -m "feat: add new feature"git push origin feature/your-featureCreate pull request on GitHub.
-
Add Agent Definition:
// In internal/generator/agents.go { Name: "New Agent", Role: "Agent role", // ... }
-
Create Agent Template:
// In internal/generator/agents.go func generateNewAgent() string { // Agent template }
-
Test:
go test ./internal/generator
-
Add Command Definition:
// In internal/generator/commands.go { Name: "newcommand", Trigger: "/newcommand", // ... }
-
Create Command Template:
// In internal/generator/commands.go func generateNewCommand() string { // Command template }
-
Test:
go test ./internal/generator
-
Add Rule File:
internal/rules/library/XX-category/new-rule.md -
Update Rules: Rules are automatically embedded via
//go:embed -
Test:
go test ./internal/rules
Solution:
- Check Go version:
go version - Update dependencies:
go mod download - Clean build:
make clean && make build
Solution:
- Run tests individually:
go test -v ./internal/generator - Check test files for issues
- Verify test data
Solution:
- Check embedded files size
- Optimize rules library
- Use compression if needed
make fmt
# Or
go fmt ./...make lint
# Or
golangci-lint run- Follow Effective Go
- Use
gofmtfor formatting - Document exported functions
- Write tests for new code
- Contributing Guide - How to contribute
- API Reference - API documentation
- Project Structure - System architecture and structure
- Home - Wiki home page
Last Updated: 2025
Maintained By: Documentation Team