Skip to content

feat(config): add 'tth config edit' and 'tth config path' #79

Description

@JoseVelazcoH

Problem

tth config can show, get, and set values, but there is no quick way to open the config file in an editor, nor to print its resolved path for scripting. Users must remember where the file lives (~/.config/thoth/config.toml, or wherever THOTH_CONFIG/XDG_CONFIG_HOME point).

Proposed solution

Add two small subcommands under tth config:

  • tth config edit - open the resolved config file in $EDITOR (or $VISUAL), creating it with defaults if absent.
  • tth config path - print the resolved config file path and exit.
tth config path        # /home/user/.config/thoth/config.toml
tth config edit        # opens $EDITOR on that file

Alternatives considered

  • Only path, let users pipe to their editor - discarded: edit is a common convenience (git, gh, cargo all have it).
  • Hardcode a default editor - discarded: respect $VISUAL/$EDITOR, fall back to a sensible default only if unset.

Acceptance criteria

  • tth config path prints the same path resolve_config_path() returns.
  • tth config edit opens $VISUAL/$EDITOR on that path.
  • edit creates the file with defaults first if it does not exist.
  • Missing editor env falls back gracefully (documented default) or errors clearly.
  • Tests cover path resolution and the missing-file-creates-default behavior.

Scope

cli (extend the ConfigAction enum), config (reuse resolve_config_path / ensure_default_config).

Additional context

The ConfigAction enum in src/cli.rs already has Print/Get/Set to copy from. resolve_config_path() and ensure_default_config() already exist in src/config.rs. Good first issue: follows an established pattern.

Activity

  1. rarestpreet commented on Jul 7, 2026

    @rarestpreet

    @JoseVelazcoH I think I might be able to contribute on this issue with some guidance. Can u assign it to me?

  2. JoseVelazcoH commented on Jul 7, 2026

    @JoseVelazcoH
    OwnerAuthor

    Yes, for sure!. If you have any questions, just let me know.

  3. rarestpreet commented on Jul 10, 2026

    @rarestpreet

    @JoseVelazcoH sorry but i wont be able to work on it right now, u can remove me from assignees.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions