MCPcopy Create free account
hub / github.com/auth0/auth0-cli / showAppCmd

Function showAppCmd

internal/cli/apps.go:334–383  ·  view source on GitHub ↗
(cli *cli)

Source from the content-addressed store, hash-verified

332}
333
334func showAppCmd(cli *cli) *cobra.Command {
335 var inputs struct {
336 ID string
337 RevealSecrets bool
338 }
339
340 cmd := &cobra.Command{
341 Use: "show",
342 Args: cobra.MaximumNArgs(1),
343 Short: "Show an application",
344 Long: "Display the name, description, app type, and other information about an application.",
345 Example: ` auth0 apps show
346 auth0 apps show <app-id>
347 auth0 apps show <app-id> --reveal-secrets
348 auth0 apps show <app-id> -r --json
349 auth0 apps show <app-id> -r --json-compact`,
350 RunE: func(cmd *cobra.Command, args []string) error {
351 if len(args) == 0 {
352 err := appID.Pick(cmd, &inputs.ID, cli.appPickerOptions())
353 if err != nil {
354 return err
355 }
356 } else {
357 inputs.ID = args[0]
358 }
359
360 a := &management.Client{
361 ClientID: &inputs.ID,
362 }
363
364 if err := ansi.Waiting(func() error {
365 var err error
366 a, err = cli.api.Client.Read(cmd.Context(), inputs.ID)
367 return err
368 }); err != nil {
369 return fmt.Errorf("failed to read application with ID %q: %w", inputs.ID, err)
370 }
371
372 cli.renderer.ApplicationShow(a, inputs.RevealSecrets)
373
374 return nil
375 },
376 }
377
378 cmd.Flags().BoolVar(&cli.json, "json", false, "Output in json format.")
379 cmd.Flags().BoolVar(&cli.jsonCompact, "json-compact", false, "Output in compact json format.")
380 revealSecrets.RegisterBool(cmd, &inputs.RevealSecrets, false)
381
382 return cmd
383}
384
385func deleteAppCmd(cli *cli) *cobra.Command {
386 cmd := &cobra.Command{

Callers 1

appsCmdFunction · 0.85

Calls 7

WaitingFunction · 0.92
appPickerOptionsMethod · 0.80
ErrorfMethod · 0.80
ApplicationShowMethod · 0.80
RegisterBoolMethod · 0.80
ReadMethod · 0.65
PickMethod · 0.45

Tested by

no test coverage detected