📋 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 forruntimes)--output, -o: Output format (table,json,yaml)
📦 Supported Modules
projects
cpctl list projects
Description: Lists all available projects.
Output:
table(default)jsonyaml→ generatesprojects.yaml
templates
cpctl list templates -p <project_name>
Requires: --project
Output:
table(default)yaml→ generatestemplates.yaml
runtimes
cpctl list runtimes -p <project_name> -e <environment_name>
Requires: --project and --environment
Output:
table(default)yaml→ generatesruntimes.yaml
environments
cpctl list environments -p <project_name>
Requires: --project
Output:
table(default)yaml→ generatesenvironments.yaml
integrations
cpctl list integrations -p <project_name>
Requires: --project
Output:
table(default)yaml→ generatesintegrations.yaml
⚠️ Validations and Errors
The command ensures that required flags are included for each module:
| Module | Requires --project | Requires --environment |
|---|---|---|
| projects | No | No |
| templates | ✅ | No |
| environments | ✅ | No |
| integrations | ✅ | No |
| 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 viaMarshalIndentyaml: Exported.yamlfile, named like:projects.yamltemplates.yamlruntimes.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 frameworkgithub.com/cuemby/cli/pkg/api: Business logic and API queriesgithub.com/cuemby/cli/pkg/ui: Table renderingencoding/json,gopkg.in/yaml.v2: Data serializationos,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.