Skip to content

refactor: rename add command to register (backward compatible)#18

Merged
andhijeannot merged 2 commits intomainfrom
001-rename-add-to-register
Oct 22, 2025
Merged

refactor: rename add command to register (backward compatible)#18
andhijeannot merged 2 commits intomainfrom
001-rename-add-to-register

Conversation

@andhijeannot
Copy link
Copy Markdown
Member

Summary

Renames the ason add command to ason register for better semantic clarity while maintaining full backward compatibility through a command alias.

Changes

Code Updates

  • ✅ Renamed addCmdregisterCmd with add alias for backward compatibility
  • ✅ Updated all variables: addDescriptionregisterDescription, etc.
  • ✅ Renamed function: runAdd()runRegister()
  • ✅ Updated all user-facing messages to use "register" terminology
  • ✅ Updated command registration and completion functions

Test Updates

  • ✅ Renamed all test functions to match new naming
  • ✅ Added TestRegisterCmdAliasWorks to verify backward compatibility
  • ✅ All tests passing (except 1 pre-existing unrelated failure)

Documentation Updates

  • ✅ Renamed docs/commands/add.mddocs/commands/register.md
  • ✅ Updated 50+ occurrences of ason add to ason register across 11 files
  • ✅ Updated all cross-references and getting-started guides
  • ✅ Created CHANGELOG.md with proper entry

Backward Compatibility

The add command still works via Cobra's alias mechanism:

  • ason add my-template /path → works identically to ason register
  • ason add --help → shows register command help
  • Zero breaking changes for existing users

Testing

# All tests passing
✅ go test ./cmd -v
✅ go build -o ason .

# Manual verification
✅ ./ason register --help  # Shows correct usage
✅ ./ason add --help       # Alias works!
✅ ./ason --help           # Shows "register" as primary command

Constitution Compliance

  • I. Simplicity: No new dependencies added
  • II. Security: No security implications
  • III. Test-Driven Quality: All tests updated and passing
  • IV. Clear Documentation: Complete documentation updates
  • V. Template Engine Agnosticism: No impact on template layer

Files Changed

Code (6 files):

  • cmd/commands.go, cmd/commands_test.go
  • cmd/completion.go, cmd/completion_test.go
  • cmd/root.go, cmd/root_test.go

Documentation (10+ files):

  • Renamed: docs/commands/add.mddocs/commands/register.md
  • Updated: All command docs and getting-started guides
  • Created: CHANGELOG.md

Why This Change?

The term "register" better describes the action of adding a template to the local registry, improving semantic clarity for new users while maintaining existing workflows for current users.

Related

  • Spec: specs/001-rename-add-to-register/spec.md
  • Plan: specs/001-rename-add-to-register/plan.md
  • Tasks: specs/001-rename-add-to-register/tasks.md (87/87 completed ✅)

@andhijeannot andhijeannot force-pushed the 001-rename-add-to-register branch from 1e0b6d4 to be06fa5 Compare October 22, 2025 18:05
- Renamed 'ason add' to 'ason register' for better semantic clarity
- Added 'add' as an alias for backward compatibility
- Updated all code references (registerCmd, registerDescription, etc.)
- Updated all documentation to use 'register' as primary command
- Renamed docs/commands/add.md to docs/commands/register.md
- Updated all cross-references in documentation
- All tests updated and passing
- Constitution compliant: no new dependencies, tests maintained, docs updated

Closes #1-rename-add-to-register
@andhijeannot andhijeannot force-pushed the 001-rename-add-to-register branch from be06fa5 to 3c61ec4 Compare October 22, 2025 18:07
…acOS

- Reorganized installation section by platform (macOS, Linux, Windows)
- Highlighted Homebrew as recommended method for macOS
- Clarified package manager options for Linux distributions
- Improved Quick Start section with practical examples
- Updated commands to use 'register' instead of 'add'
@andhijeannot andhijeannot merged commit a7a533f into main Oct 22, 2025
@andhijeannot andhijeannot deleted the 001-rename-add-to-register branch October 22, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant