Skip to content

metalcloud-cli role create

Create a new role with specified permissions

Create a new role with specified permissions in the MetalCloud platform.

This command creates a new role based on configuration provided through a JSON file or piped input. The role configuration must include a label and permissions list. Description is optional but recommended for clarity.

Required configuration fields: label Human-readable name for the role permissions Array of permission strings

Optional configuration fields: description Detailed description of the role’s purpose

Flags: —config-source string Required. Source of the role configuration. Can be ‘pipe’ for stdin input or path to a JSON file.

Configuration format (JSON): { “label”: “Custom Admin Role”, “description”: “Administrative role with full system access”, “permissions”: [“roles:read”, “roles:write”, “users:read”, “users:write”] }

Examples:

metalcloud-cli role create —config-source role-config.json

echo ’{“label”: “Editor”, “permissions”: [“content:read”, “content:write”]}’ | metalcloud-cli role create —config-source pipe

Create role with multiple permissions from file

Section titled “Create role with multiple permissions from file”

metalcloud-cli role new —config-source /path/to/role.json

metalcloud-cli role create [flags]
--config-source string Source of the role configuration. Can be 'pipe' or path to a JSON file.
-h, --help help for create
-k, --api_key string MetalCloud API key
-c, --config string Config file path
-d, --debug Set to enable debug logging
-e, --endpoint string MetalCloud API endpoint
-f, --format string Output format. Supported values are 'text','csv','md','json','yaml'. (default "text")
-i, --insecure_skip_verify Set to allow insecure transport
-l, --log_file string Log file path
-v, --verbosity string Log level verbosity (default "INFO")

Auto generated by spf13/cobra on 11-Aug-2025

Section titled “Auto generated by spf13/cobra on 11-Aug-2025”