rspm create token

Advanced

Command to create tokens. The token will be written to stdout. Informational messages are written to stderr

Terminal
rspm create token [flags]

Examples

Terminal
  rspm create token --scope=sources:write --sources=* --description="Allows all sources"
  rspm create token --scope=sources:write --sources=source1,source2 --expires=20d --description="20 day token"
  rspm create token --scope=sources:write --sources=source1,source2 --expires=5h --description="5 hour token"
  rspm create token --scope=sources:write --sources=source1,source2 --expires=never --description="token that never expires" --quiet
  rspm create token --scope=repos:read --repos=repo1,repo2 --expires=never --description="Repo read token with no expiration"
  rspm create token --scope=blocklist:admin --expires=20d --description="20 day blocklist token"
  rspm create token --scope=metadata:admin --expires=20d --description="20 day metadata token"
  rspm create token --scope=global:admin --expires=never --description="Allows global admin access"

  # Create a repos:read token with access to download packages from all repos (no expiration)
  rspm create token --scope=repos:read --repos='*' --description="Allows read access for all repos"

  # Create a sources:write token with access to upload packages to all sources (no expiration)
  rspm create token --scope=sources:write --sources='*' --description="Allows write access for all sources"

  # Create a sources:write token with access to upload packages to the internal and internal-git sources (no expiration)
  rspm create token --scope=sources:write --sources=internal,internal-git --description="Allows write access for the internal and internal-git sources"

  # Create a blocklist:read token with read access to the blocklist (1 day expiry)
  rspm create token --scope=blocklist:read --expires=1d --description="1 day blocklist read-only token"

Options

Terminal
      --description string   The description for this token. Required.
      --expires string       The expiry for the token. Provide a value that specifies units in 's', 'm', 'h', or 'd'. A value of 'never' creates a token that never expires. Defaults to 'never' (default "never")
  -h, --help                 help for token
  -q, --quiet                Output the token only.
      --repos strings        For repos tokens, a comma-separated list of repository names to which this token will be granted access. Use '*' to allow all repos.
      --scope string         Specify the token type and access. Options are: 'sources:write', 'repos:read', 'blocklist:admin', 'blocklist:read', 'metadata:admin', 'global:admin'
      --sources strings      For sources tokens, a comma-separated list of source names to which this token will be granted access. Only works for Git and Local sources. Use '*' to allow all sources.

Options inherited from parent commands

Terminal
  -a, --address string             The address of the remote server. If not specified, the PACKAGEMANAGER_ADDRESS environment variable is used.
  -c, --config string              Path to config file
      --insecure-ssl-skip-verify   If true, skip SSL certificate validation. This reduces the security that SSL normally provides.
  -o, --output-format string       Specify the output format 'human' for human-readable output or 'json' for JSON-encoded output. (default "human")
  -v, --verbose                    Provide additional output
Back to top