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.
cue macro addcurrently just prints success and does not write the new macro tomacros.toml, so the macro disappears after the CLI exits. There is even a// TODO: Persist to macros.tomlcomment incmd/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.LoadUserMacrosreads fromconfig.ConfigDir()), reload the registry, and leave the macro usable across sessions. A regression test that loadsmacros.toml, adds a macro, and checks the registry survives a restart would help lock in the behavior.