|
1 | 1 | --- |
2 | 2 | name: hotdata-cli |
3 | | -description: Use this skill when the user wants to run hotdata CLI commands, query the HotData API, list workspaces, list connections, list tables, manage datasets, execute SQL queries, or interact with the hotdata service. Activate when the user says "run hotdata", "query hotdata", "list workspaces", "list connections", "list tables", "list datasets", "create a dataset", "upload a dataset", "execute a query", or asks you to use the hotdata CLI. |
| 3 | +description: Use this skill when the user wants to run hotdata CLI commands, query the HotData API, list workspaces, list connections, create connections, list tables, manage datasets, execute SQL queries, or interact with the hotdata service. Activate when the user says "run hotdata", "query hotdata", "list workspaces", "list connections", "create a connection", "list tables", "list datasets", "create a dataset", "upload a dataset", "execute a query", or asks you to use the hotdata CLI. |
4 | 4 | version: 0.1.3 |
5 | 5 | --- |
6 | 6 |
|
@@ -36,7 +36,66 @@ Returns workspaces with `public_id`, `name`, `active`, `favorite`, `provision_st |
36 | 36 | ``` |
37 | 37 | hotdata connections list [--workspace-id <workspace_id>] [--format table|json|yaml] |
38 | 38 | ``` |
39 | | -Routes via API gateway using `X-Workspace-Id` header. |
| 39 | +Returns `id`, `name`, `source_type` for each connection in the workspace. |
| 40 | + |
| 41 | +### Create a Connection |
| 42 | + |
| 43 | +#### Step 1 — Discover available connection types |
| 44 | +``` |
| 45 | +hotdata connections create list [--workspace-id <workspace_id>] [--format table|json|yaml] |
| 46 | +``` |
| 47 | +Returns all available connection types with `name` and `label`. |
| 48 | + |
| 49 | +#### Step 2 — Inspect the schema for a specific type |
| 50 | +``` |
| 51 | +hotdata connections create list <name> [--workspace-id <workspace_id>] [--format json] |
| 52 | +``` |
| 53 | +Returns `config` and `auth` JSON Schema objects describing all required and optional fields for that connection type. Use `--format json` to get the full schema detail. |
| 54 | + |
| 55 | +- `config` — connection configuration fields (host, port, database, etc.). May be `null` for services that need no configuration. |
| 56 | +- `auth` — authentication fields (password, token, credentials, etc.). May be `null` for services that need no authentication. May be a `oneOf` with multiple authentication method options. |
| 57 | + |
| 58 | +#### Step 3 — Create the connection |
| 59 | +``` |
| 60 | +hotdata connections create \ |
| 61 | + --name "my-connection" \ |
| 62 | + --type <source_type> \ |
| 63 | + --config '<json object>' \ |
| 64 | + [--workspace-id <workspace_id>] |
| 65 | +``` |
| 66 | + |
| 67 | +The `--config` JSON object must contain all **required** fields from `config` plus the **auth fields** merged in at the top level. Auth fields are not nested — they sit alongside config fields in the same object. |
| 68 | + |
| 69 | +Example for PostgreSQL (required: `host`, `port`, `user`, `database` + auth field `password`): |
| 70 | +``` |
| 71 | +hotdata connections create \ |
| 72 | + --name "my-postgres" \ |
| 73 | + --type postgres \ |
| 74 | + --config '{"host":"db.example.com","port":5432,"user":"myuser","database":"mydb","password":"..."}' |
| 75 | +``` |
| 76 | + |
| 77 | +**Security: never expose credentials in plain text.** Passwords, tokens, API keys, and any field with `"format": "password"` in the schema must never be hardcoded as literal strings in CLI commands. Always use one of these safe approaches: |
| 78 | + |
| 79 | +- Read from an environment variable: |
| 80 | + ``` |
| 81 | + --config "{\"host\":\"db.example.com\",\"port\":5432,\"user\":\"myuser\",\"database\":\"mydb\",\"password\":\"$DB_PASSWORD\"}" |
| 82 | + ``` |
| 83 | +- Read a credential from a file and inject it: |
| 84 | + ``` |
| 85 | + --config "{\"token\":\"$(cat ~/.secrets/my-token)\"}" |
| 86 | + ``` |
| 87 | + |
| 88 | +**Field-building rules from the schema:** |
| 89 | + |
| 90 | +- Include all fields listed in `config.required` — these are mandatory. |
| 91 | +- Include optional config fields only if the user provides values for them. |
| 92 | +- For `auth` with a single method (no `oneOf`): include all `auth.required` fields in the config object. |
| 93 | +- For `auth` with `oneOf`: pick one authentication method and include only its required fields. |
| 94 | +- Fields with `"format": "password"` are credentials — apply the security rules above. |
| 95 | +- Fields with `"type": "integer"` must be JSON numbers, not strings (e.g. `"port": 5432` not `"port": "5432"`). |
| 96 | +- Fields with `"type": "boolean"` must be JSON booleans (e.g. `"use_tls": true`). |
| 97 | +- Fields with `"type": "array"` must be JSON arrays (e.g. `"spreadsheet_ids": ["abc", "def"]`). |
| 98 | +- Nested `oneOf` fields must be a JSON object including a `"type"` discriminator field matching the chosen variant's `const` value. |
40 | 99 |
|
41 | 100 | ### List Tables and Columns |
42 | 101 | ``` |
@@ -136,3 +195,19 @@ hotdata init # Create ~/.hotdata/config.yml |
136 | 195 | ``` |
137 | 196 | hotdata query "SELECT 1" |
138 | 197 | ``` |
| 198 | + |
| 199 | +## Workflow: Creating a Connection |
| 200 | + |
| 201 | +1. List available connection types: |
| 202 | + ``` |
| 203 | + hotdata connections create list |
| 204 | + ``` |
| 205 | +2. Inspect the schema for the desired type: |
| 206 | + ``` |
| 207 | + hotdata connections create list <type_name> --format json |
| 208 | + ``` |
| 209 | +3. Collect required config and auth field values from the user or environment. **Never hardcode credentials — use env vars or files.** |
| 210 | +4. Create the connection: |
| 211 | + ``` |
| 212 | + hotdata connections create --name "my-connection" --type <type_name> --config '<json>' |
| 213 | + ``` |
0 commit comments