Skip to content

[Feature] Persist custom macros to macros.toml #4

@GyaneshSamanta

Description

@GyaneshSamanta

cue macro add currently just prints success and does not write the new macro to macros.toml, so the macro disappears after the CLI exits. There is even a // TODO: Persist to macros.toml comment in cmd/macro.go (line ~65) where this work belongs.

A contribution here would append the submitted macro definition to the user macros file (the same one that internal/macro.LoadUserMacros reads from config.ConfigDir()), reload the registry, and leave the macro usable across sessions. A regression test that loads macros.toml, adds a macro, and checks the registry survives a restart would help lock in the behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions