lockstep-cli 0.0.1 → 0.0.2
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/connect.d.ts +4 -2
- package/dist/connect.js +10 -24
- package/dist/connect.js.map +1 -1
- package/package.json +1 -1
package/dist/connect.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Connect the current repo
|
|
3
|
-
*
|
|
2
|
+
* Connect the current repo. The server resolves the remote and either:
|
|
3
|
+
* - joins you (if you have GitHub access to an already-connected repo — no approval needed),
|
|
4
|
+
* - opens it (if you're already a member), or
|
|
5
|
+
* - creates the project and connects it.
|
|
4
6
|
*/
|
|
5
7
|
export declare function runConnect(opts: {
|
|
6
8
|
org?: string;
|
package/dist/connect.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { cloud } from "./cloud.js";
|
|
2
2
|
import { gitRemote } from "./mcp/git.js";
|
|
3
3
|
/**
|
|
4
|
-
* Connect the current repo
|
|
5
|
-
*
|
|
4
|
+
* Connect the current repo. The server resolves the remote and either:
|
|
5
|
+
* - joins you (if you have GitHub access to an already-connected repo — no approval needed),
|
|
6
|
+
* - opens it (if you're already a member), or
|
|
7
|
+
* - creates the project and connects it.
|
|
6
8
|
*/
|
|
7
9
|
export async function runConnect(opts) {
|
|
8
10
|
const remote = gitRemote(process.cwd());
|
|
@@ -10,29 +12,13 @@ export async function runConnect(opts) {
|
|
|
10
12
|
console.error("No git 'origin' remote here — Lockstep identifies a repo by its remote.");
|
|
11
13
|
process.exit(1);
|
|
12
14
|
}
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const created = await cloud.post("/orgs", {
|
|
17
|
-
name: opts.org ?? `${me.principal.githubLogin}'s workspace`,
|
|
18
|
-
});
|
|
19
|
-
orgId = created.orgId;
|
|
20
|
-
}
|
|
21
|
-
const projectName = opts.project ?? remote.split("/").pop() ?? "default";
|
|
22
|
-
const overview = await cloud.get(`/orgs/${orgId}/overview`);
|
|
23
|
-
let projectId = overview?.projects.find((p) => p.name === projectName)?.id;
|
|
24
|
-
if (!projectId) {
|
|
25
|
-
projectId = (await cloud.post(`/orgs/${orgId}/projects`, { name: projectName })).projectId;
|
|
26
|
-
}
|
|
27
|
-
const po = await cloud.get(`/orgs/${orgId}/projects/${projectId}/overview`);
|
|
28
|
-
const already = po?.repos.some((r) => r.gitRemote === remote);
|
|
29
|
-
if (!already) {
|
|
30
|
-
await cloud.post(`/orgs/${orgId}/projects/${projectId}/repos`, { gitRemote: remote });
|
|
31
|
-
}
|
|
32
|
-
console.log(`✓ connected ${remote}`);
|
|
33
|
-
console.log(` → project "${projectName}" (org ${orgId.slice(0, 8)})`);
|
|
15
|
+
const r = await cloud.post("/connect", { gitRemote: remote, project: opts.project });
|
|
16
|
+
const verb = r.status === "created" ? "created and connected" : r.status === "joined" ? "joined" : "already connected to";
|
|
17
|
+
console.log(`✓ ${verb} project "${r.projectName}" (${remote})`);
|
|
34
18
|
console.log(`\nOpen this repo in Claude Code — Lockstep registers the session automatically.`);
|
|
35
|
-
|
|
19
|
+
if (r.status === "created") {
|
|
20
|
+
console.log(`Teammates with GitHub access can join by running \`lockstep connect\` in their clone.`);
|
|
21
|
+
}
|
|
36
22
|
}
|
|
37
23
|
/** Invite a teammate by GitHub handle to this repo's project. */
|
|
38
24
|
export async function runInvite(handle) {
|
package/dist/connect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,S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