()
| 16 | ) |
| 17 | |
| 18 | func (r *RootCmd) secrets() *serpent.Command { |
| 19 | cmd := &serpent.Command{ |
| 20 | Use: "secret", |
| 21 | Aliases: []string{"secrets"}, |
| 22 | Short: "Manage secrets", |
| 23 | Long: FormatExamples( |
| 24 | Example{ |
| 25 | Description: "Create a secret", |
| 26 | Command: "printf %s \"$MYCLI_API_KEY\" | coder secret create api-key --description \"API key for workspace tools\" --env API_KEY --file \"~/.api-key\"", |
| 27 | }, |
| 28 | Example{ |
| 29 | Description: "Update a secret", |
| 30 | Command: "echo -n \"$NEW_SECRET_VALUE\" | coder secret update api-key --description \"Rotated API key\" --env API_KEY --file \"~/.api-key\"", |
| 31 | }, |
| 32 | Example{ |
| 33 | Description: "List your secrets", |
| 34 | Command: "coder secret list", |
| 35 | }, |
| 36 | Example{ |
| 37 | Description: "Show a specific secret", |
| 38 | Command: "coder secret list api-key", |
| 39 | }, |
| 40 | Example{ |
| 41 | Description: "Delete a secret", |
| 42 | Command: "coder secret delete api-key", |
| 43 | }, |
| 44 | ), |
| 45 | Handler: func(inv *serpent.Invocation) error { |
| 46 | return inv.Command.HelpHandler(inv) |
| 47 | }, |
| 48 | Children: []*serpent.Command{ |
| 49 | r.secretCreate(), |
| 50 | r.secretUpdate(), |
| 51 | r.secretList(), |
| 52 | r.secretDelete(), |
| 53 | }, |
| 54 | } |
| 55 | |
| 56 | return cmd |
| 57 | } |
| 58 | |
| 59 | func (r *RootCmd) secretCreate() *serpent.Command { |
| 60 | var ( |
no test coverage detected