list

package
v0.22.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ListCmd = &cobra.Command{
	Use:   "list",
	Short: "List applications in your organization and project",
	Long: `
The list command retrieves and displays all applications associated with your organization and project.

This command allows you to:
- View all applications in your current organization and project
- Control the number of results per page and which page to view
- Choose between a detailed list view or a compact table view

The command will display various details about each application, including:
- Application details (name, alternate ID, and ID)
- Organization information (ID and name)

Examples:
  hyphen app list
  hyphen app list --page-size 20 --page 2
  hyphen app list --table

If no applications are found, you'll be informed accordingly.

Use 'hyphen app list --help' for more information about available flags.
`,
	Args: cobra.NoArgs,
	RunE: func(cmd *cobra.Command, args []string) error {
		printer = cprint.NewCPrinter(flags.VerboseFlag)
		orgId, err := flags.GetOrganizationID()
		if err != nil {
			return err
		}
		projectId, err := flags.GetProjectID()
		if err != nil {
			return err
		}
		service := newService(app.NewService())

		apps, err := service.ListApps(orgId, projectId, pageSize, page)
		if err != nil {
			return fmt.Errorf("failed to list apps: %w", err)
		}

		if len(apps) == 0 {
			printer.Info("No applications found for the specified organization.")
			return nil
		}

		if showTable {
			displayTable(apps)
		} else {
			displayList(apps)
		}
		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL