Skip to main content
Version: v1.1.1

📋 Documentation for the list Command – Cuemby CLI

The list command allows you to query and display collections of resources within a project or environment on the Cuemby platform using the CLI (cpctl).


🔧 General Usage

cpctl list <module> [flags]
  • <module>: Type of resource to list. Valid options:
    • projects, templates, environments, integrations, runtimes
  • --project, -p: Project name (required for several modules)
  • --environment, -e: Environment name (required for runtimes)
  • --output, -o: Output format (table, json, yaml)

📦 Supported Modules

projects

cpctl list projects

Description: Lists all available projects.
Output:

  • table (default)
  • json
  • yaml → generates projects.yaml

templates

cpctl list templates -p <project_name>

Requires: --project
Output:

  • table (default)
  • yaml → generates templates.yaml

runtimes

cpctl list runtimes -p <project_name> -e <environment_name>

Requires: --project and --environment
Output:

  • table (default)
  • yaml → generates runtimes.yaml

environments

cpctl list environments -p <project_name>

Requires: --project
Output:

  • table (default)
  • yaml → generates environments.yaml

integrations

cpctl list integrations -p <project_name>

Requires: --project
Output:

  • table (default)
  • yaml → generates integrations.yaml

⚠️ Validations and Errors

The command ensures that required flags are included for each module:

ModuleRequires --projectRequires --environment
projectsNoNo
templatesNo
environmentsNo
integrationsNo
runtimes

Common error messages:

Please provide a project name with the -p flag
Please provide an environment name with the -e flag
Module '<module>' not supported for the list command

📤 Output Formats

  • table: Tabular display in console (default)
  • json: Indented JSON via MarshalIndent
  • yaml: Exported .yaml file, named like:
    • projects.yaml
    • templates.yaml
    • runtimes.yaml, etc.

🛠️ Command Registration and Flags

rootCmd.AddCommand(listCmd)

listCmd.Flags().StringVarP(&projectNameList, "project", "p", "", "Project name")
listCmd.Flags().StringVarP(&environmentNameList, "environment", "e", "", "Environment name")
listCmd.Flags().StringP("output", "o", "table", "Output format: table, json, yaml")

📚 Dependencies

  • github.com/spf13/cobra: CLI framework
  • github.com/cuemby/cli/pkg/api: Business logic and API queries
  • github.com/cuemby/cli/pkg/ui: Table rendering
  • encoding/json, gopkg.in/yaml.v2: Data serialization
  • os, fmt: Error handling and messaging

✅ Full Example

cpctl list templates -p onboarding --output yaml

This command will list all templates from the onboarding project and generate a templates.yaml file with the output.