feat: add coder secret import for bulk secret files - #27534
Conversation
Adds `coder secret import <file>` on top of the existing
POST /users/{user}/secrets/batch endpoint. The format is inferred from
the file extension or set with --input-format, and - reads stdin.
Content is parsed locally before upload so a file chosen by mistake is
never transmitted.
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
Documentation CheckRe-checked after the update. The push was a merge of The PR still ships docs alongside the code ( Updates Needed
New after the merge of #27537 (enable/disable)
Automated review via Coder Agents |
|
The last AI doc check calls out a bunch of docs being needed, but they are almost entirely added in this PR which is adding the corresponding UI element for bulk upload #26725 |
| echo -n "$API_KEY" | coder secret create api-key --env API_KEY | ||
| ``` | ||
|
|
||
| ### Import multiple secrets from a file |
There was a problem hiding this comment.
This section is good for now but we can also wrap it in tabs under a heading named "Bulk Import" with UI and CLI as tabs.
Let's merge this as it is now.
BobbyHo
left a comment
There was a problem hiding this comment.
I took a look at the go files and the changes lgtm.
…s-import-cli # Conflicts: # cli/secret.go # cli/secret_test.go # cli/testdata/coder_secret_--help.golden # docs/reference/cli/secret.md # docs/user-guides/user-secrets.md
Adds
coder secret import <file>to bulk-import dotenv, JSON, or YAML secrets through the existing batch API. The command infers the format from the extension or accepts--input-format, supports non-interactive stdin, validates files locally before upload, and warns when imported keys cannot be injected as environment variables.Reviewed and updated by Coder Agents on behalf of @dylanhuff-at-coder.