@superglue/cli 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: superglue
3
- description: Build, test, deploy, and integrate superglue API tools via the sg CLI. Use when working with superglue tools, systems, APIs, the sg command, or integrating tools into codebases (SDK, REST API, webhooks). Covers tool configuration, credential management, OAuth, pagination, multi-step workflows, and production deployment.
3
+ description: "Build, test, deploy and integrate superglue tools via the sg CLI and superglue SDKs. IMPORTANT — you MUST invoke this skill and read the full reference BEFORE running ANY sg command or writing ANY superglue SDK/REST/webhook integration code. Before using the sg CLI, first check that it is installed (run sg --version; if not found, install with npm install -g @superglue/cli), then verify it is configured (check that sg init has been run or that SUPERGLUE_API_KEY and SUPERGLUE_API_ENDPOINT environment variables are set). If not, guide the user through setup first. After reading the SKILL.md file, also read the relevant references/ files for the specific topic (databases, file servers, transforms, integration/SDK)."
4
4
  ---
5
5
 
6
6
  # superglue CLI (`sg`) — Agent Reference
@@ -50,26 +50,90 @@ sg system call --system-id notion --url "https://api.notion.com/v1/search" \
50
50
 
51
51
  ---
52
52
 
53
- ## Quick Start
53
+ ## Installation & Setup
54
+
55
+ ### Prerequisites Check
56
+
57
+ Before running any `sg` command, verify the CLI is installed and configured:
58
+
59
+ 1. **Check CLI exists**: Run `sg --version`. If it fails with `command not found`, install it: `npm install -g @superglue/cli`
60
+ 2. **Check config exists**: Run `sg system list`. If it fails with `fetch failed` or auth errors, the CLI needs configuration (see below).
61
+
62
+ ### Installing the CLI
54
63
 
55
64
  ```bash
56
65
  npm install -g @superglue/cli
57
- sg init # guided setup
66
+ ```
67
+
68
+ After installation, the `sg` command is available globally.
69
+
70
+ ### Initialization (REQUIRED before first use)
71
+
72
+ The CLI **will not work** until configured with an API key and endpoint. Without configuration, all commands fail with `fetch failed` or similar connection errors.
73
+
74
+ **Option A: Interactive setup (recommended for humans)**
75
+
76
+ ```bash
77
+ sg init
78
+ ```
79
+
80
+ This prompts for:
81
+
82
+ 1. **API Key** (required) — get one at https://app.superglue.cloud/admin?view=api-keys
83
+ 2. **API Endpoint** — defaults to `https://api.superglue.cloud`
84
+ 3. **Web Endpoint** — for OAuth callbacks, auto-derived from API endpoint
85
+ 4. **Output mode** — `stdout` (default) or `stdout+file`
86
+ 5. **Config location** — project-local (`.superglue/config.json`) or global (`~/.superglue/config.json`)
87
+
88
+ It verifies the connection before saving. On success it creates the config file, a `drafts/` directory, and updates `.gitignore` if using local config.
89
+
90
+ **Option B: Environment variables (recommended for CI and AI agents)**
91
+
92
+ If `sg init` is not practical (non-interactive environments, CI, AI agents), set these env vars instead:
93
+
94
+ ```bash
95
+ export SUPERGLUE_API_KEY="your-api-key"
96
+ export SUPERGLUE_API_ENDPOINT="https://api.superglue.cloud" # optional, this is the default
97
+ ```
98
+
99
+ With these set, all `sg` commands work without a config file.
100
+
101
+ **Option C: CLI flags (per-command override)**
102
+
103
+ ```bash
104
+ sg system list --api-key "your-key" --endpoint "https://api.superglue.cloud"
105
+ ```
106
+
107
+ ### Config Resolution Order
108
+
109
+ CLI flags > environment variables > config file (local `.superglue/config.json` > global `~/.superglue/config.json`).
110
+
111
+ ### Verifying Setup
112
+
113
+ After configuring, verify the connection works:
114
+
115
+ ```bash
116
+ sg system list # should return a list (possibly empty) without errors
117
+ ```
118
+
119
+ If you see `fetch failed`, `ECONNREFUSED`, or authentication errors, double-check your API key and endpoint.
120
+
121
+ ---
122
+
123
+ ## Quick Start
124
+
125
+ ```bash
58
126
  sg system list # verify connection
59
127
  sg tool build --config '{"id":"...","instruction":"...","steps":[...]}'
60
128
  sg tool run --draft <draftId>
61
129
  sg tool save --draft <draftId>
62
130
  ```
