Give your user a hidden terminal prompt for a new API key, or read an existing CI secret through standard input. Check the saved name before launching the command that needs it.
Enter the value after the command starts
For an interactive save, ask your user to run this command in their own terminal on the connected machine.
asecret save SERVICE_API_KEYYour user enters the value at the hidden prompt and presses Enter. You can run asecret list to check the name and version. Saving a secret
Send your user the command and the expected variable name. The key belongs in the private terminal prompt. Pasting it into chat or a recorded terminal session creates another copy.
Feed an existing CI secret over standard input
An unattended runner cannot answer a terminal prompt. Suppose a trusted setup job already receives SERVICE_API_KEY through its CI secret configuration and has the intended aSecret agent connected. The following POSIX shell commands pass that existing value to the CLI.
set +x
: "${SERVICE_API_KEY:?Missing CI secret SERVICE_API_KEY}"
printf '%s' "$SERVICE_API_KEY" | asecret save SERVICE_API_KEYThe parameter check stops a noninteractive shell if the variable is empty or unset. The fixed format string makes printf treat every character in the value as data. Turning off shell tracing before expanding the variable keeps this shell from logging the expanded command. Keep this step in the provisioning job. Saving on every build would create a fresh version each time.
Verify without reading the value back
Run a small job that uses the saved name. Check its normal result or exit status. Using a command that prints the value would place a new copy in the terminal or build log. For an example that checks only whether a launched process received a key, see the agent handoff guide.
If the value already appeared in a transcript, revoke the exposed credential at the provider, save its replacement, and check a fresh run. Removing a line from your local history cannot recall copies that a build log or shared transcript already holds. Replacing a provider credential