Thank you for your interest in contributing to the LVT CLI!
# Clone the repository
git clone https://github.com/livetemplate/lvt.git
cd lvt
# Install dependencies
go mod download
# Install git hooks
./scripts/install-hooks.sh
# Run tests
go test ./...
# Build
go build -o lvt .
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix
If you're making changes that depend on unreleased core library changes, you have two options:
The easiest way - Go automatically uses local modules without any go.mod changes:
# From parent directory containing all repos
cd ..
./setup-workspace.sh
# Now test with local core library
cd lvt
go test ./... # Automatically uses ../livetemplate
The workspace setup is done once and affects all repositories. See the core library CONTRIBUTING.md for details.
If you prefer manual control:
# Enable local development mode
./scripts/setup-local-dev.sh
# Test with local core
go test ./...
# Revert to published version
./scripts/setup-local-dev.sh --undo
Directory structure for both methods:
parent/
├── livetemplate/ (core library)
├── lvt/ (this repo)
└── examples/ (optional)
# Run all tests
go test ./...
# Run with timeout
go test ./... -timeout=120s
# Run specific package
go test ./internal/generator -v
# Build to verify
go build -o lvt .
The repository has a pre-commit hook that will:
git add .
git commit -m "feat: add new feature"
Follow Conventional Commits:
feat: New featurefix: Bug fixdocs: Documentation changestest: Adding or updating testsrefactor: Code refactoringperf: Performance improvementschore: Build process or tooling changesgit push origin feature/your-feature-name
Then create a Pull Request on GitHub.
go fmt)lvt/
├── main.go # Entry point
├── commands/ # CLI commands
├── internal/ # Internal packages
│ ├── generator/ # Code generators
│ ├── kits/ # Kit system
│ ├── config/ # Configuration
│ ├── validator/ # Validation
│ └── serve/ # Development server
├── testing/ # Testing utilities
├── e2e/ # End-to-end tests
└── scripts/ # Build and release scripts
func TestGenerateResource(t *testing.T) {
// Arrange
gen := generator.New()
// Act
err := gen.GenerateResource("Post", fields)
// Assert
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
}
Add to internal/generator/:
// internal/generator/myfeature.go
func (g *Generator) GenerateMyFeature(name string) error {
// Implementation
}
Add to commands/:
// commands/mycommand.go
var myCmd = &cobra.Command{
Use: "my",
Short: "Description",
Run: runMy,
}
func runMy(cmd *cobra.Command, args []string) {
// Implementation
}
Kits are located in internal/kits/system/.
To add a new kit:
internal/kits/system/mykit/kit.yaml manifestLVT follows the core library's major.minor version:
Releases are automated via scripts/release.sh:
# Dry run
./scripts/release.sh --dry-run
# Actual release (maintainers only)
./scripts/release.sh
The script will:
When the core library changes:
Update for:
By contributing, you agree that your contributions will be licensed under the MIT License.