63
131
 
64
- **Config:** `SUPERGLUE_API_KEY` + `SUPERGLUE_API_ENDPOINT` env vars, or `.superglue/config.json` (created by `sg init`).
65
- **Priority:** CLI flags > env vars > config file.
66
-
67
132
  ## Global Flags
68
133
 
69
134
  | Flag | Description |
70
135
  | ------------------ | ------------------------------------------- |
71
136
  | `--json` | Force JSON output (auto-enabled in non-TTY) |
72
- | `-y, --yes` | Auto-accept all confirmations |
73
137
  | `--api-key <key>` | Override API key |
74
138
  | `--endpoint <url>` | Override API endpoint |
75
139
 
@@ -79,7 +143,7 @@ sg tool save --draft <draftId>
79
143
 
80
144
  ### `sg init`
81
145
 
82
- Interactive setup — API key, endpoint, output mode, policies. Creates `.superglue/`.
146
+ Interactive setup — API key, endpoint, output mode. Creates `.superglue/`.
83
147
 
84
148
  ### Tool Commands
85
149
 
@@ -98,7 +162,7 @@ sg tool build --id my-tool --instruction "..." --steps steps.json --payload '{"k
98
162
  | `--payload <json>` | Sample payload (generates inputSchema) |
99
163
  | `--file <key=path>` | Attach file reference (repeatable) |
100
164
 
101
- **`sg tool run`** — Execute a draft or saved tool.
165
+ **`sg tool run`** — Execute a draft or saved tool. Streams live execution logs to the terminal.
102
166
 
103
167
  ```bash
104
168
  sg tool run --draft <draftId> --payload '{"userId":"123"}'
@@ -149,9 +213,10 @@ sg system create --id my_api --url https://api.example.com --credentials '{"api_
149
213
  | `--credentials <json>` | Non-sensitive credentials |
150
214
  | `--sensitive-credentials <fields>` | Comma-separated fields to prompt for securely |
151
215
  | `--docs-url <url>` | Documentation URL to scrape |
216
+ | `--env <environment>` | Environment: `dev` or `prod` (default: prod) |
152
217
 
153
- **`sg system edit`** — Update system config or credentials.
154
- **`sg system list` / `sg system find`** — List or search systems.
218
+ **`sg system edit`** — Update system config or credentials. Supports `--env dev|prod`.
219
+ **`sg system list` / `sg system find`** — List or search systems. `find` supports `--env dev|prod`.
155
220
 
156
221
  **`sg system call`** — **CRITICAL for tool building.** Make authenticated calls to APIs, databases, and file servers. Use this to:
157
222
 
@@ -191,12 +256,13 @@ sg system call --url "sftp://<<my_sftp_host>>:22/data" \
191
256
  | `--method <method>` | HTTP method (GET, POST, PUT, DELETE, PATCH) |
192
257
  | `--headers <json>` | HTTP headers JSON with credential placeholders |
193
258
  | `--body <string>` | Request body (JSON string) |
259
+ | `--env <env>` | Environment: `dev` or `prod` |
194
260
  | `--file <key=path>` | File references (repeatable) |
195
261
 
196
- **`sg system docs`** — Search system documentation.
262
+ **`sg system search-docs`** — Search system documentation.
197
263
 
198
264
  ```bash
