Skip to content

Latest commit

 

History

History
96 lines (71 loc) · 2.28 KB

File metadata and controls

96 lines (71 loc) · 2.28 KB

Development

This repository is a single Go module:

github.com/greenhost87/codex-session-toolkit

Each utility is implemented as a separate command under cmd/<tool-name>. Shared code belongs only in focused packages under internal/.

Requirements

  • Go 1.26, matching the go directive in go.mod.
  • golangci-lint 2.11.4 at $(go env GOPATH)/bin/golangci-lint for make lint.

Optional local security tooling:

go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...

If govulncheck is not installed, the vulnerability scan cannot run; there is no fallback scanner.

Local Runs

Run commands from the repository root:

go run ./cmd/thread-archiver
go run ./cmd/thread-archiver --dry-run=false

go run ./cmd/codex-db-state
go run ./cmd/codex-db-state --codex-home ~/.codex

Install from source when you intentionally want a Go-built local binary:

go install github.com/greenhost87/codex-session-toolkit/cmd/thread-archiver@latest
go install github.com/greenhost87/codex-session-toolkit/cmd/codex-db-state@latest

Checks

Run the test, build, vet, lint, and coverage checks from the repository root:

go test ./...
go test -cover ./...
go build ./cmd/...
go vet ./...
make lint

Releases

Pushing a tag named v* creates or updates a GitHub Release with macOS arm64 Release Assets for every command under cmd/. Each Utility is uploaded as a separate tar.gz archive, alongside SHA256SUMS.

Release Assets are built into dist/, which is ignored by git. To test the release build locally:

GITHUB_REF_NAME=v0.0.0-local GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 \
  zsh -euo pipefail <<'EOF'
rm -rf dist
mkdir -p dist
for cmd_dir in cmd/*; do
  test -d "$cmd_dir" || continue
  tool_name="$(basename "$cmd_dir")"
  asset_dir="dist/${tool_name}_${GITHUB_REF_NAME}_darwin_arm64"

  mkdir -p "$asset_dir"
  go build -trimpath -ldflags="-s -w" -o "$asset_dir/$tool_name" "./$cmd_dir"
  tar -C dist -czf "${asset_dir}.tar.gz" "$(basename "$asset_dir")"
  rm -rf "$asset_dir"
done

(
  cd dist
  shasum -a 256 *.tar.gz > SHA256SUMS
  shasum -a 256 -c SHA256SUMS
)
EOF

Maintenance Scripts

Operational maintenance scripts are documented in maintenance.md. Treat them as separate from normal binary usage.