Development Setup
Prerequisites
Section titled “Prerequisites”- mise (tool version manager)
- Go 1.22+ (installed via mise)
- Git
Quick Setup
Section titled “Quick Setup”git clone https://github.com/n24q02m/skret.gitcd skretmise installmise run setupThe mise run setup command runs:
mise install— installs Go and golangci-lint at pinned versionsgo mod download— fetches Go dependenciespip install pre-commit— installs the pre-commit frameworkpre-commit install— registers the pre-commit hookpre-commit install --hook-type commit-msg— registers the commit-msg hook (enforcesfeat:/fix:prefix)
Manual Setup
Section titled “Manual Setup”If you prefer not to use mise:
# Install Go 1.22+ from https://go.dev/dl/go mod download
# Install pre-commitpip install pre-commitpre-commit installpre-commit install --hook-type commit-msg
# Install golangci-lintgo install github.com/golangci/golangci-lint/cmd/golangci-lint@latestgo build -o skret ./cmd/skretThe binary is output to ./skret in the project root.
# Run all testsgo test -race -cover ./...
# Run tests with verbose outputmise run test
# Run tests for a specific packagego test -race -cover ./internal/config/...# Run all lintersgolangci-lint run ./...
# Auto-fix formatting issuesmise run fix
# Or manuallygofmt -w .golangci-lint run --fix ./...Pre-Commit Hooks
Section titled “Pre-Commit Hooks”The repo uses these hooks (run automatically on git commit):
| Hook | Description |
|---|---|
trailing-whitespace | Removes trailing whitespace |
end-of-file-fixer | Ensures files end with a newline |
check-yaml | Validates YAML syntax |
check-added-large-files | Prevents committing large files |
enforce-commit | Rejects commits without feat: or fix: prefix |
Run hooks manually:
pre-commit run --all-filesProject Structure
Section titled “Project Structure”cmd/skret/ -- CLI entry point (Cobra)internal/cli/ -- Command implementationsinternal/config/ -- .skret.yaml schema + loader + resolverinternal/provider/ -- SecretProvider interface + registryinternal/provider/aws/ -- AWS SSM Parameter Storeinternal/provider/local/-- Local YAML file (dev/test)internal/importer/ -- Import from Doppler/Infisical/dotenvinternal/syncer/ -- Sync to GitHub Actions/dotenvinternal/exec/ -- env injection + process execinternal/logging/ -- Structured logging (slog)pkg/skret/ -- Public Go library APItests/ -- Integration and E2E testsdocs/ -- VitePress documentation siteRunning the Docs Site
Section titled “Running the Docs Site”cd docsnpm installnpm run devThe site runs at http://localhost:5173.