199
- sg system docs --system-id slack --keywords "send message channels"
265
+ sg system search-docs --system-id slack -k "send message channels"
200
266
  ```
201
267
 
202
268
  **`sg system oauth`** — Authenticate via OAuth.
@@ -227,14 +293,14 @@ sg system oauth --system-id my_api --grant-type client_credentials --scopes "rea
227
293
  {
228
294
  "id": "unique-step-id",
229
295
  "config": {
230
- "systemId": "system-id",
231
- "url": "https://api.example.com/endpoint?param=<<payload.field>>",
296
+ "systemId": "example_system",
297
+ "url": "https://api.example.com/endpoint?param=<<payload_field>>",
232
298
  "method": "GET",
233
299
  "headers": {
234
- "Authorization": "Bearer <<system-id_access_token>>"
300
+ "Authorization": "Bearer <<example_system_access_token>>"
235
301
  },
236
302
  "queryParams": { "limit": "10" },
237
- "body": "{ \"key\": \"<<payload.field>>\" }"
303
+ "body": "{ \"key\": \"<<payload_field>>\" }"
238
304
  },
239
305
  "dataSelector": "(sourceData) => sourceData.previousStep.data.items",
240
306
  "transformCode": "(items) => items.map(i => ({ id: i.id, name: i.name }))",
@@ -582,7 +648,7 @@ When an outputTransform or dataSelector fails, the executor retries with an LLM-
582
648
  1. **Create system** → `sg system create --id my_api --url ... --sensitive-credentials api_key`
583
649
  2. **Authenticate** → `sg system oauth` (if OAuth) or credentials are already set
584
650
  3. **Test auth** → `sg system call` to verify credentials work
585
- 4. **Explore API** → `sg system docs` + more `sg system call` to test endpoints
651
+ 4. **Explore API** → `sg system search-docs` + more `sg system call` to test endpoints
586
652
  5. **Build tool** → Construct full config JSON, `sg tool build --config '...'`
587
653
  6. **Test** → `sg tool run --draft <id> --include-step-results`
588
654
  7. **Iterate** → `sg tool edit --draft <id> --patches '[...]' --test`
@@ -660,16 +726,15 @@ sg tool run --draft <id> --payload '{"data": "file::mysheet"}' --file mysheet=da
660
726
 
661
727
  ## Configuration
662
728
 
663
- `.superglue/config.json`:
729
+ Created by `sg init` at `.superglue/config.json` (project-local) or `~/.superglue/config.json` (global):
664
730
 
665
731
  ```json
666
732
  {
667
733
  "apiKey": "...",
668
734
  "endpoint": "https://api.superglue.cloud",
669
- "output": { "mode": "stdout", "directory": ".superglue/output" },
670
- "policies": { "callSystem": "ask_every_time", "editTool": "confirm" }
735
+ "webEndpoint": "https://app.superglue.cloud",
736
+ "output": { "mode": "stdout", "directory": ".superglue/output" }
671
737
  }
