@united-robotics/cli 0.3.0 → 0.4.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.
- package/dist/index.js +15 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -54,9 +54,21 @@ program.command("repo").argument("<cmd>").argument("<projectId>").action(async (
|
|
|
54
54
|
if (cmd !== "ls") throw new Error("supported: ur repo ls <projectId>");
|
|
55
55
|
console.log(JSON.stringify(await api(`/api/projects/${projectId}/repos`), null, 2));
|
|
56
56
|
});
|
|
57
|
+
var git = program.command("git").description("Git helpers for tenant workspaces");
|
|
58
|
+
git.command("identity").option("--name <name>", "Git user.name", "exis[ai]").option("--email <email>", "Git user.email", "gotexis@gmail.com").option("--global", "write global git config instead of current repo").action((opts) => {
|
|
59
|
+
const scope = opts.global ? "--global" : "--local";
|
|
60
|
+
for (const [key, value] of [["user.name", opts.name], ["user.email", opts.email]]) {
|
|
61
|
+
const child = spawnSync("git", ["config", scope, key, value], { stdio: "inherit" });
|
|
62
|
+
if ((child.status ?? 1) !== 0) process.exit(child.status ?? 1);
|
|
63
|
+
}
|
|
64
|
+
console.log(`Configured git committer identity: ${opts.name} <${opts.email}>`);
|
|
65
|
+
});
|
|
57
66
|
var github = program.command("github");
|
|
58
|
-
github.command("token").option("--project <projectId>", "project id", "skinspirit-main").option("--json", "emit full JSON").action(async (opts) => {
|
|
59
|
-
const result = await api(`/api/projects/${opts.project}/github-token`, {
|
|
67
|
+
github.command("token").option("--project <projectId>", "project id", "skinspirit-main").option("--repo <repo>", "repo id, name, full name, or URL within the project").option("--json", "emit full JSON").action(async (opts) => {
|
|
68
|
+
const result = await api(`/api/projects/${opts.project}/github-token`, {
|
|
69
|
+
method: "POST",
|
|
70
|
+
body: JSON.stringify(opts.repo ? { repo: opts.repo } : {})
|
|
71
|
+
});
|
|
60
72
|
if (opts.json) console.log(JSON.stringify(result, null, 2));
|
|
61
73
|
else console.log(result.token);
|
|
62
74
|
});
|
|
@@ -77,6 +89,6 @@ program.command("cicd").description("Alias for tenant-scoped CI/CD deployment st
|
|
|
77
89
|
program.command("codex").argument("<cmd>").option("--project <projectId>", "project id", "skinspirit-main").action((cmd, opts) => {
|
|
78
90
|
if (cmd !== "onboard") throw new Error("supported: ur codex onboard");
|
|
79
91
|
const cfg = load();
|
|
80
|
-
console.log(`Establish new agent workspace by globally installing \`@united-robotics/cli\` module (ensuring there is a working node, nvm and git) and authenticate using token "ur login --token ${cfg.token ?? "<TOKEN>"}". Then run \`ur project ls\`, \`ur project clone ${opts.project}\`, and when GitHub write access is needed use \`ur github token --project ${opts.project}\` for a short-lived GitHub App token. Use that project as codex project base from now on, and familiarize yourself.`);
|
|
92
|
+
console.log(`Establish new agent workspace by globally installing \`@united-robotics/cli\` module (ensuring there is a working node, nvm and git) and authenticate using token "ur login --token ${cfg.token ?? "<TOKEN>"}". Then run \`ur project ls\`, \`ur project clone ${opts.project}\`, and when GitHub write access is needed use \`ur github token --project ${opts.project}\` for a short-lived GitHub App token. Before committing to Vercel-linked repos, configure a GitHub-associated committer identity so Vercel does not block deployments: run \`ur git identity\` inside the repo, or run \`git config user.name "exis[ai]" && git config user.email "gotexis@gmail.com"\`. Use that project as codex project base from now on, and familiarize yourself.`);
|
|
81
93
|
});
|
|
82
94
|
program.parseAsync();
|