mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 17:14:28 +00:00
3.5 KiB
3.5 KiB
Contributing to Llamactl
Thank you for considering contributing to Llamactl! This document outlines the development setup and contribution process.
Development Setup
Prerequisites
- Go 1.24 or later
- Node.js 22 or later
llama-serverexecutable (from llama.cpp)
Getting Started
-
Clone the repository
git clone https://github.com/lordmathis/llamactl.git cd llamactl -
Install dependencies
# Go dependencies go mod download # Frontend dependencies cd webui && npm ci && cd .. -
Run for development
# Start backend server go run ./cmd/serverServer will be available at
http://localhost:8080# In a separate terminal, start frontend dev server cd webui && npm run devDevelopment UI will be available at
http://localhost:5173 -
Common development commands
# Backend go test ./... -v # Run tests go test -race ./... -v # Run with race detector go fmt ./... && go vet ./... # Format and vet code # Frontend (run from webui/ directory) npm run test:run # Run tests once npm run test # Run tests in watch mode npm run type-check # TypeScript type checking npm run lint:fix # Lint and fix issues
Before Submitting a Pull Request
Required Checks
All the following must pass:
-
Backend
go test ./... -v go test -race ./... -v go fmt ./... && go vet ./... go build -o llamactl ./cmd/server -
Frontend
cd webui npm run test:run npm run type-check npm run build
API Documentation
If changes affect API endpoints, update Swagger documentation:
# Install swag if needed
go install github.com/swaggo/swag/cmd/swag@latest
# Update Swagger comments in pkg/server/handlers.go
# Then regenerate docs
swag init -g cmd/server/main.go -o apidocs
Pull Request Guidelines
Pull Request Titles
Use this format for pull request titles:
feat:for new featuresfix:for bug fixesdocs:for documentation changestest:for test additions or modificationsrefactor:for code refactoring
Submission Process
- Create a feature branch from
main - Make changes following the coding standards
- Run all required checks listed above
- Update documentation if necessary
- Submit pull request with:
- Clear description of changes
- Reference to any related issues
- Screenshots for UI changes
Code Style and Testing
Testing Strategy
- Backend tests use Go's built-in testing framework
- Frontend tests use Vitest and React Testing Library
- Run tests frequently during development
- Add tests for new features and bug fixes
Go
- Follow standard Go formatting (
go fmt) - Use meaningful variable and function names
- Add comments for exported functions and types
- Handle errors appropriately
TypeScript/React
- Use TypeScript strictly (avoid
anywhen possible) - Follow React hooks best practices
- Use meaningful component and variable names
- Prefer functional components over class components
Getting Help
- Check existing issues
- Review the README.md for usage documentation
- Look at existing code for patterns and conventions
Thank you for contributing to Llamactl!