Skip to content

feat: named template bookmarks in user config #136

Description

@raiderrobert

Problem

Power users frequently install the same handful of templates and don't want to retype shortcodes/URLs. Shell aliases don't cross machines, and the existing [abbreviations] table is a prefix URL-rewriter — not a name-to-URL bookmark.

Proposed feature

A new [templates] section in ~/.config/diecut/config.toml:

[templates]
rust-cli = "gh:raiderrobert/templates/rust-cli"
py-pkg   = "https://github.com/raiderrobert/python-package-template"
work     = "https://git.company.com/platform/scaffold.git"

Resolution: diecut new rust-cli → looks up rust-cli in [templates] → value is resolved via the normal pipeline (shortcode, URL, or local path) → clone.

CLI helpers:

diecut alias add rust-cli gh:user/templates/rust-cli
diecut alias remove rust-cli
diecut alias list

Design notes

  • [templates] is distinct from [abbreviations] — one is exact-name lookup, the other is prefix rewriting. Both coexist.
  • Recursive resolution of a bookmark value is restricted to one level (a bookmark can't point at another bookmark) to prevent cycles.

Open questions

  • Precedence vs. shortcodes: if a bookmark is named gh, does it shadow the gh: prefix? Lean: reserve names matching known prefixes, reject at alias add time.
  • alias add without a name → auto-derive from last path segment of URL?

Acceptance criteria

  • [templates] config section parsed
  • Name-based lookup in diecut new pipeline
  • diecut alias {add, remove, list} subcommands
  • Cycle / shadow-name guards
  • Tests
  • Docs

Activity

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions