Skip to content

Commit a130c6e

Browse files
Bharath-codeclaude
andcommitted
feat(cli): gate coach, audit, price, voice behind labs
--help now matches the five-command positioning: the weekly loop up top, intelligence add-ons opt-in via `loopkit labs on` (8 gated commands total). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 822f328 commit a130c6e

6 files changed

Lines changed: 28 additions & 23 deletions

File tree

‎packages/cli/src/commands/__tests__/coach.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect, vi, beforeEach } from "vitest";
1+
import { describe, it, expect, vi, beforeEach, beforeAll, afterAll } from "vitest";
22
import { coachCommand } from "../coach.js";
33
import {
44
readConfig,
@@ -50,6 +50,8 @@ vi.mock("../../ui/theme.js", async (importOriginal) => {
5050
});
5151

5252
describe("coachCommand --dna", () => {
53+
beforeAll(() => { process.env.LOOPKIT_LABS = "1"; });
54+
afterAll(() => { delete process.env.LOOPKIT_LABS; });
5355
beforeEach(() => {
5456
vi.clearAllMocks();
5557
// Default config mock

‎packages/cli/src/commands/__tests__/labs.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ describe("labs flag", () => {
6565
expect(cmds).toContain("keywords");
6666
expect(cmds).toContain("timing");
6767
expect(cmds).toContain("update");
68-
expect(cmds.length).toBe(4);
68+
expect(cmds).toContain("coach");
69+
expect(cmds).toContain("audit");
70+
expect(cmds).toContain("price");
71+
expect(cmds).toContain("voice");
72+
expect(cmds.length).toBe(8);
6973
});
7074
});

‎packages/cli/src/commands/coach.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { labsGate } from "./labs.js";
12
import {
23
readConfig,
34
writeConfig,
@@ -60,6 +61,7 @@ export async function coachCommand(options?: {
6061
on?: boolean;
6162
dna?: boolean;
6263
}): Promise<void> {
64+
if (!labsGate("coach")) return;
6365
const config = readConfig();
6466
const slug = config.activeProject;
6567

‎packages/cli/src/commands/labs.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import { readConfig, writeConfig } from "../storage/local.js";
22
import { clog } from "../ui/theme.js";
33

4-
const LABS_COMMANDS = new Set(["radar", "keywords", "timing", "update"]);
4+
const LABS_COMMANDS = new Set([
5+
"radar",
6+
"keywords",
7+
"timing",
8+
"update",
9+
"coach",
10+
"audit",
11+
"price",
12+
"voice",
13+
]);
514

615
export function isLabsEnabled(): boolean {
716
if (process.env.LOOPKIT_LABS === "1") return true;

‎packages/cli/src/index.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ makeCommand(
201201

202202
makeCommand(
203203
"coach",
204-
"AI coaching based on your shipping patterns and milestones",
204+
"(labs) AI coaching based on your shipping patterns and milestones",
205205
() => import("./commands/coach.js"),
206206
(cmd) =>
207207
cmd
@@ -242,7 +242,7 @@ makeCommand(
242242

243243
makeCommand(
244244
"audit",
245-
"Founder therapy: 2-page report on the last 8 weeks of work",
245+
"(labs) Founder therapy: 2-page report on the last 8 weeks of work",
246246
() => import("./commands/audit.js"),
247247
(cmd) =>
248248
cmd
@@ -253,7 +253,7 @@ makeCommand(
253253

254254
makeCommand(
255255
"price",
256-
"Pricing copilot: 2-3 tier model + 30-day validation experiment",
256+
"(labs) Pricing copilot: 2-3 tier model + 30-day validation experiment",
257257
() => import("./commands/price.js"),
258258
(cmd) =>
259259
cmd
@@ -264,7 +264,7 @@ makeCommand(
264264

265265
makeCommand(
266266
"voice",
267-
"Record a 60s standup → transcribed → tasks added to tasks.md",
267+
"(labs) Record a 60s standup → transcribed → tasks added to tasks.md",
268268
() => import("./commands/track-voice.js"),
269269
(cmd) =>
270270
cmd

‎packages/cli/src/ui/help.ts‎

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,10 @@ const PRIMARY_COMMANDS = [
5959
when: "On payment",
6060
flags: ["--add <amount>", "--log"],
6161
},
62-
{
63-
name: "audit",
64-
args: "",
65-
description: "Founder therapy: 2-page report on the last 8 weeks",
66-
when: "Monthly",
67-
flags: ["--weeks <n>", "--export <md|pdf>", "--cohort"],
68-
},
69-
{
70-
name: "price",
71-
args: "",
72-
description: "Pricing copilot: tiers + 30-day experiment",
73-
when: "On pricing decision",
74-
flags: ["--local", "--export <md>", "--experiment <days>"],
75-
},
7662
] as const;
7763

7864
const TOOL_COMMANDS = [
79-
{ name: "coach", description: "AI coaching based on your shipping patterns" },
8065
{ name: "celebrate", description: "Confetti + card; --annual [year] for year-in-review" },
81-
{ name: "voice", description: "Record a 60s standup → transcribed → tasks added" },
8266
{ name: "auth", description: "Manage your API key (BYOK)" },
8367
{ name: "sync", description: "Check or reset CLI → dashboard sync health" },
8468
{ name: "aliases", description: "Install shell shortcuts: lk, lks, lkt, lkl" },
@@ -87,6 +71,10 @@ const TOOL_COMMANDS = [
8771
] as const;
8872

8973
const LABS_COMMANDS = [
74+
{ name: "coach", description: "(labs) AI coaching based on your shipping patterns" },
75+
{ name: "audit", description: "(labs) Founder therapy: 2-page report on the last 8 weeks" },
76+
{ name: "price", description: "(labs) Pricing copilot: tiers + 30-day experiment" },
77+
{ name: "voice", description: "(labs) Record a 60s standup → transcribed → tasks added" },
9078
{ name: "radar", description: "(labs) Scan Product Hunt & HN launches in your category" },
9179
{ name: "keywords", description: "(labs) Find low-competition keywords in your niche" },
9280
{ name: "timing", description: "(labs) Analyze market timing signals" },

0 commit comments

Comments
 (0)