Skip to content

Docs say infisical service-token can view and delete tokens; only create exists #7810

Description

@truecourse-agent

Product

Secret Manager

Describe the bug

docs/cli/commands/service-token.mdx tells the reader the command can do three things:

The Infisical service-token command allows you to manage service tokens for a given Infisical project. With this command, you can create, view, and delete service tokens.

Only create exists. The same page then documents nothing but a service-token create accordion, so the page contradicts itself two paragraphs apart.

The CLI agrees with the accordion, not the sentence:

$ infisical service-token --help
Manage service tokens

Usage:
  infisical service-token
  infisical service-token [command]

Examples:
infisical service-token

Available Commands:
  create      Used to create service tokens

Flags:
  -h, --help   help for service-token

packages/cmd/tokens.go in Infisical/cli registers exactly one subcommand, and defines no others:

tokensCmd.AddCommand(tokensCreateCmd)

RootCmd.AddCommand(tokensCmd)

There is no tokensViewCmd and no tokensDeleteCmd anywhere in the file.

The practical cost is small but real: someone who has issued a token from the CLI and wants to revoke it goes looking for infisical service-token delete and has to work out on their own that revocation only exists in the web UI and the API. Bare infisical service-token does not help either — it requires a login and then returns, because tokensCmd's Run body is empty — so nothing lists tokens anywhere in the CLI, which makes "view" look like it ought to be a subcommand that simply went missing.

To Reproduce

  1. Install the CLI and run:
$ infisical service-token --help      # create is the only subcommand

$ infisical service-token view
Error: accepts 0 arg(s), received 1
Usage:
  infisical service-token
  infisical service-token [command]

$ infisical service-token delete
Error: accepts 0 arg(s), received 1
Usage:
  infisical service-token
  infisical service-token [command]
  1. Neither word is a subcommand, so cobra reads it as a positional argument and rejects it against Args: cobra.ExactArgs(0).

  2. Compare against https://infisical.com/docs/cli/commands/service-token, which says the command can "create, view, and delete" service tokens.

Expected behavior

Correct the description to match the command — it creates service tokens — and, if it is useful, point readers at where a token can actually be viewed and revoked. Adding view and delete subcommands would work too, but the one-line doc fix is what makes the page stop contradicting itself.

Deployment Type

Self-hosted

Additional context

CLI infisical version 0.41.90, macOS. Docs read from the repository at ba678da03bfa40ddee2608ada24b6edd8c7817a1; the code quoted above is from the current Infisical/cli packages/cmd/tokens.go, where it still holds.

This is only about the create/view/delete sentence. The deprecation warning that used to head the same page is separate and already handled by #7740.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions