Skip to content

Implement devlog config set, get, and list #7

Description

@gustmrg

Implement the devlog config command documented in README.md.

Context:

  • README.md documents:
    • devlog config set <key> <value>
    • devlog config get <key>
    • devlog config list
  • The current cmd/config.go command is only a stub and does not implement any subcommands
  • The project already uses Viper and writes initial config in internal/store/store.go

Expected behavior:

  • devlog config set <key> <value> updates configuration and persists it to ~/.devlog/config.json
  • devlog config get <key> prints the current value for a supported key
  • devlog config list prints the current configuration in a readable format

Supported keys should include the documented config values, including:

  • defaults.project
  • defaults.style
  • defaults.language
  • llm.enabled
  • llm.provider
  • llm.model
  • llm.apiKeyEnvVar

Implementation notes:

  • Align CLI key names with the actual config structure used in code and docs
  • Validate unknown keys and invalid value types with clear error messages
  • Support boolean parsing for keys like llm.enabled
  • Ensure changes are written back safely without corrupting the existing config file

Acceptance criteria:

  • devlog config set, get, and list exist and appear in help output
  • Config values persist correctly to ~/.devlog/config.json
  • Unknown keys return a clear error
  • Boolean and string values are parsed correctly
  • Behavior matches the README documentation

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions