> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackshift.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# stackshift agent connect

> Give an agent its own CLI credential, limited to chosen resources and autonomy scope

> [!NOTE]
>
> This page is generated from the StackShift CLI command definitions.

Give an agent its own CLI credential, limited to chosen resources and autonomy scope

### Synopsis

Creates a connection credential for agents (Claude Code, Codex, Cursor) that use the stackshift CLI. Export it as STACKSHIFT\_TOKEN in the agent's shell; every write then goes through the same approvals and autonomy scope as MCP. Destructive actions always wait for you in the dashboard.

```
stackshift agent connect --cli [flags]
```

### Options

```
      --class stackshift agent autonomy-classes   action classes to grant, e.g. deploy,code,configure (see stackshift agent autonomy-classes)
      --cli                                       issue a credential for an agent that uses the CLI
      --client string                             client id (defaults to the detected agent)
      --credential-file string                    new mode-0600 destination; existing files are refused
      --expires duration                          how long the credential lasts (default 720h0m0s)
  -h, --help                                      help for connect
      --idempotency-key string                    retained issuance key
      --name string                               connection name shown in the dashboard (default "CLI agent")
      --resource stringArray                      resource the agent may use, as application:UUID (includes its services and databases), project:UUID or database:UUID
      --scope string                              autonomy scope UUID; without one every write waits for your approval
```

### Options inherited from parent commands

```
      --api-url string       StackShift API URL
      --app string           application name or ID
      --color string         color output: auto, always, or never (default "auto")
      --debug                show request diagnostics
      --environment string   project environment
  -o, --output string        output format: table, json, yaml, or name (default "table")
      --profile string       configuration profile
      --project string       project name or ID
  -q, --quiet                suppress progress output
      --timeout duration     request timeout (default 30s)
      --token-file string    mode-0600 token file
      --token-stdin          read a CI token from stdin
  -y, --yes                  confirm risky operations
```

### SEE ALSO

* [stackshift agent](/cli-reference/stackshift_agent)	 - Manage durable agent threads and runs


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.