Skip to content

feat: Add user-defined shortcode aliases #139

Description

@raiderrobert

Problem

The built-in shortcodes (gh:, gl:, bb:) are convenient, but users often work with other Git hosts or custom organizations and want their own shorthand. Currently there is no way to add new ones without modifying the code.

Proposed feature

Allow users to define custom shortcodes in their config:

[shortcodes]
gh = \"github.com\"
gl = \"gitlab.com\"
bb = \"bitbucket.org\"
work = \"git.company.com\"
upstream = \"github.com/upstream-org\"

These would work like the built-ins:

diecut new gh:user/project
diecut new work:team/scaffold
diecut new upstream:shared/template

CLI helpers

diecut shortcode add gh --host=github.com
diecut shortcode add work https://git.company.com
diecut shortcode remove gh
diecut shortcode list

Design notes

  • User shortcodes coexist with built-in shortcodes
  • Cannot shadow built-in shortcodes (reject at shortcode add time)
  • Built-in shortcodes take precedence if names conflict
  • Shortcode can be a simple host or a full URL prefix

Acceptance criteria

  • [shortcodes] config section parsed
  • Custom shortcode resolution in diecut new pipeline
  • diecut shortcode {add, remove, list} subcommands
  • Shadow-name guards for built-in shortcodes
  • Tests
  • Docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions