Skip to content

feat: Implement Global Tool Configuration via .same/config.yaml #67

@drlucaa

Description

@drlucaa

Currently, the behavior of the same CLI is primarily driven by task-specific configurations in same.yaml or workspace-wide settings in same.work.yaml. We need to introduce a dedicated global configuration file located at .same/config.yaml to control the tool's internal behavior.

The first priority for this configuration is version validation. This will allow teams to pin a specific version of the same binary for a project. If a developer runs the project with a different version of the CLI, the tool should issue a warning to ensure consistency across environments, fulfilling our brand promise of reliability and determinism.

Goals

  • Establish a pattern for global tool configuration following Clean Architecture principles.
  • Provide a mechanism to enforce or suggest specific CLI versions for a repository.
  • Ensure the configuration is discoverable in both standalone and workspace modes.

Acceptance Criteria

1. Configuration Loading

  • The CLI must attempt to load .same/config.yaml during initialization.
  • In a workspace setup, the file should be searched for relative to the workspace root defined in same.work.yaml.
  • In standalone mode, it should be searched for in the .same directory relative to the same.yaml.
  • The configuration must be unmarshaled into a new SameConfig domain model.

2. Version Validation logic

  • The config.yaml must support a top-level version field (e.g., version: "0.1.0").
  • The tool must compare this value against the internal build.Version.
  • If the versions do not match, a warning must be printed to stderr using the standard logger.
  • The CLI must continue execution after the warning (non-breaking validation).

3. Technical Standards

  • Implementation must use go.trai.ch/zerr for any loading errors.
  • The loading logic must be added as a port in internal/core/ports and implemented in internal/adapters/config.
  • All new logic must be verified with nix develop -c go test -race ./cli/....
  • Documentation in docs/ must be updated to include the new configuration file schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions