@superglue/cli 1.1.4 → 1.1.6
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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/dist/cli.js +57 -11
- package/dist/dist/cli.js +57 -11
- package/dist/dist/skills/superglue/SKILL.md +11 -7
- package/dist/skills/superglue/SKILL.md +11 -7
- package/package.json +1 -1
- package/skills/superglue/SKILL.md +11 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "superglue",
|
|
3
3
|
"description": "Build, test, and manage superglue tools via the sg CLI. Use when working with superglue tools, systems, APIs, SDKs, or the sg command.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.6",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "superglue",
|
|
7
7
|
"email": "hello@superglue.cloud"
|
package/README.md
CHANGED
|
@@ -87,7 +87,7 @@ sg tool save --draft <id> # save it
|
|
|
87
87
|
|
|
88
88
|
## Documentation
|
|
89
89
|
|
|
90
|
-
- [
|
|
90
|
+
- [CLI + Skills](https://docs.superglue.cloud/getting-started/cli-skills) — Skill installation and agent setup
|
|
91
91
|
- [Full CLI Reference](./skills/superglue/SKILL.md) — Complete command documentation
|
|
92
92
|
- [superglue Docs](https://docs.superglue.cloud) — Platform documentation
|
|
93
93
|
- [API Reference](https://docs.superglue.cloud/api-reference/) — REST API docs
|
package/dist/cli.js
CHANGED
|
@@ -19947,6 +19947,7 @@ var require_utils = __commonJS({
|
|
|
19947
19947
|
exports2.validateExternalUrl = validateExternalUrl;
|
|
19948
19948
|
exports2.flattenAndNamespaceCredentials = flattenAndNamespaceCredentials;
|
|
19949
19949
|
exports2.flattenAndNamespaceSystemUrls = flattenAndNamespaceSystemUrls;
|
|
19950
|
+
exports2.slugify = slugify2;
|
|
19950
19951
|
exports2.generateUniqueId = generateUniqueId;
|
|
19951
19952
|
exports2.waitForSystemProcessing = waitForSystemProcessing;
|
|
19952
19953
|
exports2.inferJsonSchema = inferJsonSchema;
|
|
@@ -20155,6 +20156,10 @@ var require_utils = __commonJS({
|
|
|
20155
20156
|
return acc;
|
|
20156
20157
|
}, {});
|
|
20157
20158
|
}
|
|
20159
|
+
function slugify2(value) {
|
|
20160
|
+
const slug = value.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
20161
|
+
return slug || "system";
|
|
20162
|
+
}
|
|
20158
20163
|
async function generateUniqueId({ baseId, exists }) {
|
|
20159
20164
|
if (!await exists(baseId)) {
|
|
20160
20165
|
return baseId;
|
|
@@ -21279,7 +21284,8 @@ var require_superglue_client = __commonJS({
|
|
|
21279
21284
|
* Used for SDK/playground testing
|
|
21280
21285
|
*/
|
|
21281
21286
|
async runToolConfig(params) {
|
|
21282
|
-
const
|
|
21287
|
+
const path6 = params.createRun ? "/v1/tools/run?createRun=true" : "/v1/tools/run";
|
|
21288
|
+
const response = await this.restRequest("POST", path6, {
|
|
21283
21289
|
tool: params.tool,
|
|
21284
21290
|
payload: params.payload,
|
|
21285
21291
|
credentials: params.credentials,
|
|
@@ -21779,7 +21785,7 @@ var import_node_util = require("util");
|
|
|
21779
21785
|
// package.json
|
|
21780
21786
|
var package_default = {
|
|
21781
21787
|
name: "@superglue/cli",
|
|
21782
|
-
version: "1.1.
|
|
21788
|
+
version: "1.1.6",
|
|
21783
21789
|
bin: {
|
|
21784
21790
|
sg: "./dist/cli.js"
|
|
21785
21791
|
},
|
|
@@ -21868,6 +21874,28 @@ async function getLatestNpmVersion() {
|
|
|
21868
21874
|
return null;
|
|
21869
21875
|
}
|
|
21870
21876
|
}
|
|
21877
|
+
var updateCheckPromise = null;
|
|
21878
|
+
function startBackgroundUpdateCheck() {
|
|
21879
|
+
updateCheckPromise = getLatestNpmVersion();
|
|
21880
|
+
}
|
|
21881
|
+
async function printUpdateNotification() {
|
|
21882
|
+
if (!updateCheckPromise) return;
|
|
21883
|
+
try {
|
|
21884
|
+
const timeout = new Promise((resolve4) => {
|
|
21885
|
+
const timer = setTimeout(() => resolve4(null), 2e3);
|
|
21886
|
+
timer.unref();
|
|
21887
|
+
});
|
|
21888
|
+
const latest = await Promise.race([updateCheckPromise, timeout]);
|
|
21889
|
+
if (latest && compareVersions(CLI_VERSION, latest) < 0) {
|
|
21890
|
+
console.error("");
|
|
21891
|
+
console.error(`${c.cyan}${c.bold} Update available: ${CLI_VERSION} \u2192 ${latest}${c.reset}`);
|
|
21892
|
+
console.error(`${c.cyan} Run ${c.bold}sg update${c.reset}${c.cyan} to upgrade${c.reset}`);
|
|
21893
|
+
console.error("");
|
|
21894
|
+
}
|
|
21895
|
+
} catch {
|
|
21896
|
+
}
|
|
21897
|
+
updateCheckPromise = null;
|
|
21898
|
+
}
|
|
21871
21899
|
async function updateCli() {
|
|
21872
21900
|
const latestVersion = await getLatestNpmVersion();
|
|
21873
21901
|
if (!latestVersion) {
|
|
@@ -22583,7 +22611,7 @@ function registerRunCommand(parent, getContext2) {
|
|
|
22583
22611
|
return arr;
|
|
22584
22612
|
},
|
|
22585
22613
|
[]
|
|
22586
|
-
).option("--include-step-results", "Include raw step results").option("--include-config", "Include full tool config").action(async (opts) => {
|
|
22614
|
+
).option("--include-step-results", "Include raw step results").option("--include-config", "Include full tool config").option("--no-create-run", "Skip creating a run record in the backend").action(async (opts) => {
|
|
22587
22615
|
const { config, client } = getContext2();
|
|
22588
22616
|
const selectors = [opts.tool, opts.draft, opts.config, opts.configFile].filter(Boolean);
|
|
22589
22617
|
if (selectors.length === 0) {
|
|
@@ -22594,6 +22622,10 @@ function registerRunCommand(parent, getContext2) {
|
|
|
22594
22622
|
error("Only one of --tool, --draft, --config, or --config-file can be used");
|
|
22595
22623
|
process.exit(1);
|
|
22596
22624
|
}
|
|
22625
|
+
if (opts.tool && opts.createRun === false) {
|
|
22626
|
+
error("--no-create-run is not supported with --tool (saved tools always create runs)");
|
|
22627
|
+
process.exit(1);
|
|
22628
|
+
}
|
|
22597
22629
|
const filePayloads = await parseFileFlags(opts.file, client);
|
|
22598
22630
|
let payload = opts.payloadFile ? JSON.parse(fs6.readFileSync(opts.payloadFile, "utf-8")) : opts.payload ? JSON.parse(opts.payload) : void 0;
|
|
22599
22631
|
if (payload) {
|
|
@@ -22619,7 +22651,8 @@ function registerRunCommand(parent, getContext2) {
|
|
|
22619
22651
|
tool: toolConfig,
|
|
22620
22652
|
payload,
|
|
22621
22653
|
options: { requestSource: import_shared4.RequestSource.CLI },
|
|
22622
|
-
traceId
|
|
22654
|
+
traceId,
|
|
22655
|
+
createRun: opts.createRun !== false
|
|
22623
22656
|
});
|
|
22624
22657
|
logSub.unsubscribe();
|
|
22625
22658
|
spin.stop();
|
|
@@ -22906,7 +22939,7 @@ async function collectSensitiveCredentials(fields) {
|
|
|
22906
22939
|
return creds;
|
|
22907
22940
|
}
|
|
22908
22941
|
function registerCreateCommand(parent, getContext2) {
|
|
22909
|
-
parent.command("create").description("Create a new system").option("--config <file>", "JSON config file").option("--id <id>", "System ID").option("--name <name>", "Human-readable name").option("--url <url>", "API URL").option("--template <id>", "Template ID").option("--instructions <text>", "Specific instructions").option("--credentials <json>", "Non-sensitive credentials JSON").option("--sensitive-credentials <fields>", "Comma-separated sensitive credential field names").option("--docs-url <url>", "Documentation URL to scrape").option("--openapi-url <url>", "OpenAPI spec URL").addOption(
|
|
22942
|
+
parent.command("create").description("Create a new system").option("--config <file>", "JSON config file").option("--id <id>", "System ID (derived from name if omitted)").option("--name <name>", "Human-readable name (required)").option("--url <url>", "API URL").option("--template <id>", "Template ID").option("--instructions <text>", "Specific instructions").option("--credentials <json>", "Non-sensitive credentials JSON").option("--sensitive-credentials <fields>", "Comma-separated sensitive credential field names").option("--docs-url <url>", "Documentation URL to scrape").option("--openapi-url <url>", "OpenAPI spec URL").addOption(
|
|
22910
22943
|
new import_commander.Option("--env <environment>", "Environment: dev or prod (default: prod)").choices([
|
|
22911
22944
|
"dev",
|
|
22912
22945
|
"prod"
|
|
@@ -22972,10 +23005,17 @@ function registerCreateCommand(parent, getContext2) {
|
|
|
22972
23005
|
const sensitive = await collectSensitiveCredentials(fields);
|
|
22973
23006
|
systemInput.credentials = { ...systemInput.credentials, ...sensitive };
|
|
22974
23007
|
}
|
|
22975
|
-
if (
|
|
22976
|
-
error("System
|
|
23008
|
+
if (typeof systemInput.name !== "string" || systemInput.name.trim() === "") {
|
|
23009
|
+
error("System name is required (--name)");
|
|
22977
23010
|
process.exit(1);
|
|
22978
23011
|
}
|
|
23012
|
+
if (!systemInput.id) {
|
|
23013
|
+
systemInput.id = (0, import_shared6.slugify)(systemInput.name.trim());
|
|
23014
|
+
if (!systemInput.id) {
|
|
23015
|
+
error("System ID could not be derived from name; use --id with letters or numbers");
|
|
23016
|
+
process.exit(1);
|
|
23017
|
+
}
|
|
23018
|
+
}
|
|
22979
23019
|
try {
|
|
22980
23020
|
const spin = spinner(`Creating system ${c.bold}${systemInput.id}${c.reset}...`);
|
|
22981
23021
|
const result = await client.createSystem(systemInput);
|
|
@@ -23599,6 +23639,7 @@ All Commands:
|
|
|
23599
23639
|
sg tool build --id <id> --instruction <text> Build a tool from flags (requires --steps)
|
|
23600
23640
|
sg tool run --tool <id> [--payload <json>] Run a saved tool
|
|
23601
23641
|
sg tool run --draft <id> [--payload <json>] Run a draft tool
|
|
23642
|
+
sg tool run --config <json> [--no-create-run] Run inline config (logs run by default)
|
|
23602
23643
|
sg tool edit --tool <id> --patches <json> Edit a tool via JSON Patch
|
|
23603
23644
|
sg tool edit --draft <id> --patches <json> Edit a draft via JSON Patch
|
|
23604
23645
|
sg tool save --draft <id> Save a draft to the server
|
|
@@ -23607,7 +23648,7 @@ All Commands:
|
|
|
23607
23648
|
sg tool find --id <id> Get full config of a tool
|
|
23608
23649
|
|
|
23609
23650
|
sg system create --config <file> Create a system from JSON config
|
|
23610
|
-
sg system create --
|
|
23651
|
+
sg system create --name <name> --url <url> Create a system from flags
|
|
23611
23652
|
sg system edit --id <id> Edit a system's configuration
|
|
23612
23653
|
sg system list List all systems
|
|
23613
23654
|
sg system find [query] Search systems by keyword
|
|
@@ -23671,15 +23712,20 @@ function extractFlagValue(argv, flag) {
|
|
|
23671
23712
|
return void 0;
|
|
23672
23713
|
}
|
|
23673
23714
|
var subcommand = findSubcommand(process.argv);
|
|
23715
|
+
startBackgroundUpdateCheck();
|
|
23716
|
+
var runAndNotify = async (parsePromise) => {
|
|
23717
|
+
await parsePromise;
|
|
23718
|
+
await printUpdateNotification();
|
|
23719
|
+
};
|
|
23674
23720
|
if (subcommand && commandsRequiringServer.includes(subcommand)) {
|
|
23675
23721
|
const cliApiKey = extractFlagValue(process.argv, "--api-key");
|
|
23676
23722
|
const cliEndpoint = extractFlagValue(process.argv, "--endpoint");
|
|
23677
23723
|
const config = resolveConfig({ apiKey: cliApiKey, endpoint: cliEndpoint });
|
|
23678
23724
|
if (config.apiKey) {
|
|
23679
|
-
checkVersionCompatibility(config.endpoint).then(() => program.
|
|
23725
|
+
runAndNotify(checkVersionCompatibility(config.endpoint).then(() => program.parseAsync()));
|
|
23680
23726
|
} else {
|
|
23681
|
-
program.
|
|
23727
|
+
runAndNotify(program.parseAsync());
|
|
23682
23728
|
}
|
|
23683
23729
|
} else {
|
|
23684
|
-
program.
|
|
23730
|
+
runAndNotify(program.parseAsync());
|
|
23685
23731
|
}
|
package/dist/dist/cli.js
CHANGED
|
@@ -19947,6 +19947,7 @@ var require_utils = __commonJS({
|
|
|
19947
19947
|
exports2.validateExternalUrl = validateExternalUrl;
|
|
19948
19948
|
exports2.flattenAndNamespaceCredentials = flattenAndNamespaceCredentials;
|
|
19949
19949
|
exports2.flattenAndNamespaceSystemUrls = flattenAndNamespaceSystemUrls;
|
|
19950
|
+
exports2.slugify = slugify2;
|
|
19950
19951
|
exports2.generateUniqueId = generateUniqueId;
|
|
19951
19952
|
exports2.waitForSystemProcessing = waitForSystemProcessing;
|
|
19952
19953
|
exports2.inferJsonSchema = inferJsonSchema;
|
|
@@ -20155,6 +20156,10 @@ var require_utils = __commonJS({
|
|
|
20155
20156
|
return acc;
|
|
20156
20157
|
}, {});
|
|
20157
20158
|
}
|
|
20159
|
+
function slugify2(value) {
|
|
20160
|
+
const slug = value.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
20161
|
+
return slug || "system";
|
|
20162
|
+
}
|
|
20158
20163
|
async function generateUniqueId({ baseId, exists }) {
|
|
20159
20164
|
if (!await exists(baseId)) {
|
|
20160
20165
|
return baseId;
|
|
@@ -21279,7 +21284,8 @@ var require_superglue_client = __commonJS({
|
|
|
21279
21284
|
* Used for SDK/playground testing
|
|
21280
21285
|
*/
|
|
21281
21286
|
async runToolConfig(params) {
|
|
21282
|
-
const
|
|
21287
|
+
const path6 = params.createRun ? "/v1/tools/run?createRun=true" : "/v1/tools/run";
|
|
21288
|
+
const response = await this.restRequest("POST", path6, {
|
|
21283
21289
|
tool: params.tool,
|
|
21284
21290
|
payload: params.payload,
|
|
21285
21291
|
credentials: params.credentials,
|
|
@@ -21779,7 +21785,7 @@ var import_node_util = require("util");
|
|
|
21779
21785
|
// package.json
|
|
21780
21786
|
var package_default = {
|
|
21781
21787
|
name: "@superglue/cli",
|
|
21782
|
-
version: "1.1.
|
|
21788
|
+
version: "1.1.6",
|
|
21783
21789
|
bin: {
|
|
21784
21790
|
sg: "./dist/cli.js"
|
|
21785
21791
|
},
|
|
@@ -21868,6 +21874,28 @@ async function getLatestNpmVersion() {
|
|
|
21868
21874
|
return null;
|
|
21869
21875
|
}
|
|
21870
21876
|
}
|
|
21877
|
+
var updateCheckPromise = null;
|
|
21878
|
+
function startBackgroundUpdateCheck() {
|
|
21879
|
+
updateCheckPromise = getLatestNpmVersion();
|
|
21880
|
+
}
|
|
21881
|
+
async function printUpdateNotification() {
|
|
21882
|
+
if (!updateCheckPromise) return;
|
|
21883
|
+
try {
|
|
21884
|
+
const timeout = new Promise((resolve4) => {
|
|
21885
|
+
const timer = setTimeout(() => resolve4(null), 2e3);
|
|
21886
|
+
timer.unref();
|
|
21887
|
+
});
|
|
21888
|
+
const latest = await Promise.race([updateCheckPromise, timeout]);
|
|
21889
|
+
if (latest && compareVersions(CLI_VERSION, latest) < 0) {
|
|
21890
|
+
console.error("");
|
|
21891
|
+
console.error(`${c.cyan}${c.bold} Update available: ${CLI_VERSION} \u2192 ${latest}${c.reset}`);
|
|
21892
|
+
console.error(`${c.cyan} Run ${c.bold}sg update${c.reset}${c.cyan} to upgrade${c.reset}`);
|
|
21893
|
+
console.error("");
|
|
21894
|
+
}
|
|
21895
|
+
} catch {
|
|
21896
|
+
}
|
|
21897
|
+
updateCheckPromise = null;
|
|
21898
|
+
}
|
|
21871
21899
|
async function updateCli() {
|
|
21872
21900
|
const latestVersion = await getLatestNpmVersion();
|
|
21873
21901
|
if (!latestVersion) {
|
|
@@ -22583,7 +22611,7 @@ function registerRunCommand(parent, getContext2) {
|
|
|
22583
22611
|
return arr;
|
|
22584
22612
|
},
|
|
22585
22613
|
[]
|
|
22586
|
-
).option("--include-step-results", "Include raw step results").option("--include-config", "Include full tool config").action(async (opts) => {
|
|
22614
|
+
).option("--include-step-results", "Include raw step results").option("--include-config", "Include full tool config").option("--no-create-run", "Skip creating a run record in the backend").action(async (opts) => {
|
|
22587
22615
|
const { config, client } = getContext2();
|
|
22588
22616
|
const selectors = [opts.tool, opts.draft, opts.config, opts.configFile].filter(Boolean);
|
|
22589
22617
|
if (selectors.length === 0) {
|
|
@@ -22594,6 +22622,10 @@ function registerRunCommand(parent, getContext2) {
|
|
|
22594
22622
|
error("Only one of --tool, --draft, --config, or --config-file can be used");
|
|
22595
22623
|
process.exit(1);
|
|
22596
22624
|
}
|
|
22625
|
+
if (opts.tool && opts.createRun === false) {
|
|
22626
|
+
error("--no-create-run is not supported with --tool (saved tools always create runs)");
|
|
22627
|
+
process.exit(1);
|
|
22628
|
+
}
|
|
22597
22629
|
const filePayloads = await parseFileFlags(opts.file, client);
|
|
22598
22630
|
let payload = opts.payloadFile ? JSON.parse(fs6.readFileSync(opts.payloadFile, "utf-8")) : opts.payload ? JSON.parse(opts.payload) : void 0;
|
|
22599
22631
|
if (payload) {
|
|
@@ -22619,7 +22651,8 @@ function registerRunCommand(parent, getContext2) {
|
|
|
22619
22651
|
tool: toolConfig,
|
|
22620
22652
|
payload,
|
|
22621
22653
|
options: { requestSource: import_shared4.RequestSource.CLI },
|
|
22622
|
-
traceId
|
|
22654
|
+
traceId,
|
|
22655
|
+
createRun: opts.createRun !== false
|
|
22623
22656
|
});
|
|
22624
22657
|
logSub.unsubscribe();
|
|
22625
22658
|
spin.stop();
|
|
@@ -22906,7 +22939,7 @@ async function collectSensitiveCredentials(fields) {
|
|
|
22906
22939
|
return creds;
|
|
22907
22940
|
}
|
|
22908
22941
|
function registerCreateCommand(parent, getContext2) {
|
|
22909
|
-
parent.command("create").description("Create a new system").option("--config <file>", "JSON config file").option("--id <id>", "System ID").option("--name <name>", "Human-readable name").option("--url <url>", "API URL").option("--template <id>", "Template ID").option("--instructions <text>", "Specific instructions").option("--credentials <json>", "Non-sensitive credentials JSON").option("--sensitive-credentials <fields>", "Comma-separated sensitive credential field names").option("--docs-url <url>", "Documentation URL to scrape").option("--openapi-url <url>", "OpenAPI spec URL").addOption(
|
|
22942
|
+
parent.command("create").description("Create a new system").option("--config <file>", "JSON config file").option("--id <id>", "System ID (derived from name if omitted)").option("--name <name>", "Human-readable name (required)").option("--url <url>", "API URL").option("--template <id>", "Template ID").option("--instructions <text>", "Specific instructions").option("--credentials <json>", "Non-sensitive credentials JSON").option("--sensitive-credentials <fields>", "Comma-separated sensitive credential field names").option("--docs-url <url>", "Documentation URL to scrape").option("--openapi-url <url>", "OpenAPI spec URL").addOption(
|
|
22910
22943
|
new import_commander.Option("--env <environment>", "Environment: dev or prod (default: prod)").choices([
|
|
22911
22944
|
"dev",
|
|
22912
22945
|
"prod"
|
|
@@ -22972,10 +23005,17 @@ function registerCreateCommand(parent, getContext2) {
|
|
|
22972
23005
|
const sensitive = await collectSensitiveCredentials(fields);
|
|
22973
23006
|
systemInput.credentials = { ...systemInput.credentials, ...sensitive };
|
|
22974
23007
|
}
|
|
22975
|
-
if (
|
|
22976
|
-
error("System
|
|
23008
|
+
if (typeof systemInput.name !== "string" || systemInput.name.trim() === "") {
|
|
23009
|
+
error("System name is required (--name)");
|
|
22977
23010
|
process.exit(1);
|
|
22978
23011
|
}
|
|
23012
|
+
if (!systemInput.id) {
|
|
23013
|
+
systemInput.id = (0, import_shared6.slugify)(systemInput.name.trim());
|
|
23014
|
+
if (!systemInput.id) {
|
|
23015
|
+
error("System ID could not be derived from name; use --id with letters or numbers");
|
|
23016
|
+
process.exit(1);
|
|
23017
|
+
}
|
|
23018
|
+
}
|
|
22979
23019
|
try {
|
|
22980
23020
|
const spin = spinner(`Creating system ${c.bold}${systemInput.id}${c.reset}...`);
|
|
22981
23021
|
const result = await client.createSystem(systemInput);
|
|
@@ -23599,6 +23639,7 @@ All Commands:
|
|
|
23599
23639
|
sg tool build --id <id> --instruction <text> Build a tool from flags (requires --steps)
|
|
23600
23640
|
sg tool run --tool <id> [--payload <json>] Run a saved tool
|
|
23601
23641
|
sg tool run --draft <id> [--payload <json>] Run a draft tool
|
|
23642
|
+
sg tool run --config <json> [--no-create-run] Run inline config (logs run by default)
|
|
23602
23643
|
sg tool edit --tool <id> --patches <json> Edit a tool via JSON Patch
|
|
23603
23644
|
sg tool edit --draft <id> --patches <json> Edit a draft via JSON Patch
|
|
23604
23645
|
sg tool save --draft <id> Save a draft to the server
|
|
@@ -23607,7 +23648,7 @@ All Commands:
|
|
|
23607
23648
|
sg tool find --id <id> Get full config of a tool
|
|
23608
23649
|
|
|
23609
23650
|
sg system create --config <file> Create a system from JSON config
|
|
23610
|
-
sg system create --
|
|
23651
|
+
sg system create --name <name> --url <url> Create a system from flags
|
|
23611
23652
|
sg system edit --id <id> Edit a system's configuration
|
|
23612
23653
|
sg system list List all systems
|
|
23613
23654
|
sg system find [query] Search systems by keyword
|
|
@@ -23671,15 +23712,20 @@ function extractFlagValue(argv, flag) {
|
|
|
23671
23712
|
return void 0;
|
|
23672
23713
|
}
|
|
23673
23714
|
var subcommand = findSubcommand(process.argv);
|
|
23715
|
+
startBackgroundUpdateCheck();
|
|
23716
|
+
var runAndNotify = async (parsePromise) => {
|
|
23717
|
+
await parsePromise;
|
|
23718
|
+
await printUpdateNotification();
|
|
23719
|
+
};
|
|
23674
23720
|
if (subcommand && commandsRequiringServer.includes(subcommand)) {
|
|
23675
23721
|
const cliApiKey = extractFlagValue(process.argv, "--api-key");
|
|
23676
23722
|
const cliEndpoint = extractFlagValue(process.argv, "--endpoint");
|
|
23677
23723
|
const config = resolveConfig({ apiKey: cliApiKey, endpoint: cliEndpoint });
|
|
23678
23724
|
if (config.apiKey) {
|
|
23679
|
-
checkVersionCompatibility(config.endpoint).then(() => program.
|
|
23725
|
+
runAndNotify(checkVersionCompatibility(config.endpoint).then(() => program.parseAsync()));
|
|
23680
23726
|
} else {
|
|
23681
|
-
program.
|
|
23727
|
+
runAndNotify(program.parseAsync());
|
|
23682
23728
|
}
|
|
23683
23729
|
} else {
|
|
23684
|
-
program.
|
|
23730
|
+
runAndNotify(program.parseAsync());
|
|
23685
23731
|
}
|
|
@@ -12,6 +12,11 @@ description: "Build, test, deploy and integrate superglue tools via the sg CLI a
|
|
|
12
12
|
1. **Check CLI exists**: Run `sg --version`. If it fails with `command not found`, install it: `npm install -g @superglue/cli`
|
|
13
13
|
2. **Check superglue CLI config exists**: Run `sg system list`. If it fails with `fetch failed` or auth errors, the CLI needs configuration via `sg init` (see below).
|
|
14
14
|
|
|
15
|
+
**Calling systems and running tools**
|
|
16
|
+
|
|
17
|
+
1. ALWAYS make sure you pull the relevant system context using `sg system find` before calling system endpoints and running inline JSON tools or building new tools.
|
|
18
|
+
2. Use `sg system search-docs` to do a targeted keyword search of system docs if you're unsure about how a system works.
|
|
19
|
+
|
|
15
20
|
**Authentication & Credentials:**
|
|
16
21
|
|
|
17
22
|
- **Auth headers MUST be set explicitly** — credentials are NEVER auto-injected into requests or tool steps
|
|
@@ -173,34 +178,33 @@ sg tool find --id my-tool # exact ID lookup (full config)
|
|
|
173
178
|
|
|
174
179
|
**Required flags:**
|
|
175
180
|
|
|
176
|
-
- `--id <id>` — System ID (lowercase, underscores only, no hyphens)
|
|
177
181
|
- `--name <name>` — Human-readable display name
|
|
178
182
|
- `--url <url>` — API base URL (auto-filled when using `--template`)
|
|
179
183
|
|
|
180
|
-
**
|
|
184
|
+
**Optional:**
|
|
181
185
|
|
|
186
|
+
- `--id <id>` — System ID (lowercase, underscores only, no hyphens). Derived from `--name` if omitted.
|
|
182
187
|
- `--template <id>` — Pre-configured template (auto-fills name and url if not provided)
|
|
183
|
-
- `--url <url>` + `--name <name>` manually
|
|
184
188
|
|
|
185
189
|
**Example with credentials (non-interactive — use this in AI agent / CI contexts):**
|
|
186
190
|
|
|
187
191
|
```bash
|
|
188
|
-
sg system create --
|
|
192
|
+
sg system create --name "My API" --url https://api.example.com \
|
|
189
193
|
--credentials '{"api_key":"sk-xxx"}'
|
|
190
194
|
```
|
|
191
195
|
|
|
192
196
|
**With template:**
|
|
193
197
|
|
|
194
198
|
```bash
|
|
195
|
-
sg system create --
|
|
199
|
+
sg system create --name "Slack" --template slack
|
|
196
200
|
```
|
|
197
201
|
|
|
198
202
|
**Full flag reference:**
|
|
199
203
|
|
|
200
204
|
| Flag | Description |
|
|
201
205
|
| ---------------------------------- | ---------------------------------------------------------------------------- |
|
|
202
|
-
| `--id <id>` | System ID (lowercase, underscores only) — **REQUIRED** |
|
|
203
206
|
| `--name <name>` | Human-readable name — **REQUIRED** |
|
|
207
|
+
| `--id <id>` | System ID (lowercase, underscores only) — derived from name if omitted |
|
|
204
208
|
| `--url <url>` | API base URL — **REQUIRED** (auto-filled by `--template`) |
|
|
205
209
|
| `--template <id>` | Template ID (stripe, shopify, slack, etc.) |
|
|
206
210
|
| `--credentials <json>` | Credentials JSON (use for ALL creds in non-interactive mode) |
|
|
@@ -530,7 +534,7 @@ Templates auto-populate endpoints and OAuth config. Use `sg system find` to disc
|
|
|
530
534
|
|
|
531
535
|
### OAuth Flow
|
|
532
536
|
|
|
533
|
-
1. `sg system create --
|
|
537
|
+
1. `sg system create --name "Gmail" --url https://gmail.googleapis.com --credentials '{"auth_url":"...","token_url":"..."}' --sensitive-credentials client_id,client_secret`
|
|
534
538
|
2. `sg system oauth --system-id gmail --scopes "..."`
|
|
535
539
|
3. User authenticates in browser → tokens saved automatically
|
|
536
540
|
|
|
@@ -12,6 +12,11 @@ description: "Build, test, deploy and integrate superglue tools via the sg CLI a
|
|
|
12
12
|
1. **Check CLI exists**: Run `sg --version`. If it fails with `command not found`, install it: `npm install -g @superglue/cli`
|
|
13
13
|
2. **Check superglue CLI config exists**: Run `sg system list`. If it fails with `fetch failed` or auth errors, the CLI needs configuration via `sg init` (see below).
|
|
14
14
|
|
|
15
|
+
**Calling systems and running tools**
|
|
16
|
+
|
|
17
|
+
1. ALWAYS make sure you pull the relevant system context using `sg system find` before calling system endpoints and running inline JSON tools or building new tools.
|
|
18
|
+
2. Use `sg system search-docs` to do a targeted keyword search of system docs if you're unsure about how a system works.
|
|
19
|
+
|
|
15
20
|
**Authentication & Credentials:**
|
|
16
21
|
|
|
17
22
|
- **Auth headers MUST be set explicitly** — credentials are NEVER auto-injected into requests or tool steps
|
|
@@ -173,34 +178,33 @@ sg tool find --id my-tool # exact ID lookup (full config)
|
|
|
173
178
|
|
|
174
179
|
**Required flags:**
|
|
175
180
|
|
|
176
|
-
- `--id <id>` — System ID (lowercase, underscores only, no hyphens)
|
|
177
181
|
- `--name <name>` — Human-readable display name
|
|
178
182
|
- `--url <url>` — API base URL (auto-filled when using `--template`)
|
|
179
183
|
|
|
180
|
-
**
|
|
184
|
+
**Optional:**
|
|
181
185
|
|
|
186
|
+
- `--id <id>` — System ID (lowercase, underscores only, no hyphens). Derived from `--name` if omitted.
|
|
182
187
|
- `--template <id>` — Pre-configured template (auto-fills name and url if not provided)
|
|
183
|
-
- `--url <url>` + `--name <name>` manually
|
|
184
188
|
|
|
185
189
|
**Example with credentials (non-interactive — use this in AI agent / CI contexts):**
|
|
186
190
|
|
|
187
191
|
```bash
|
|
188
|
-
sg system create --
|
|
192
|
+
sg system create --name "My API" --url https://api.example.com \
|
|
189
193
|
--credentials '{"api_key":"sk-xxx"}'
|
|
190
194
|
```
|
|
191
195
|
|
|
192
196
|
**With template:**
|
|
193
197
|
|
|
194
198
|
```bash
|
|
195
|
-
sg system create --
|
|
199
|
+
sg system create --name "Slack" --template slack
|
|
196
200
|
```
|
|
197
201
|
|
|
198
202
|
**Full flag reference:**
|
|
199
203
|
|
|
200
204
|
| Flag | Description |
|
|
201
205
|
| ---------------------------------- | ---------------------------------------------------------------------------- |
|
|
202
|
-
| `--id <id>` | System ID (lowercase, underscores only) — **REQUIRED** |
|
|
203
206
|
| `--name <name>` | Human-readable name — **REQUIRED** |
|
|
207
|
+
| `--id <id>` | System ID (lowercase, underscores only) — derived from name if omitted |
|
|
204
208
|
| `--url <url>` | API base URL — **REQUIRED** (auto-filled by `--template`) |
|
|
205
209
|
| `--template <id>` | Template ID (stripe, shopify, slack, etc.) |
|
|
206
210
|
| `--credentials <json>` | Credentials JSON (use for ALL creds in non-interactive mode) |
|
|
@@ -530,7 +534,7 @@ Templates auto-populate endpoints and OAuth config. Use `sg system find` to disc
|
|
|
530
534
|
|
|
531
535
|
### OAuth Flow
|
|
532
536
|
|
|
533
|
-
1. `sg system create --
|
|
537
|
+
1. `sg system create --name "Gmail" --url https://gmail.googleapis.com --credentials '{"auth_url":"...","token_url":"..."}' --sensitive-credentials client_id,client_secret`
|
|
534
538
|
2. `sg system oauth --system-id gmail --scopes "..."`
|
|
535
539
|
3. User authenticates in browser → tokens saved automatically
|
|
536
540
|
|
package/package.json
CHANGED
|
@@ -12,6 +12,11 @@ description: "Build, test, deploy and integrate superglue tools via the sg CLI a
|
|
|
12
12
|
1. **Check CLI exists**: Run `sg --version`. If it fails with `command not found`, install it: `npm install -g @superglue/cli`
|
|
13
13
|
2. **Check superglue CLI config exists**: Run `sg system list`. If it fails with `fetch failed` or auth errors, the CLI needs configuration via `sg init` (see below).
|
|
14
14
|
|
|
15
|
+
**Calling systems and running tools**
|
|
16
|
+
|
|
17
|
+
1. ALWAYS make sure you pull the relevant system context using `sg system find` before calling system endpoints and running inline JSON tools or building new tools.
|
|
18
|
+
2. Use `sg system search-docs` to do a targeted keyword search of system docs if you're unsure about how a system works.
|
|
19
|
+
|
|
15
20
|
**Authentication & Credentials:**
|
|
16
21
|
|
|
17
22
|
- **Auth headers MUST be set explicitly** — credentials are NEVER auto-injected into requests or tool steps
|
|
@@ -173,34 +178,33 @@ sg tool find --id my-tool # exact ID lookup (full config)
|
|
|
173
178
|
|
|
174
179
|
**Required flags:**
|
|
175
180
|
|
|
176
|
-
- `--id <id>` — System ID (lowercase, underscores only, no hyphens)
|
|
177
181
|
- `--name <name>` — Human-readable display name
|
|
178
182
|
- `--url <url>` — API base URL (auto-filled when using `--template`)
|
|
179
183
|
|
|
180
|
-
**
|
|
184
|
+
**Optional:**
|
|
181
185
|
|
|
186
|
+
- `--id <id>` — System ID (lowercase, underscores only, no hyphens). Derived from `--name` if omitted.
|
|
182
187
|
- `--template <id>` — Pre-configured template (auto-fills name and url if not provided)
|
|
183
|
-
- `--url <url>` + `--name <name>` manually
|
|
184
188
|
|
|
185
189
|
**Example with credentials (non-interactive — use this in AI agent / CI contexts):**
|
|
186
190
|
|
|
187
191
|
```bash
|
|
188
|
-
sg system create --
|
|
192
|
+
sg system create --name "My API" --url https://api.example.com \
|
|
189
193
|
--credentials '{"api_key":"sk-xxx"}'
|
|
190
194
|
```
|
|
191
195
|
|
|
192
196
|
**With template:**
|
|
193
197
|
|
|
194
198
|
```bash
|
|
195
|
-
sg system create --
|
|
199
|
+
sg system create --name "Slack" --template slack
|
|
196
200
|
```
|
|
197
201
|
|
|
198
202
|
**Full flag reference:**
|
|
199
203
|
|
|
200
204
|
| Flag | Description |
|
|
201
205
|
| ---------------------------------- | ---------------------------------------------------------------------------- |
|
|
202
|
-
| `--id <id>` | System ID (lowercase, underscores only) — **REQUIRED** |
|
|
203
206
|
| `--name <name>` | Human-readable name — **REQUIRED** |
|
|
207
|
+
| `--id <id>` | System ID (lowercase, underscores only) — derived from name if omitted |
|
|
204
208
|
| `--url <url>` | API base URL — **REQUIRED** (auto-filled by `--template`) |
|
|
205
209
|
| `--template <id>` | Template ID (stripe, shopify, slack, etc.) |
|
|
206
210
|
| `--credentials <json>` | Credentials JSON (use for ALL creds in non-interactive mode) |
|
|
@@ -530,7 +534,7 @@ Templates auto-populate endpoints and OAuth config. Use `sg system find` to disc
|
|
|
530
534
|
|
|
531
535
|
### OAuth Flow
|
|
532
536
|
|
|
533
|
-
1. `sg system create --
|
|
537
|
+
1. `sg system create --name "Gmail" --url https://gmail.googleapis.com --credentials '{"auth_url":"...","token_url":"..."}' --sensitive-credentials client_id,client_secret`
|
|
534
538
|
2. `sg system oauth --system-id gmail --scopes "..."`
|
|
535
539
|
3. User authenticates in browser → tokens saved automatically
|
|
536
540
|
|