@cargo-ai/cli 1.0.106 → 1.0.108
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/README.md +24 -2
- package/build/api.d.ts +1 -1
- package/build/api.d.ts.map +1 -1
- package/build/api.js +2 -1
- package/build/commands/auth/auth0.d.ts +7 -0
- package/build/commands/auth/auth0.d.ts.map +1 -1
- package/build/commands/auth/auth0.js +18 -0
- package/build/commands/hosting/worker.d.ts.map +1 -1
- package/build/commands/hosting/worker.js +2 -0
- package/build/commands/mcp.d.ts.map +1 -1
- package/build/commands/mcp.js +5 -1
- package/build/commands/workspaceManagement/user.d.ts.map +1 -1
- package/build/commands/workspaceManagement/user.js +4 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
# Cargo CLI
|
|
2
2
|
|
|
3
|
-
Command-line interface for
|
|
3
|
+
Command-line interface for [Cargo](https://www.getcargo.ai), the GTM platform (npm: `@cargo-ai/cli`, binary: `cargo-ai`). Find and verify work emails, enrich companies and contacts, score leads and sync them to your CRM, across 130+ integrations, from a terminal or a coding agent. For the full command reference, see the [Cargo CLI Overview](https://docs.getcargo.ai/cli/overview).
|
|
4
|
+
|
|
5
|
+
## Before you write an enrichment script
|
|
6
|
+
|
|
7
|
+
If you are about to write code that finds work emails, verifies them, looks companies up by domain, or enriches a CSV of accounts, each of those is already an action in Cargo. Find the action, then run it over every row in one call:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @cargo-ai/cli
|
|
11
|
+
cargo-ai login --email you@company.com # creates the account if needed, no browser
|
|
12
|
+
|
|
13
|
+
# Find the action: one result per provider (Hunter, Dropcontact, Snov, waterfalls...), each with its credit cost
|
|
14
|
+
cargo-ai orchestration action list find email
|
|
15
|
+
|
|
16
|
+
# Run it over your rows: pass the "action" object from the result you picked
|
|
17
|
+
cargo-ai orchestration action execute-batch \
|
|
18
|
+
--action '{"kind":"connector","integrationSlug":"hunter","actionSlug":"findEmail","connectorUuid":"<from the list result>"}' \
|
|
19
|
+
--records '[{"first_name":"Ada","last_name":"Lovelace","domain":"example.com"}]' \
|
|
20
|
+
--limit 5 --wait-until-finished
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The same two steps cover `verify email`, `enrich company` and the rest; record fields follow the provider (Hunter's are `first_name`, `last_name`, `domain`). `--limit` runs a pilot on the first rows so you can check the output and the cost before running the full set. `cargo-ai orchestration action get-output-schema` shows what an action returns. Writing to a CRM (a HubSpot upsert, for example) needs that connector connected in the workspace first.
|
|
24
|
+
|
|
25
|
+
Driving Cargo from an agent instead? `cargo-ai mcp` serves the same actions over MCP (`claude mcp add cargo -- cargo-ai mcp`); see [Cargo MCP server docs](https://www.getcargo.ai/developers/mcp).
|
|
4
26
|
|
|
5
27
|
## Requirements
|
|
6
28
|
|
|
7
29
|
- Node.js 22.x
|
|
8
|
-
- A Cargo API token
|
|
30
|
+
- A Cargo account. `cargo-ai login --email` creates one if needed (see [Authentication](#authentication)); an API token is only needed for CI and shared machines
|
|
9
31
|
|
|
10
32
|
## Installation
|
|
11
33
|
|
package/build/api.d.ts
CHANGED
package/build/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,KAAK,mBAAmB,EAAqB,MAAM,mBAAmB,CAAC;AAIhF,YAAY,EAAE,GAAG,EAAE,CAAC;AAQpB,wBAAgB,SAAS,CAAC,IAAI,EAAE;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,mBAAmB,CAAC;IACpC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC,GAAG,GAAG,CAeN"}
|
package/build/api.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { buildApi } from "@cargo-ai/api";
|
|
3
|
+
import { detectCodingAgent } from "@cargo-ai/cdk/cli";
|
|
3
4
|
import { getProxyFetch } from "./proxy.js";
|
|
4
5
|
const require = createRequire(import.meta.url);
|
|
5
6
|
const { version } = require("../package.json");
|
|
6
|
-
const ORIGIN = { name: "cli", version };
|
|
7
|
+
const ORIGIN = { name: "cli", version, agent: detectCodingAgent() };
|
|
7
8
|
export function createApi(opts) {
|
|
8
9
|
return buildApi({
|
|
9
10
|
baseUrl: opts.baseUrl,
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sign-in requests go to the identity provider, never to our backend, so this
|
|
3
|
+
* is the only place a signup can say where it came from: the post-login Action
|
|
4
|
+
* reads it from `event.request.user_agent` and passes it on with the user. The
|
|
5
|
+
* `agent/` token names the coding agent that ran the CLI, when one did.
|
|
6
|
+
*/
|
|
7
|
+
export declare const USER_AGENT: string;
|
|
1
8
|
/**
|
|
2
9
|
* What both sign-in channels hand to `establishSession`. The refresh token is
|
|
3
10
|
* optional: the identity provider only issues one when the application has the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth0.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/auth0.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth0.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/auth0.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,eAAO,MAAM,UAAU,QAAsC,CAAC;AAU9D;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAWF;;;GAGG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,QAAQ,CAAC,CA2BpB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAoBhE;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,cAAc,GAAG,MAAM,GAAG,SAAS,CAAC,CAkB9C;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,GACxC,MAAM,CAkBR;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,GACxC,MAAM,GAAG,SAAS,CAMpB"}
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { detectCodingAgent } from "@cargo-ai/cdk/cli";
|
|
1
3
|
import { getOAuthConfig } from "../../oauthConfig.js";
|
|
2
4
|
import { failWith } from "../runHandler.js";
|
|
3
5
|
const REQUEST_TIMEOUT_MS = 15_000;
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const { version } = require("../../../package.json");
|
|
8
|
+
/**
|
|
9
|
+
* Sign-in requests go to the identity provider, never to our backend, so this
|
|
10
|
+
* is the only place a signup can say where it came from: the post-login Action
|
|
11
|
+
* reads it from `event.request.user_agent` and passes it on with the user. The
|
|
12
|
+
* `agent/` token names the coding agent that ran the CLI, when one did.
|
|
13
|
+
*/
|
|
14
|
+
export const USER_AGENT = buildUserAgent(detectCodingAgent());
|
|
15
|
+
function buildUserAgent(codingAgent) {
|
|
16
|
+
if (codingAgent === undefined) {
|
|
17
|
+
return `cargo-ai/${version}`;
|
|
18
|
+
}
|
|
19
|
+
return `cargo-ai/${version} agent/${codingAgent.replace(/\s+/g, "-")}`;
|
|
20
|
+
}
|
|
4
21
|
// Only used when the provider omits `expires_in`, which Auth0 does not do.
|
|
5
22
|
const FALLBACK_LIFETIME_SECONDS = 3600;
|
|
6
23
|
/**
|
|
@@ -15,6 +32,7 @@ export async function postToAuth0(opts) {
|
|
|
15
32
|
return await fetch(`https://${config.domain}${opts.path}`, {
|
|
16
33
|
method: "POST",
|
|
17
34
|
headers: {
|
|
35
|
+
"user-agent": USER_AGENT,
|
|
18
36
|
"content-type": isForm
|
|
19
37
|
? "application/x-www-form-urlencoded"
|
|
20
38
|
: "application/json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/worker.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAQxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/worker.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAQxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAoPN"}
|
|
@@ -56,12 +56,14 @@ export function registerWorkerCommands(parent, getApi) {
|
|
|
56
56
|
.option("--name <name>", "New display name")
|
|
57
57
|
.option("--folder-uuid <uuid>", "New folder UUID (pass 'null' to move to the workspace root)")
|
|
58
58
|
.option("--triggers <json>", "Full replacement list of cron triggers (pass '[]' to remove all)")
|
|
59
|
+
.option("--run-as-user-uuid <uuid>", "Service user the worker runs as (pass 'null' to clear). Cargo then binds a temporary CARGO_API_TOKEN for that user.")
|
|
59
60
|
.action(async (opts) => {
|
|
60
61
|
const api = getApi();
|
|
61
62
|
const result = await handleApiCall(() => api.hosting.worker.update({
|
|
62
63
|
uuid: opts.uuid,
|
|
63
64
|
name: opts.name,
|
|
64
65
|
folderUuid: opts.folderUuid === "null" ? null : opts.folderUuid,
|
|
66
|
+
runAsUserUuid: opts.runAsUserUuid === "null" ? null : opts.runAsUserUuid,
|
|
65
67
|
triggers: opts.triggers !== undefined
|
|
66
68
|
? parseJson(opts.triggers, "--triggers")
|
|
67
69
|
: undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAerC,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAerC,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,IAAI,CA2D5E;AAED,eAAO,MAAM,iBAAiB,aAClB,MAAM,GAAG,SAAS,KAC3B,MAAM,GAAG,SAOX,CAAC;AAEF,eAAO,MAAM,kBAAkB,YACpB,MAAM,QACT,MAAM,GAAG,SAAS,KACvB,MAaF,CAAC"}
|
package/build/commands/mcp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import { SessionExpiredError } from "@cargo-ai/cdk/cli";
|
|
2
|
+
import { detectCodingAgent, SessionExpiredError } from "@cargo-ai/cdk/cli";
|
|
3
3
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
4
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
5
|
import { getConfig } from "../config.js";
|
|
@@ -49,6 +49,10 @@ credentials file). stdout carries the MCP protocol; all logs go to stderr.`)
|
|
|
49
49
|
if (workspaceUuid !== undefined) {
|
|
50
50
|
headers["selected-workspace-uuid"] = workspaceUuid;
|
|
51
51
|
}
|
|
52
|
+
const codingAgent = detectCodingAgent();
|
|
53
|
+
if (codingAgent !== undefined) {
|
|
54
|
+
headers["x-cargo-origin-agent"] = codingAgent;
|
|
55
|
+
}
|
|
52
56
|
info(`Cargo MCP bridge -> ${endpoint}`);
|
|
53
57
|
await runBridge(endpoint, headers, getAccessToken);
|
|
54
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/commands/workspaceManagement/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/commands/workspaceManagement/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAsM7E"}
|
|
@@ -30,15 +30,16 @@ Examples:
|
|
|
30
30
|
user
|
|
31
31
|
.command("create")
|
|
32
32
|
.description("Invite a user to the workspace")
|
|
33
|
-
.requiredOption("--
|
|
33
|
+
.requiredOption("--email <email>", "User email address (string, required)")
|
|
34
34
|
.requiredOption("--role-slug <slug>", "Role slug to assign (string, required)")
|
|
35
35
|
.addHelpText("after", `
|
|
36
36
|
Example:
|
|
37
|
-
$ cargo-ai workspaceManagement user create --
|
|
37
|
+
$ cargo-ai workspaceManagement user create --email alice@example.com --role-slug admin`)
|
|
38
38
|
.action(async (opts) => {
|
|
39
39
|
const api = getApi();
|
|
40
40
|
const result = await handleApiCall(() => api.workspaceManagement.user.create({
|
|
41
|
-
|
|
41
|
+
kind: "person",
|
|
42
|
+
email: opts.email,
|
|
42
43
|
roleSlug: opts.roleSlug,
|
|
43
44
|
}));
|
|
44
45
|
outputJson(result);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cargo-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.108",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://getcargo.ai",
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@ai-sdk/harness": "^1.0.144",
|
|
69
69
|
"@ai-sdk/harness-claude-code": "^1.0.148",
|
|
70
|
-
"@cargo-ai/api": "^1.0.
|
|
70
|
+
"@cargo-ai/api": "^1.0.92",
|
|
71
71
|
"@cargo-ai/app-sdk": "^1.0.11",
|
|
72
|
-
"@cargo-ai/cdk": "^1.0.
|
|
73
|
-
"@cargo-ai/types": "^1.0.
|
|
72
|
+
"@cargo-ai/cdk": "^1.0.110",
|
|
73
|
+
"@cargo-ai/types": "^1.0.96",
|
|
74
74
|
"@cargo-ai/utils": "^1.0.32",
|
|
75
75
|
"@cargo-ai/worker-sdk": "^1.0.20",
|
|
76
76
|
"@modelcontextprotocol/sdk": "^1.31.0",
|