diff --git a/internal/commands/templates.go b/internal/commands/templates.go index 4986a39a..45644253 100644 --- a/internal/commands/templates.go +++ b/internal/commands/templates.go @@ -144,10 +144,15 @@ func newTemplatesLibraryCmd() *cobra.Command { Long: "List the account's active to-do list templates.", RunE: func(cmd *cobra.Command, args []string) error { app := appctx.FromContext(cmd.Context()) - + persistentAccount := hasPersistentAccount(app.Config) if err := ensureAccount(cmd, app); err != nil { return err } + contextArgs := templateCommandContextArgs( + app.Config.ActiveProfile, + persistentAccount, + app.Config.AccountID, + ) library, err := app.Account().Templates().GetLibrary(cmd.Context()) if err != nil { @@ -169,7 +174,7 @@ func newTemplatesLibraryCmd() *cobra.Command { output.WithBreadcrumbs( output.Breadcrumb{ Action: "copy", - Cmd: "basecamp templates copy --in ", + Cmd: "basecamp templates copy --in " + contextArgs, Description: "Copy a template into a project", }, ), diff --git a/internal/commands/templates_test.go b/internal/commands/templates_test.go index c6d3881c..cc0b5123 100644 --- a/internal/commands/templates_test.go +++ b/internal/commands/templates_test.go @@ -72,6 +72,8 @@ func TestTemplatesLibraryUsesSDKLibraryEndpoint(t *testing.T) { body: templateLibraryJSON, }) buf := captureTemplateOutput(app) + app.Config.ActiveProfile = "work profile" + app.Config.Sources = map[string]string{"account_id": string(config.SourceFlag)} err := executeRecordingCommand(NewTemplatesCmd(), app, "library") require.NoError(t, err) @@ -82,7 +84,7 @@ func TestTemplatesLibraryUsesSDKLibraryEndpoint(t *testing.T) { envelope := decodeTemplateEnvelope(t, buf) assert.Equal(t, "1 active to-do list templates", envelope.Summary) require.Len(t, envelope.Breadcrumbs, 1) - assert.Equal(t, "basecamp templates copy --in ", envelope.Breadcrumbs[0].Cmd) + assert.Equal(t, "basecamp templates copy --in --profile 'work profile' --account 99999", envelope.Breadcrumbs[0].Cmd) } func TestTemplatesLibraryHumanOutputShowsCopyableID(t *testing.T) {