This document provides an overview of how to contribute to the flow project, including setting up your development environment, understanding the project structure, and running tests.
Before getting started, please read our Code of Conduct and Contributing Guidelines.
Ways to Contribute
- Report bugs - Open an issue with reproduction steps
- Suggest features - Share ideas for new functionality
- Improve documentation - Fix typos, add examples, or clarify explanations
- Write code - Fix bugs, implement features, or optimize performance
- Share examples - Contribute to the examples repository
Prerequisites
- Go - See go.mod for the required version
- flow CLI - Install the latest version before developing
# Clone and set up the repository
git clone https://github.com/flowexec/flow.git
cd flow
# Register the repo as a flow workspace
flow workspace add flow . --set
# Install development dependencies
flow install tools
# Verify everything works
flow validateThe flow project uses flow itself for development! Here are the key commands:
# Build the CLI binary
flow build binary ./bin/flow
# Run all validation (tests, linting, code generation)
flow validate
# Run specific checks
flow test all # All tests
flow generate # Code generation
flow run lint # Linting only
# Install/update Go tools
flow install toolsflow/
├── .execs/ # Development workflows
├── cmd/ # CLI entry point
├── docs/ # Documentation
├── internal/ # Core application logic
│ ├── cache/ # Executable and workspace caching logic
│ ├── context/ # Global application context
│ ├── io/ # Terminal user interface and I/O
│ ├── runner/ # Executable execution engine
│ ├── services/ # Business logic services
│ ├── templates/ # Templating system for workflows
│ └── vault/ # Secret management
├── tests/ # CLI end-to-end test suite
└── types/ # Generated types from schemas
Some directories are omitted for brevity.
flow uses code generation extensively:
Types are generated from YAML schemas using go-jsonschema:
# Regenerate types after schema changes
flow generate cliImportant: When modifying types, edit the schemas/*.yaml files, not the generated Go files in types/.
CLI and type documentation is generated automatically:
# Updates both CLI docs and type reference docs
flow generate docsflow uses tuikit for terminal interface development:
Local Development
# Link to local tuikit for development
go mod edit -replace github.com/flowexec/tuikit=../tuikit
# Test TUI changes
flow build binary ./bin/flow-dev
./bin/flow-dev browseThese are installed automatically by flow install tools:
- mockgen - Generate test mocks
- golangci-lint - Code linting
- go-jsonschema - Generate Go types from YAML schemas
- goreleaser - Release automation
- ginkgo - BDD testing framework