MCPcopy Index your code
hub / github.com/coder/coder / tokens

Method tokens

cli/tokens.go:18–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16)
17
18func (r *RootCmd) tokens() *serpent.Command {
19 cmd := &serpent.Command{
20 Use: "tokens",
21 Short: "Manage personal access tokens",
22 Long: "Tokens are used to authenticate automated clients to Coder.\n" + FormatExamples(
23 Example{
24 Description: "Create a token for automation",
25 Command: "coder tokens create",
26 },
27 Example{
28 Description: "List your tokens",
29 Command: "coder tokens ls",
30 },
31 Example{
32 Description: "Create a scoped token",
33 Command: "coder tokens create --scope workspace:read --allow workspace:<uuid>",
34 },
35 Example{
36 Description: "Remove a token by ID",
37 Command: "coder tokens rm WuoWs4ZsMX",
38 },
39 ),
40 Aliases: []string{"token"},
41 Handler: func(inv *serpent.Invocation) error {
42 return inv.Command.HelpHandler(inv)
43 },
44 Children: []*serpent.Command{
45 r.createToken(),
46 r.listTokens(),
47 r.viewToken(),
48 r.removeToken(),
49 },
50 }
51 return cmd
52}
53
54func (r *RootCmd) createToken() *serpent.Command {
55 var (

Callers 1

CoreSubcommandsMethod · 0.95

Calls 5

createTokenMethod · 0.95
listTokensMethod · 0.95
viewTokenMethod · 0.95
removeTokenMethod · 0.95
FormatExamplesFunction · 0.85

Tested by

no test coverage detected