ccloud api-key store

Description

Use this command to register an API secret created by another process and store it locally.

When you create an API key with the CLI, it is automatically stored locally. However, when you create an API key using the UI, API, or with the CLI on another machine, the secret is not available for CLI use until you “store” it. This is because secrets are irretrievable after creation.

You must have an API secret stored locally for certain CLI commands to work. For example, the Kafka topic consume and produce commands require an API secret.

There are five ways to pass the secret: 1. api-key store <key> <secret>. 2. api-key store; you will be prompted for both API key and secret. 3. api-key store <key>; you will be prompted for API secret. 4. api-key store <key> -; for piping API secret. 5. api-key store <key> @<filepath>.

ccloud api-key store <apikey> <secret> [flags]

Flags

    --resource string      The resource ID of the resource the API key is for.
-f, --force                Force overwrite existing secret for this key.
    --environment string   Environment ID.
    --context string       CLI Context name.

Global Flags

-h, --help            Show help for this command.
-v, --verbose count   Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).

See Also