This command is deprecated and will be removed in the near future. Please
switch to using Machine
Identities for
authenticating with Infisical.
Description
The Infisicalservice-token
command allows you to manage service tokens for a given Infisical project.
With this command, you can create, view, and delete service tokens.
service-token create
service-token create
Use this command to create a service token
Use the scope flag to define which environments and paths your service token should be authorized to access.The value of your scope flag should be in the following
The project ID you’d like to create the service token for.
By default, the CLI will attempt to use the linked Infisical project in
Service token nameDefault:
Set the service token’s expiration time in seconds from now. To never expire set to zero.Default:
The type of access the service token should have. Can be
When true, only the service token will be printedDefault:
Flags
--scope
--scope
<environment slug>:<path>
.
Here, environment slug
refers to the slug name of the environment, and path
indicates the folder path where your secrets are stored.For specifying multiple scopes, you can use multiple —scope flags.The
path
can be a Glob pattern--projectId
--projectId
.infisical.json
generated by infisical init
command.--name
--name
Service token generated via CLI
--expiry-seconds
--expiry-seconds
1 day
--access-level
--access-level
read
and or write
--token-only
--token-only
false