672
738
  ```
673
739
 
674
- **callSystem:** `ask_every_time` | `run_gets_only` | `run_everything`
675
- **editTool:** `confirm` | `auto_accept`
740
+ Config file is optional if `SUPERGLUE_API_KEY` and `SUPERGLUE_API_ENDPOINT` env vars are set. See **Installation & Setup** above.
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "superglue"
3
+ short_description: "Build, test, deploy, and integrate superglue API tools via the sg CLI and SDK"
4
+ icon_small: "./assets/superglue.png"
5
+ icon_large: "./assets/superglue.png"
6
+ brand_color: "#FFA500"
7
+ default_prompt: "I need help building a superglue integration tool"
@@ -75,7 +75,7 @@ Downloaded files are all parsed automatically:
75
75
 
76
76
  - String → written as-is
77
77
  - Buffer → written directly
78
- - Object/Array → JSON.stringified with 2-space indent
78
+ - Object/Array → `JSON.stringify` with 2-space indent
79
79
 
80
80
  ## Connection Details
81
81
 
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
2
  "name": "@superglue/cli",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "bin": {
5
5
  "sg": "./dist/cli.js"
6
6
  },
7
7
  "files": [
8
+ ".claude-plugin/",
8
9
  "dist/",
9
10
  "skills/",
10
- "skills.md"
11
+ "LICENSE"
11
12
  ],
12
13
  "dependencies": {
13
14
  "commander": "^13.0.0",
14
15
  "fast-json-patch": "^3.1.1"
15
16
  },
16
17
  "devDependencies": {
17
- "@superglue/shared": "file:../shared",
18
18
  "@types/node": "^20.0.0",
19
19
  "tsup": "^8.0.0",
20
20
  "typescript": "^5.0.0"
21
21
  },
22
22
  "scripts": {
23
- "build": "tsup && cp -r skills dist/ 2>/dev/null || true",
23
+ "build": "tsup && (cp -r skills dist/ 2>/dev/null || true)",
24
24
  "dev": "tsup --watch",
25
25
  "type-check": "tsc --noEmit",
26
26
  "prepublishOnly": "npm run build"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: superglue
3
- description: Build, test, deploy, and integrate superglue API tools via the sg CLI. Use when working with superglue tools, systems, APIs, the sg command, or integrating tools into codebases (SDK, REST API, webhooks). Covers tool configuration, credential management, OAuth, pagination, multi-step workflows, and production deployment.
3
+ description: "Build, test, deploy and integrate superglue tools via the sg CLI and superglue SDKs. IMPORTANT — you MUST invoke this skill and read the full reference BEFORE running ANY sg command or writing ANY superglue SDK/REST/webhook integration code. Before using the sg CLI, first check that it is installed (run sg --version; if not found, install with npm install -g @superglue/cli), then verify it is configured (check that sg init has been run or that SUPERGLUE_API_KEY and SUPERGLUE_API_ENDPOINT environment variables are set). If not, guide the user through setup first. After reading the SKILL.md file, also read the relevant references/ files for the specific topic (databases, file servers, transforms, integration/SDK)."
4
4
  ---
5
5
 
6
6
  # superglue CLI (`sg`) — Agent Reference
@@ -50,26 +50,90 @@ sg system call --system-id notion --url "https://api.notion.com/v1/search" \
50
50
 
51
51
  ---
52
52
 
53
- ## Quick Start
53
+ ## Installation & Setup
54
+
55
+ ### Prerequisites Check
56
+
57
+ Before running any `sg` command, verify the CLI is installed and configured:
58
+
59
+ 1. **Check CLI exists**: Run `sg --version`. If it fails with `command not found`, install it: `npm install -g @superglue/cli`
60
+ 2. **Check config exists**: Run `sg system list`. If it fails with `fetch failed` or auth errors, the CLI needs configuration (see below).
61
+
62
+ ### Installing the CLI
54
63
 
55
64
  ```bash
56
65
  npm install -g @superglue/cli
57
- sg init # guided setup
66
+ ```
67
+
68
+ After installation, the `sg` command is available globally.
69
+
70
+ ### Initialization (REQUIRED before first use)
71
+
72
+ The CLI **will not work** until configured with an API key and endpoint. Without configuration, all commands fail with `fetch failed` or similar connection errors.
73
+
74
+ **Option A: Interactive setup (recommended for humans)**
75
+
76
+ ```bash
77
+ sg init
78
+ ```
79
+
80
+ This prompts for:
81
+
82
+ 1. **API Key** (required) — get one at https://app.superglue.cloud/admin?view=api-keys
83
+ 2. **API Endpoint** — defaults to `https://api.superglue.cloud`
84
+ 3. **Web Endpoint** — for OAuth callbacks, auto-derived from API endpoint
85
+ 4. **Output mode** — `stdout` (default) or `stdout+file`
86
+ 5. **Config location** — project-local (`.superglue/config.json`) or global (`~/.superglue/config.json`)
87
+
88
+ It verifies the connection before saving. On success it creates the config file, a `drafts/` directory, and updates `.gitignore` if using local config.
89
+
90
+ **Option B: Environment variables (recommended for CI and AI agents)**
91
+
92
+ If `sg init` is not practical (non-interactive environments, CI, AI agents), set these env vars instead:
93
+
94
+ ```bash
95
+ export SUPERGLUE_API_KEY="your-api-key"
96
+ export SUPERGLUE_API_ENDPOINT="https://api.superglue.cloud" # optional, this is the default
97
+ ```
98
+
99
+ With these set, all `sg` commands work without a config file.
100
+
101
+ **Option C: CLI flags (per-command override)**
102
+
103
+ ```bash
104
+ sg system list --api-key "your-key" --endpoint "https://api.superglue.cloud"
105
+ ```
106
+
107
+ ### Config Resolution Order
108
+
109
+ CLI flags > environment variables > config file (local `.superglue/config.json` > global `~/.superglue/config.json`).
110
+
111
+ ### Verifying Setup
112
+
113
+ After configuring, verify the connection works:
114
+
115
+ ```bash
116
+ sg system list # should return a list (possibly empty) without errors
117
+ ```
118
+
119
+ If you see `fetch failed`, `ECONNREFUSED`, or authentication errors, double-check your API key and endpoint.
120
+
121
+ ---
122
+
123
+ ## Quick Start
124
+
125
+ ```bash
58
126
  sg system list # verify connection
59
127
  sg tool build --config '{"id":"...","instruction":"...","steps":[...]}'
60
128
  sg tool run --draft <draftId>
61
129
  sg tool save --draft <draftId>
62
130
  ```
