docs: Document registry create password stdin and interactive prompt - #813
docs: Document registry create password stdin and interactive prompt#813promptless[bot] wants to merge 3 commits into
Conversation
Reflect runpodctl PR #329: --password-stdin, interactive no-echo prompt, --password now optional, mutual exclusivity, and multi-line _json_key support.
| ### Create a registry authentication | ||
|
|
||
| Create credentials for a private container registry: | ||
| Create credentials for a private container registry. Supply the password with the `--password` flag, by piping or redirecting it into `--password-stdin`, or by omitting both flags to enter it at an interactive prompt. |
There was a problem hiding this comment.
resolvePassword switch statement establishes the three password sources: --password flag, --password-stdin, and an interactive prompt when neither is given (and stdin is a terminal); merged in runpod/runpodctl PR #329.
| runpodctl registry create --name "docker-hub" --username "myuser" --password "mypassword" | ||
| ``` | ||
|
|
||
| Omit the password flag to have the command prompt for the password without echoing it: |
There was a problem hiding this comment.
promptPassword uses term.ReadPassword, which disables terminal echo, confirming the interactive prompt does not echo input; triggered only when stdinIsTerminal() (line 141).
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
| Pipe a token held in an environment variable into `--password-stdin`: | ||
|
|
||
| ```bash | ||
| printenv REGISTRY_TOKEN | runpodctl registry create --name "docker-hub" --username "myuser" --password-stdin |
There was a problem hiding this comment.
Cobra Example field for registry create shows the pipe (printenv | ... --password-stdin) and file-redirection (--password-stdin < token.txt) invocation forms matched by the docs examples.
| runpodctl registry create --name "docker-hub" --username "myuser" --password-stdin < token.txt | ||
| ``` | ||
|
|
||
| For Google Artifact Registry or gcr.io, set `--username` to the literal `_json_key` and feed the multi-line service-account JSON key file through `--password-stdin`. The command supports multi-line passwords and strips only a single trailing newline added by the pipe or redirection. |
There was a problem hiding this comment.
TrimSuffix(TrimSuffix(data, "\n"), "\r") strips only a single trailing newline (\n or \r\n) added by a pipe/redirection, preserving multi-line content such as a gcr.io _json_key service-account JSON key.
|
|
||
| <ResponseField name="--password" type="string" required> | ||
| Registry password or access token. | ||
| <ResponseField name="--password" type="string"> |
There was a problem hiding this comment.
init() marks only --name and --username required via MarkFlagRequired; --password-stdin is a BoolVar (no value); MarkFlagsMutuallyExclusive("password", "password-stdin") makes the two password flags mutually exclusive.
|
@Promptless When a sentence presents three or more parallel options, alternatives, or steps, use a bulleted list instead. Never chain them with commas and "or". |
|
Got it — thanks for the guidance. I'll record this as a style rule (three or more parallel options, alternatives, or steps become a bulleted list rather than a comma-and-"or" chain) so it's applied going forward, and I'll review this PR's content for any sentences to convert. I'll follow up here shortly. |
|
Update: I've recorded the style rule and reviewed this PR. The registry reference page has a couple of sentences that chain three parallel options with commas and "or" — I'm converting those to bulleted lists now and will update the PR shortly. |
|
Thanks for the guidance, @lavanya-gunreddi — we've saved this as a standing style rule so Promptless follows it going forward: three or more parallel options, alternatives, or steps get a bulleted list rather than a comma-and-"or" chain (two items may stay inline). It's recorded in your Knowledge Base in We also applied it to this PR: the "Create a registry authentication" intro, which previously chained the three ways to supply a password with commas and "or", is now a three-item bulleted list. We reviewed the rest of the page and found no other sentences chaining three or more options this way — the remaining "X or Y" phrasings are two-item, which the rule allows. |
Open in Promptless
The
runpodctl registry createreference page now documents all three ways to supply a registry password. The command previously accepted the secret only through the required--passwordflag, which exposed it in the process table and shell history. It now also reads the password from standard input with the new--password-stdinflag (via a pipe, heredoc, or file redirection) and, when no password flag is given in an interactive terminal, prompts for it without echoing.The "Create a registry authentication" section adds worked examples for each method, including the Google Artifact Registry / gcr.io
_json_keyworkflow that feeds a multi-line service-account JSON key through--password-stdin, plus a tip recommending the stdin or prompt methods over--password. The "Create flags" block marks--passwordas optional (it was required), documents that--passwordand--password-stdinare mutually exclusive, and adds the new--password-stdinflag.Trigger Events
Tip: Add or adjust Promptless's style guide in Agent Knowledge Base ✍️