Skip to content

Improve error messages for common mistakes #5

Description

@selwyntheo

Several commands could have friendlier error messages for common user mistakes.

Examples to improve:

  • Running ctx pack without ctx init first → suggest running ctx init
  • Running ctx show with an invalid hash → explain the expected format (full hash, short prefix, or ctx:// URI)
  • Running ctx diff with only one argument → show usage hint
  • Running ctx replay on a non-existent hash → suggest ctx log to find valid hashes

Acceptance criteria:

  • Each improved error message includes a helpful suggestion
  • No existing tests break
  • Add test cases for at least 2 of the improved messages

Files to look at:

  • cmd/ctx/commands.go — command definitions and validation
  • internal/store/hash.go — hash parsing and resolution

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions