mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-23 17:52:49 +00:00
Make every trusted Git repository directly distributable without introducing a registry or package manager. Managed checkouts retain their resolved commit, track branches explicitly, and stage validation before activation so failed updates restore the running version.
95 lines
3.9 KiB
TypeScript
95 lines
3.9 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { createCli } from "./cli.js";
|
|
|
|
describe("canonical CLI surface", () => {
|
|
it("shows project, workspace, and heartbeat commands while hiding worktree compatibility", () => {
|
|
const cli = createCli();
|
|
const help = cli.helpInformation();
|
|
expect(help).toContain("project");
|
|
expect(help).toContain("workspace");
|
|
expect(help).toContain("heartbeat");
|
|
expect(help).not.toContain("worktree");
|
|
});
|
|
|
|
it("offers identical top-level and daemon config reload commands", () => {
|
|
const cli = createCli();
|
|
const reload = cli.commands.find((command) => command.name() === "reload");
|
|
const daemon = cli.commands.find((command) => command.name() === "daemon");
|
|
const nestedReload = daemon?.commands.find((command) => command.name() === "reload");
|
|
|
|
expect(reload?.helpInformation()).toContain("--host <host>");
|
|
expect(reload?.helpInformation()).toContain("--json");
|
|
expect(nestedReload?.helpInformation()).toContain("--host <host>");
|
|
expect(nestedReload?.helpInformation()).toContain("--json");
|
|
});
|
|
|
|
it("names explicit workspace creation without exposing older syntax", () => {
|
|
const run = createCli().commands.find((command) => command.name() === "run");
|
|
const help = run?.helpInformation();
|
|
expect(help).toContain("--new-workspace <local|worktree>");
|
|
expect(help).not.toContain("--isolation");
|
|
expect(help).not.toContain("--worktree <name>");
|
|
});
|
|
|
|
it("offers the worktree creation options on run", () => {
|
|
const run = createCli().commands.find((command) => command.name() === "run");
|
|
const help = run?.helpInformation();
|
|
expect(help).toContain("--worktree-mode <mode>");
|
|
expect(help).toContain("--worktree-slug <slug>");
|
|
expect(help).toContain("--new-branch <name>");
|
|
expect(help).toContain("--branch <name>");
|
|
expect(help).toContain("--pr-number <n>");
|
|
expect(help).toContain("--forge <forge>");
|
|
});
|
|
|
|
it("uses background for execution and reserves detach for ownership", () => {
|
|
const run = createCli().commands.find((command) => command.name() === "run");
|
|
expect(run?.helpInformation()).toContain("--background");
|
|
expect(run?.helpInformation()).not.toContain("--detach");
|
|
});
|
|
|
|
it("offers thinking configuration when running, updating, and scheduling agents", () => {
|
|
const cli = createCli();
|
|
const run = cli.commands.find((command) => command.name() === "run");
|
|
const agent = cli.commands.find((command) => command.name() === "agent");
|
|
const update = agent?.commands.find((command) => command.name() === "update");
|
|
const schedule = cli.commands.find((command) => command.name() === "schedule");
|
|
const scheduleCreate = schedule?.commands.find((command) => command.name() === "create");
|
|
|
|
expect(run?.helpInformation()).toContain("--thinking <id>");
|
|
expect(update?.helpInformation()).toContain("--thinking <id>");
|
|
expect(scheduleCreate?.helpInformation()).toContain("--thinking <id>");
|
|
});
|
|
|
|
it("offers opening an existing agent in the desktop app", () => {
|
|
const agent = createCli().commands.find((command) => command.name() === "agent");
|
|
const open = agent?.commands.find((command) => command.name() === "open");
|
|
|
|
expect(open?.helpInformation()).toContain("<agent-id>");
|
|
expect(open?.helpInformation()).toContain("--server <server-id>");
|
|
});
|
|
|
|
it("offers the complete local plugin lifecycle", () => {
|
|
const plugin = createCli().commands.find((command) => command.name() === "plugin");
|
|
|
|
expect(plugin?.commands.map((command) => command.name())).toEqual([
|
|
"init",
|
|
"ls",
|
|
"logs",
|
|
"install",
|
|
"status",
|
|
"update",
|
|
"reload",
|
|
"enable",
|
|
"disable",
|
|
"remove",
|
|
]);
|
|
expect(
|
|
plugin?.commands.find((command) => command.name() === "init")?.helpInformation(),
|
|
).toContain("--id <id>");
|
|
expect(
|
|
plugin?.commands.find((command) => command.name() === "install")?.helpInformation(),
|
|
).toContain("--id <id>");
|
|
});
|
|
});
|