MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / buildTokenCommand

Function buildTokenCommand

cmd/cloudflared/tunnel/subcommands.go:850–860  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

848}
849
850func buildTokenCommand() *cli.Command {
851 return &cli.Command{
852 Name: "token",
853 Action: cliutil.ConfiguredAction(tokenCommand),
854 Usage: "Fetch the credentials token for an existing tunnel (by name or UUID) that allows to run it",
855 UsageText: "cloudflared tunnel [tunnel command options] token [subcommand options] TUNNEL",
856 Description: "cloudflared tunnel token will fetch the credentials token for a given tunnel (by its name or UUID), which is then used to run the tunnel. This command fails if the tunnel does not exist or has been deleted. Use the flag `cloudflared tunnel token --cred-file /my/path/file.json TUNNEL` to output the token to the credentials JSON file. Note: this command only works for Tunnels created since cloudflared version 2022.3.0",
857 Flags: []cli.Flag{credentialsFileFlagCLIOnly},
858 CustomHelpTemplate: commandHelpTemplate(),
859 }
860}
861
862func tokenCommand(c *cli.Context) error {
863 sc, err := newSubcommandContext(c)

Callers 1

CommandsFunction · 0.85

Calls 2

ConfiguredActionFunction · 0.92
commandHelpTemplateFunction · 0.85

Tested by

no test coverage detected