@cargo-ai/cli 1.0.16 → 1.0.17
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../src/commands/context/repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../src/commands/context/repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAaN"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { handleApiCall, outputJson
|
|
1
|
+
import { handleApiCall, outputJson } from "../runHandler.js";
|
|
2
2
|
export function registerRepositoryCommands(parent, getApi) {
|
|
3
3
|
const repository = parent
|
|
4
4
|
.command("repository")
|
|
@@ -11,23 +11,4 @@ export function registerRepositoryCommands(parent, getApi) {
|
|
|
11
11
|
const result = await handleApiCall(() => api.context.repository.get());
|
|
12
12
|
outputJson(result);
|
|
13
13
|
});
|
|
14
|
-
repository
|
|
15
|
-
.command("update")
|
|
16
|
-
.description("Update the context repository configuration")
|
|
17
|
-
.option("--source <json>", 'Repository source (JSON, e.g. {"kind":"managed"} or {"kind":"custom","connectorUuid":"..."})')
|
|
18
|
-
.option("--repository-owner <owner>", "GitHub owner (user or org)")
|
|
19
|
-
.option("--repository-name <name>", "GitHub repository name")
|
|
20
|
-
.option("--default-branch <branch>", "Default branch (e.g. main)")
|
|
21
|
-
.action(async (opts) => {
|
|
22
|
-
const api = getApi();
|
|
23
|
-
const result = await handleApiCall(() => api.context.repository.update({
|
|
24
|
-
source: opts.source !== undefined
|
|
25
|
-
? parseJson(opts.source, "--source")
|
|
26
|
-
: undefined,
|
|
27
|
-
repositoryOwner: opts.repositoryOwner,
|
|
28
|
-
repositoryName: opts.repositoryName,
|
|
29
|
-
defaultBranch: opts.defaultBranch,
|
|
30
|
-
}));
|
|
31
|
-
outputJson(result);
|
|
32
|
-
});
|
|
33
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/commands/context/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/commands/context/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAoJN"}
|
|
@@ -46,10 +46,11 @@ export function registerRuntimeCommands(parent, getApi) {
|
|
|
46
46
|
});
|
|
47
47
|
runtime
|
|
48
48
|
.command("edit")
|
|
49
|
-
.description("Replace
|
|
49
|
+
.description("Replace occurrences of oldString with newString and push to the default branch")
|
|
50
50
|
.requiredOption("--path <path>", "Path to the file")
|
|
51
|
-
.requiredOption("--old-string <old>", "Exact substring to replace (must occur once)")
|
|
52
|
-
.requiredOption("--new-string <new>", "Replacement string (may be empty to delete the match)")
|
|
51
|
+
.requiredOption("--old-string <old>", "Exact substring to replace (must occur once unless --replace-all is set)")
|
|
52
|
+
.requiredOption("--new-string <new>", "Replacement string (may be empty to delete the match). Must differ from --old-string.")
|
|
53
|
+
.option("--replace-all", "Replace every occurrence of --old-string instead of requiring a single match")
|
|
53
54
|
.option("--commit-message <message>", "Commit message override")
|
|
54
55
|
.action(async (opts) => {
|
|
55
56
|
const api = getApi();
|
|
@@ -57,15 +58,17 @@ export function registerRuntimeCommands(parent, getApi) {
|
|
|
57
58
|
path: opts.path,
|
|
58
59
|
oldString: opts.oldString,
|
|
59
60
|
newString: opts.newString,
|
|
61
|
+
replaceAll: opts.replaceAll,
|
|
60
62
|
commitMessage: opts.commitMessage,
|
|
61
63
|
}));
|
|
62
64
|
outputJson(result);
|
|
63
65
|
});
|
|
64
66
|
runtime
|
|
65
67
|
.command("execute")
|
|
66
|
-
.description("Run a shell command in the runtime sandbox
|
|
68
|
+
.description("Run a shell command in the runtime sandbox. Tracked working-tree changes are auto-committed to the workspace's default branch (gitignored paths are skipped). Use --commit-message to override the auto-commit subject.")
|
|
67
69
|
.requiredOption("--command <command>", "Shell command to run")
|
|
68
70
|
.option("--args <json>", "JSON array of arguments")
|
|
71
|
+
.option("--commit-message <message>", "Override for the auto-commit subject (defaults to `context(runtime): execute <command>`)")
|
|
69
72
|
.action(async (opts) => {
|
|
70
73
|
const api = getApi();
|
|
71
74
|
const args = opts.args !== undefined
|
|
@@ -74,6 +77,7 @@ export function registerRuntimeCommands(parent, getApi) {
|
|
|
74
77
|
const result = await handleApiCall(() => api.context.runtime.execute({
|
|
75
78
|
command: opts.command,
|
|
76
79
|
args,
|
|
80
|
+
commitMessage: opts.commitMessage,
|
|
77
81
|
}));
|
|
78
82
|
outputJson(result);
|
|
79
83
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cargo-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Command-line interface for the Cargo API",
|
|
6
6
|
"engines": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"format:check": "prettier --check ."
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@cargo-ai/api": "^1.0.
|
|
31
|
+
"@cargo-ai/api": "^1.0.25",
|
|
32
32
|
"@cargo-ai/app-sdk": "^1.0.0",
|
|
33
33
|
"@cargo-ai/worker-sdk": "^1.0.0",
|
|
34
34
|
"commander": "^12.1.0"
|