Skip to content

Development Setup

Set up your development environment for envsecrets.

Prerequisites

  • mise — run mise install to set up Go 1.24 and golangci-lint v2
  • Docker (for integration tests)

Clone and Build

git clone https://github.com/charliek/envsecrets.git
cd envsecrets
make build

Running Tests

Unit Tests

make test

Integration Tests

Integration tests use testcontainers with fake-gcs-server:

make test-integration

All Checks

make check  # lint + test

Code Quality

Linting

make lint

Formatting

make fmt

Building Documentation

make docs-serve

Open http://127.0.0.1:7070 to preview.

Project Structure

envsecrets/
├── cmd/envsecrets/       # Entry point
├── internal/
│   ├── cli/              # Cobra commands
│   ├── config/           # Configuration management
│   ├── constants/        # Defaults and exit codes
│   ├── crypto/           # Age encryption
│   ├── domain/           # Types and errors
│   ├── git/              # Git operations
│   ├── project/          # Project discovery
│   ├── storage/          # GCS abstraction
│   ├── cache/            # Local cache
│   ├── sync/             # Push/pull orchestration
│   ├── ui/               # Terminal UI
│   └── version/          # Build info
├── test/integration/     # Integration tests
└── docs/                 # Documentation

Testing Strategy

  • Unit tests: Interface mocking, table-driven tests
  • Integration tests: testcontainers with fake-gcs-server
  • Git tests: go-git with memory storage

Making Changes

  1. Create a feature branch
  2. Make changes with tests
  3. Run make check
  4. Submit a pull request