@fieldwork-ai/cli 0.26.1 → 0.27.3
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 +3 -3
- package/dist/commands/connectors.js +10 -13
- package/dist/config.js +1 -1
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Fieldwork CLI (`@fieldwork-ai/cli`)
|
|
2
2
|
|
|
3
|
-
The Fieldwork CLI: drive your organization's [Fieldwork](https://app.
|
|
3
|
+
The Fieldwork CLI: drive your organization's [Fieldwork](https://app.fieldwork.ai) assets and tools from a terminal, a script, or an agent harness like Claude Code.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install -g @fieldwork-ai/cli
|
|
@@ -45,7 +45,7 @@ Mutations prompt for confirmation on a TTY; pass `--yes` to skip (required in no
|
|
|
45
45
|
|
|
46
46
|
The connector development loop end to end: `connectors pull acme_erp` → edit the adapter → `connectors publish acme_erp --message "…" --base-revision N` (a new key creates the definition from the tree's `connector.json`) → `connectors connect acme_erp --spec spec.json` → `connectors secrets set <id>` → `automations run-now <sync> --follow` to watch the logs.
|
|
47
47
|
|
|
48
|
-
Publishing initializes a new connector from `connector.json`, but subsequent
|
|
48
|
+
Publishing initializes a new connector from `connector.json`, but subsequent package revisions leave the `connectors` row's metadata unchanged. To edit its display name, description, branding, or REST secret-name hints, use `fieldwork connectors metadata <definition-id>`, then `fieldwork connectors update-metadata <definition-id> --changes changes.json --expected-updated-at '<exact updated_at from the read>'`. The update requires connector edit access and rejects stale reads; credential values are managed separately through `secrets`.
|
|
49
49
|
|
|
50
50
|
## Auth and configuration
|
|
51
51
|
|
|
@@ -54,7 +54,7 @@ Credential resolution order: the injected container file (`~/.fieldwork/credenti
|
|
|
54
54
|
Prefer a native tool surface in an MCP-capable harness? Fieldwork is also a remote MCP server:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
claude mcp add --transport http fieldwork https://app.
|
|
57
|
+
claude mcp add --transport http fieldwork https://app.fieldwork.ai/mcp
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
## Exit codes
|
|
@@ -169,17 +169,14 @@ export function registerConnectorCommands(program) {
|
|
|
169
169
|
.description("Download an org-authored connector definition's adapter source")
|
|
170
170
|
.option("--out <dir>", "target directory (defaults to ./<key>)")
|
|
171
171
|
.option("--revision <n>", "a historical revision instead of head")
|
|
172
|
-
.option("--
|
|
172
|
+
.option("--package-name <name>", "the named package on this connector")
|
|
173
173
|
.action(async (key, opts) => {
|
|
174
174
|
const { json } = getContext();
|
|
175
|
-
const
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
query.set("action_name", opts.actionName);
|
|
181
|
-
const suffix = query.size ? `?${query}` : "";
|
|
182
|
-
const body = await apiJson(`/api/organizations/${requireOrgId()}/connectors/${definition.connector_id}/source${suffix}`);
|
|
175
|
+
const suffix = opts.revision ? `?${new URLSearchParams({ revision: opts.revision })}` : "";
|
|
176
|
+
const path = opts.packageName
|
|
177
|
+
? `/api/organizations/${requireOrgId()}/packages/${encodeURIComponent(opts.packageName)}/source${suffix}`
|
|
178
|
+
: `/api/organizations/${requireOrgId()}/connectors/${(await resolveDefinition(key)).connector_id}/source${suffix}`;
|
|
179
|
+
const body = await apiJson(path);
|
|
183
180
|
const dir = opts.out ?? key;
|
|
184
181
|
const pulled = writeBundle(dir, body.files);
|
|
185
182
|
if (json) {
|
|
@@ -193,7 +190,7 @@ export function registerConnectorCommands(program) {
|
|
|
193
190
|
.description("Publish an adapter directory as a new revision (creates the definition on first publish)")
|
|
194
191
|
.requiredOption("--message <message>", "what changed and why")
|
|
195
192
|
.option("--base-revision <n>", "head revision your changes are based on (required once code is published)")
|
|
196
|
-
.option("--
|
|
193
|
+
.option("--package-name <name>", "create or update this named package on the connector")
|
|
197
194
|
.action(async (dir, opts) => {
|
|
198
195
|
const { json, yes } = getContext();
|
|
199
196
|
const files = readBundle(dir);
|
|
@@ -211,13 +208,13 @@ export function registerConnectorCommands(program) {
|
|
|
211
208
|
if (key === "?") {
|
|
212
209
|
fail('the tree\'s connector.json must carry a "key" field — for a package with no system, use `packages publish`', EXIT.usage);
|
|
213
210
|
}
|
|
214
|
-
await confirm(`Publish ${Object.keys(files).length} files to connector "${key}"${opts.
|
|
211
|
+
await confirm(`Publish ${Object.keys(files).length} files to connector "${key}"${opts.packageName ? `, package "${opts.packageName}"` : ""}?`, yes);
|
|
215
212
|
const body = await apiJson(`/api/organizations/${requireOrgId()}/connectors/publish`, {
|
|
216
213
|
method: "POST",
|
|
217
214
|
body: JSON.stringify({
|
|
218
215
|
message: opts.message,
|
|
219
216
|
base_revision: opts.baseRevision ? Number(opts.baseRevision) : undefined,
|
|
220
|
-
|
|
217
|
+
name: opts.packageName,
|
|
221
218
|
files,
|
|
222
219
|
}),
|
|
223
220
|
});
|
|
@@ -229,7 +226,7 @@ export function registerConnectorCommands(program) {
|
|
|
229
226
|
printData(await apiJson(`/api/organizations/${requireOrgId()}/connectors/${id}/metadata`), getContext().json);
|
|
230
227
|
});
|
|
231
228
|
connectors.command("update-metadata <definition-id>")
|
|
232
|
-
.description("Edit connector metadata separately from
|
|
229
|
+
.description("Edit connector metadata separately from package code")
|
|
233
230
|
.requiredOption("--changes <json-file>", "metadata fields to change")
|
|
234
231
|
.requiredOption("--expected-updated-at <timestamp>", "exact updated_at from metadata read")
|
|
235
232
|
.action(async (id, opts) => {
|
package/dist/config.js
CHANGED
|
@@ -64,7 +64,7 @@ export function resolveConfig(flags) {
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
return {
|
|
67
|
-
apiUrl: flagUrl ?? process.env.FIELDWORK_API_URL ?? "https://app.
|
|
67
|
+
apiUrl: flagUrl ?? process.env.FIELDWORK_API_URL ?? "https://app.fieldwork.ai",
|
|
68
68
|
token: flagToken ?? null,
|
|
69
69
|
source: flagToken ? "flags" : "none",
|
|
70
70
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fieldwork-ai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.3",
|
|
4
|
+
"packageManager": "pnpm@10.28.0",
|
|
4
5
|
"description": "Fieldwork asset-management CLI",
|
|
5
6
|
"license": "UNLICENSED",
|
|
6
7
|
"type": "module",
|
|
@@ -36,5 +37,10 @@
|
|
|
36
37
|
"exports": {
|
|
37
38
|
"./package.json": "./package.json",
|
|
38
39
|
"./*": "./dist/*.js"
|
|
40
|
+
},
|
|
41
|
+
"pnpm": {
|
|
42
|
+
"overrides": {
|
|
43
|
+
"source-map-js@<1.2.2": "^1.2.2"
|
|
44
|
+
}
|
|
39
45
|
}
|
|
40
46
|
}
|