63
131
 
64
- **Config:** `SUPERGLUE_API_KEY` + `SUPERGLUE_API_ENDPOINT` env vars, or `.superglue/config.json` (created by `sg init`).
65
- **Priority:** CLI flags > env vars > config file.
66
-
67
132
  ## Global Flags
68
133
 
69
134
  | Flag | Description |
70
135
  | ------------------ | ------------------------------------------- |
71
136
  | `--json` | Force JSON output (auto-enabled in non-TTY) |
72
- | `-y, --yes` | Auto-accept all confirmations |
73
137
  | `--api-key <key>` | Override API key |
74
138
  | `--endpoint <url>` | Override API endpoint |
75
139
 
@@ -79,7 +143,7 @@ sg tool save --draft <draftId>
79
143
 
80
144
  ### `sg init`
81
145
 
82
- Interactive setup — API key, endpoint, output mode, policies. Creates `.superglue/`.
146
+ Interactive setup — API key, endpoint, output mode. Creates `.superglue/`.
83
147
 
84
148
  ### Tool Commands
85
149
 
@@ -98,7 +162,7 @@ sg tool build --id my-tool --instruction "..." --steps steps.json --payload '{"k
98
162
  | `--payload <json>` | Sample payload (generates inputSchema) |
99
163
  | `--file <key=path>` | Attach file reference (repeatable) |
100
164
 
101
- **`sg tool run`** — Execute a draft or saved tool.
165
+ **`sg tool run`** — Execute a draft or saved tool. Streams live execution logs to the terminal.
102
166
 
103
167
  ```bash
104
168
  sg tool run --draft <draftId> --payload '{"userId":"123"}'
@@ -149,9 +213,10 @@ sg system create --id my_api --url https://api.example.com --credentials '{"api_
149
213
  | `--credentials <json>` | Non-sensitive credentials |
150
214
  | `--sensitive-credentials <fields>` | Comma-separated fields to prompt for securely |
151
215
  | `--docs-url <url>` | Documentation URL to scrape |
216
+ | `--env <environment>` | Environment: `dev` or `prod` (default: prod) |
152
217
 
153
- **`sg system edit`** — Update system config or credentials.
154
- **`sg system list` / `sg system find`** — List or search systems.
218
+ **`sg system edit`** — Update system config or credentials. Supports `--env dev|prod`.
219
+ **`sg system list` / `sg system find`** — List or search systems. `find` supports `--env dev|prod`.
155
220
 
156
221
  **`sg system call`** — **CRITICAL for tool building.** Make authenticated calls to APIs, databases, and file servers. Use this to:
157
222
 
@@ -191,12 +256,13 @@ sg system call --url "sftp://<<my_sftp_host>>:22/data" \
191
256
  | `--method <method>` | HTTP method (GET, POST, PUT, DELETE, PATCH) |
192
257
  | `--headers <json>` | HTTP headers JSON with credential placeholders |
193
258
  | `--body <string>` | Request body (JSON string) |
259
+ | `--env <env>` | Environment: `dev` or `prod` |
194
260
  | `--file <key=path>` | File references (repeatable) |
195
261
 
196
- **`sg system docs`** — Search system documentation.
262
+ **`sg system search-docs`** — Search system documentation.
197
263
 
198
264
  ```bash
