byob-go-cli

Decisions

21 category epics, each grouping a handful of decisions in the Problem / Idea / Tradeoffs / Sketch shape.

  • Agent onboarding

    You are working inside a forked copy of byob-go-cli, a personal template repository for Go CLI tools. The beads database you're looking at contains the template's architectural decisions alongside the tasks for this specific project.

    0 decisions
  • Command shape

    Options struct + NewCmdXxx constructor + pure runFunc three-part separation.

    6 decisions
  • Config

    Layered, lazily loaded configuration with discovery and provenance.

    3 decisions
  • Errors

    Semantic error types mapped to exit codes by the top-level runner.

    4 decisions
  • Factory + DI

    Central factory struct with lazy-loaded dependencies passed into every command.

    1 decision
  • HTTP client

    A single *http.Client on the Factory, built from a composable http.RoundTripper middleware chain; deterministic httptest seams in tests.

    5 decisions
  • Input validation

    Defense against untrusted input beyond the flag-value checks already in byob-errors.1: path traversal, config-shape validation, shell injection, SQL injection, and enum/range checks at the Options boundary.

    5 decisions
  • Interfaces

    Interface-driven seams for swappable implementations and test doubles.

    3 decisions
  • IOStreams

    Single abstraction for stdin/stdout/stderr with TTY detection and color support.

    3 decisions
  • Layout

    Conventional directory split and cobra command grouping.

    1 decision
  • Lifecycle

    Process-lifecycle and cancellation: signal handling, context propagation through runFuncs.

    3 decisions
  • Logging

    Structured, contextual, leveled logging threaded through every command without ceremony.

    4 decisions
  • Output

    TTY-adaptive human output plus first-class structured export.

    3 decisions
  • Progress

    Adaptive progress that looks right on a TTY and degrades off-TTY. Spinners for unknown-total, bars for known-total.

    4 decisions
  • Prompter

    Narrow Prompter interface on the Factory with TTY detection, scripted test double, and a library pick that won't rot.

    5 decisions
  • Release

    Pure-Go discipline (CGO_ENABLED=0, go:embed) as the foundation; Makefile+ldflags for day-to-day builds; goreleaser for tag-triggered cross-compile, archives, checksums, optional homebrew/nfpm channels. Both paths inject the same ldflags vars so version output is path-independent.

    10 decisions
  • Runtime directories

    Per-OS directories for cache, state, and data (config is covered in byob-config), plus the atomic-write discipline that keeps them consistent under concurrent invocations.

    4 decisions
  • Security

    Supply-chain and secret-handling posture: pin by hash not tag, scan for known CVEs on every push, ship SBOMs and signatures from the release pipeline, and refuse to accept secrets as flag values.

    5 decisions
  • Storage

    Multi-engine persistent storage for CLI state: sqlite + postgres behind a consumer-scoped Store interface. CockroachDB rides the postgres wire protocol.

    6 decisions
  • Testing

    Test-first command structure: runF injection, in-memory IO, test doubles.

    4 decisions
  • User docs

    Narrative user docs distinct from generated reference (byob-output.3). README carries orient-and-quickstart only; --help Long/Example fields carry the detailed reference; narrative docs cover concepts and troubleshooting. Release notes come from git history, not a hand-maintained CHANGELOG.

    5 decisions