Contributing to Glean CLI
March 24, 2026 ยท View on GitHub
Thank you for your interest in contributing to the Glean CLI! This document provides guidelines and instructions for contributing.
Development Setup
Prerequisites
- Go 1.25 or higher
- mise (tool and task runner)
- Git
Getting Started
- Fork and clone the repository:
git clone https://github.com/YOUR-USERNAME/glean-cli.git
cd glean-cli
- Install development dependencies:
mise run setup
- Build the project:
mise run build
Development Workflow
- Create a new branch for your changes:
git checkout -b feature/your-feature-name
-
Make your changes, following our coding standards and practices.
-
Run tests:
# Run tests with verbose output
mise run test
# Run tests with colorized summary
mise run test:summary
# Run all checks (lint + test + build)
mise run test:all
- Run linters:
# Run linter
mise run lint
# Run linter with auto-fix
mise run lint:fix
- Install locally to test your changes:
mise run install
- Commit your changes using conventional commit messages:
git commit -m "feat: add new feature"
git commit -m "fix: resolve issue with X"
Available Tasks
Run mise tasks to see all available tasks. Common tasks include:
mise run setup: Install required development dependenciesmise run build: Build the CLImise run test:all: Run all checks (used in CI)mise run lint: Run lintersmise run lint:fix: Run linters with auto-fixmise run install: Install the CLI locallymise run clean: Clean build artifactsmise run docs:check: Verify README code blocks match snippet filesmise run docs:sync: Sync README code blocks from snippet files
Pull Request Process
- Update documentation (README.md, code comments) if you're changing functionality. README code examples live in
snippets/โ edit the.shfiles there, then runmise run docs:syncto update the README. - Add tests for any new features.
- Ensure all tests pass and linters are clean.
- Push your changes and create a pull request.
- Fill out the pull request template with all required information.
Code Style
- Follow standard Go conventions and idioms
- Use meaningful variable and function names
- Add comments for public APIs and complex logic
- Keep functions focused and concise
- Write tests for new functionality
Testing
- Write unit tests for new features
- Use table-driven tests where appropriate
- Mock external dependencies
- Aim for high test coverage of critical paths
- Test both success and error cases
Documentation
- Update README.md for user-facing changes
- Add godoc comments for exported functions and types
- Include examples in documentation where helpful
- Keep documentation up to date with code changes
Release Process
- Update version numbers in relevant files
- Create a new release tag
- Build and publish new artifacts
Getting Help
- Open an issue for bugs or feature requests
- Ask questions in pull requests
- Be respectful and constructive in discussions
License
By contributing to Glean CLI, you agree that your contributions will be licensed under the MIT License.