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

# Secret Commands

> CLI commands for managing secrets on the Simplismart platform

Manage secrets using `simplismart secrets`.

### Create Secret

Creates a secret for an organization.

```bash theme={null}
simplismart secrets create [options]
```

| Option               | Description                                 |
| -------------------- | ------------------------------------------- |
| `--name NAME`        | Secret name (required)                      |
| `--secret-type TYPE` | Secret type (required) - e.g., `docker_hub` |
| `--data JSON/@file`  | Secret data as JSON (required)              |

**Example:**

```bash theme={null}
simplismart secrets create \
  --name demo-secret \
  --secret-type docker_hub \
  --data @secret-data.json
```

Where `secret-data.json` contains:

```json theme={null}
{
  "username": "your-username",
  "token": "your-token"
}
```

### List Secrets

Lists secrets for an organization.

```bash theme={null}
simplismart secrets list [options]
```

| Option          | Description                  |
| --------------- | ---------------------------- |
| `--org-id UUID` | Organization UUID (required) |

**Example:**

```bash theme={null}
simplismart secrets list --org-id "$ORG_ID"
```

**Expected output**

```json theme={null}
{
  "data": [
    {
      "uuid": "<SECRET_ID>",
      "created_at": "2024-09-12T13:01:55.465292Z",
      "updated_at": "2024-09-12T13:01:55.465316Z",
      "name": "<SECRET_NAME>",
      "secret_type": "gcp",
      "is_simplismart_managed": false,
      "is_system_generated": false,
      "reference_count": 0,
      "org": "<ORG_ID>"
    }
  ]
}
```

### Get Secret

Gets details of a specific secret.

```bash theme={null}
simplismart secrets get [options]
```

| Option             | Description            |
| ------------------ | ---------------------- |
| `--secret-id UUID` | Secret UUID (required) |

**Example:**

```bash theme={null}
simplismart secrets get --secret-id <SECRET_ID>
```

**Expected output**

Returns a single secret object (e.g. `uuid`, `name`, `secret_type`, `created_at`, `updated_at`, `org`). Secret values are never returned.

***

## JSON File Input

Many CLI commands accept JSON input via file path using the `@` prefix:

```bash theme={null}
# Pass JSON directly
simplismart deployments create --autoscale-config '{"targets": [{"metric": "gpu", "target": 80}]}'

# Or pass a file path
simplismart deployments create --autoscale-config @autoscale.json
```

***

## Error Handling

CLI errors are returned as JSON:

```json theme={null}
{
  "error": "Deployment is already in stopped state",
  "status": 400
}
```
