| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- import { test } from "@microsoft/tui-test"
- import { CLINE_BIN } from "./helpers/constants.js"
- import { expectVisible, testEnv } from "./utils.js"
- const HELP_TERMINAL = { columns: 120, rows: 50 }
- // ===========================================================================
- // cline --help (root help)
- // ===========================================================================
- test.describe("cline --help", () => {
- test.use({
- program: { file: CLINE_BIN, args: ["--help"] },
- env: testEnv("claude-sonnet-4.6"),
- ...HELP_TERMINAL,
- })
- test("shows Usage line and lists all subcommands", async ({ terminal }) => {
- await expectVisible(terminal, [
- "Usage:",
- "task|t",
- "history|h",
- "config [options]",
- "auth [options]",
- "version",
- "update [options]",
- "dev ",
- ])
- })
- test("shows all root-level option flags", async ({ terminal }) => {
- await expectVisible(terminal, [
- "--act",
- "--plan",
- "--yolo",
- "--timeout",
- "--model",
- "--verbose",
- "--cwd",
- "--config",
- "--thinking",
- "--reasoning-effort",
- "--max-consecutive-mistakes",
- "--json",
- "--double-check-completion",
- "--acp",
- "--tui",
- "--taskId",
- ])
- })
- })
- // ===========================================================================
- // cline -h (short help flag)
- // ===========================================================================
- test.describe("cline -h", () => {
- test.use({
- program: { file: CLINE_BIN, args: ["-h"] },
- env: testEnv("claude-sonnet-4.6"),
- ...HELP_TERMINAL,
- })
- test("shows Usage line with short flag", async ({ terminal }) => {
- await expectVisible(terminal, "Usage:")
- })
- })
- // ===========================================================================
- // cline task --help
- // ===========================================================================
- test.describe("cline task --help", () => {
- test.use({
- program: { file: CLINE_BIN, args: ["task", "--help"] },
- env: testEnv("claude-sonnet-4.6"),
- ...HELP_TERMINAL,
- })
- test("shows task usage, prompt argument, and all flags", async ({ terminal }) => {
- await expectVisible(terminal, [
- "Usage:",
- "prompt",
- "--act",
- "--plan",
- "--yolo",
- "--timeout",
- "--model",
- "--verbose",
- "--cwd",
- "--config",
- "--thinking",
- "--reasoning-effort",
- "--max-consecutive-mistakes",
- "--json",
- "--double-check-completion",
- "--taskId",
- ])
- })
- })
- // ===========================================================================
- // cline t --help (task alias)
- // ===========================================================================
- test.describe("cline t --help (task alias)", () => {
- test.use({
- program: { file: CLINE_BIN, args: ["t", "--help"] },
- env: testEnv("claude-sonnet-4.6"),
- ...HELP_TERMINAL,
- })
- test("shows task usage and flags via alias", async ({ terminal }) => {
- await expectVisible(terminal, ["Usage:", "--yolo"])
- })
- })
- // ===========================================================================
- // cline history --help
- // ===========================================================================
- test.describe("cline history --help", () => {
- test.use({
- program: { file: CLINE_BIN, args: ["history", "--help"] },
- env: testEnv("claude-sonnet-4.6"),
- ...HELP_TERMINAL,
- })
- test("shows history usage and all flags", async ({ terminal }) => {
- await expectVisible(terminal, ["Usage:", "--limit", "--page", "--config"])
- })
- })
- // ===========================================================================
- // cline h --help (history alias)
- // ===========================================================================
- test.describe("cline h --help (history alias)", () => {
- test.use({
- program: { file: CLINE_BIN, args: ["h", "--help"] },
- env: testEnv("claude-sonnet-4.6"),
- ...HELP_TERMINAL,
- })
- test("shows history usage and flags via alias", async ({ terminal }) => {
- await expectVisible(terminal, ["Usage:", "--limit"])
- })
- })
- // ===========================================================================
- // cline config --help
- // ===========================================================================
- test.describe("cline config --help", () => {
- test.use({
- program: { file: CLINE_BIN, args: ["config", "--help"] },
- env: testEnv("claude-sonnet-4.6"),
- ...HELP_TERMINAL,
- })
- test("shows config usage and --config flag", async ({ terminal }) => {
- await expectVisible(terminal, ["Usage:", "--config"])
- })
- })
- // ===========================================================================
- // cline auth --help
- // ===========================================================================
- test.describe("cline auth --help", () => {
- test.use({
- program: { file: CLINE_BIN, args: ["auth", "--help"] },
- env: testEnv("claude-sonnet-4.6"),
- ...HELP_TERMINAL,
- })
- test("shows auth usage and all flags", async ({ terminal }) => {
- await expectVisible(terminal, [
- "Usage:",
- "--provider",
- "--apikey",
- "--modelid",
- "--baseurl",
- "--verbose",
- "--cwd",
- "--config",
- ])
- })
- })
- // ===========================================================================
- // cline version --help
- // ===========================================================================
- test.describe("cline version --help", () => {
- test.use({
- program: { file: CLINE_BIN, args: ["version", "--help"] },
- env: testEnv("claude-sonnet-4.6"),
- ...HELP_TERMINAL,
- })
- test("shows version command usage", async ({ terminal }) => {
- await expectVisible(terminal, "Usage:")
- })
- })
- // ===========================================================================
- // cline update --help
- // ===========================================================================
- test.describe("cline update --help", () => {
- test.use({
- program: { file: CLINE_BIN, args: ["update", "--help"] },
- env: testEnv("claude-sonnet-4.6"),
- ...HELP_TERMINAL,
- })
- test("shows update usage and --verbose flag", async ({ terminal }) => {
- await expectVisible(terminal, ["Usage:", "--verbose"])
- })
- })
- // ===========================================================================
- // cline dev --help
- // ===========================================================================
- test.describe("cline dev --help", () => {
- test.use({
- program: { file: CLINE_BIN, args: ["dev", "--help"] },
- env: testEnv("claude-sonnet-4.6"),
- ...HELP_TERMINAL,
- })
- test("shows dev usage and lists log subcommand", async ({ terminal }) => {
- await expectVisible(terminal, ["Usage:", "log"])
- })
- })
|