199
- sg system docs --system-id slack --keywords "send message channels"
265
+ sg system search-docs --system-id slack -k "send message channels"
200
266
  ```
201
267
 
202
268
  **`sg system oauth`** — Authenticate via OAuth.
@@ -227,14 +293,14 @@ sg system oauth --system-id my_api --grant-type client_credentials --scopes "rea
227
293
  {
228
294
  "id": "unique-step-id",
229
295
  "config": {
230
- "systemId": "system-id",
231
- "url": "https://api.example.com/endpoint?param=<<payload.field>>",
296
+ "systemId": "example_system",
297
+ "url": "https://api.example.com/endpoint?param=<<payload_field>>",
232
298
  "method": "GET",
233
299
  "headers": {
234
- "Authorization": "Bearer <<system-id_access_token>>"
300
+ "Authorization": "Bearer <<example_system_access_token>>"
235
301
  },
236
302
  "queryParams": { "limit": "10" },
237
- "body": "{ \"key\": \"<<payload.field>>\" }"
303
+ "body": "{ \"key\": \"<<payload_field>>\" }"
238
304
  },
239
305
  "dataSelector": "(sourceData) => sourceData.previousStep.data.items",
240
306
  "transformCode": "(items) => items.map(i => ({ id: i.id, name: i.name }))",
@@ -582,7 +648,7 @@ When an outputTransform or dataSelector fails, the executor retries with an LLM-
582
648
  1. **Create system** → `sg system create --id my_api --url ... --sensitive-credentials api_key`
583
649
  2. **Authenticate** → `sg system oauth` (if OAuth) or credentials are already set
584
650
  3. **Test auth** → `sg system call` to verify credentials work
585
- 4. **Explore API** → `sg system docs` + more `sg system call` to test endpoints
651
+ 4. **Explore API** → `sg system search-docs` + more `sg system call` to test endpoints
586
652
  5. **Build tool** → Construct full config JSON, `sg tool build --config '...'`
587
653
  6. **Test** → `sg tool run --draft <id> --include-step-results`
588
654
  7. **Iterate** → `sg tool edit --draft <id> --patches '[...]' --test`
@@ -660,16 +726,15 @@ sg tool run --draft <id> --payload '{"data": "file::mysheet"}' --file mysheet=da
660
726
 
661
727
  ## Configuration
662
728
 
663
- `.superglue/config.json`:
729
+ Created by `sg init` at `.superglue/config.json` (project-local) or `~/.superglue/config.json` (global):
664
730
 
665
731
  ```json
666
732
  {
667
733
  "apiKey": "...",
668
734
  "endpoint": "https://api.superglue.cloud",
669
- "output": { "mode": "stdout", "directory": ".superglue/output" },
670
- "policies": { "callSystem": "ask_every_time", "editTool": "confirm" }
735
+ "webEndpoint": "https://app.superglue.cloud",
736
+ "output": { "mode": "stdout", "directory": ".superglue/output" }
671
737
  }
672
738
  ```
673
739
 
674
- **callSystem:** `ask_every_time` | `run_gets_only` | `run_everything`
675
- **editTool:** `confirm` | `auto_accept`
740
+ Config file is optional if `SUPERGLUE_API_KEY` and `SUPERGLUE_API_ENDPOINT` env vars are set. See **Installation & Setup** above.
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "superglue"
3
+ short_description: "Build, test, deploy, and integrate superglue API tools via the sg CLI and SDK"
4
+ icon_small: "./assets/superglue.png"
5
+ icon_large: "./assets/superglue.png"
6
+ brand_color: "#FFA500"
7
+ default_prompt: "I need help building a superglue integration tool"
@@ -75,7 +75,7 @@ Downloaded files are all parsed automatically:
75
75
 
76
76
  - String → written as-is
77
77
  - Buffer → written directly
78
- - Object/Array → JSON.stringified with 2-space indent
78
+ - Object/Array → `JSON.stringify` with 2-space indent
79
79
 
80
80
  ## Connection Details
81
81