@h-rig/cli 0.0.6-alpha.27 → 0.0.6-alpha.28
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/bin/rig.js +1038 -620
- package/dist/src/commands/_cli-format.js +211 -6
- package/dist/src/commands/_connection-state.js +1 -1
- package/dist/src/commands/_doctor-checks.js +3 -3
- package/dist/src/commands/_help-catalog.js +225 -64
- package/dist/src/commands/_operator-view.js +1 -1
- package/dist/src/commands/_pi-frontend.js +1 -1
- package/dist/src/commands/_pi-worker-bridge-extension.js +1 -1
- package/dist/src/commands/_preflight.js +2 -2
- package/dist/src/commands/_server-client.js +1 -1
- package/dist/src/commands/_snapshot-upload.js +1 -1
- package/dist/src/commands/agent.js +7 -7
- package/dist/src/commands/browser.js +4 -4
- package/dist/src/commands/connect.js +5 -4
- package/dist/src/commands/dist.js +4 -4
- package/dist/src/commands/doctor.js +3 -3
- package/dist/src/commands/github.js +1 -1
- package/dist/src/commands/inbox.js +351 -29
- package/dist/src/commands/init.js +3 -3
- package/dist/src/commands/inspect.js +10 -10
- package/dist/src/commands/inspector.js +2 -2
- package/dist/src/commands/plugin.js +3 -3
- package/dist/src/commands/profile-and-review.js +8 -8
- package/dist/src/commands/queue.js +1 -1
- package/dist/src/commands/remote.js +18 -18
- package/dist/src/commands/repo-git-harness.js +4 -4
- package/dist/src/commands/run.js +157 -37
- package/dist/src/commands/server.js +6 -5
- package/dist/src/commands/setup.js +8 -8
- package/dist/src/commands/task-report-bug.js +5 -5
- package/dist/src/commands/task-run-driver.js +1 -1
- package/dist/src/commands/task.js +451 -45
- package/dist/src/commands/test.js +3 -3
- package/dist/src/commands/workspace.js +4 -4
- package/dist/src/commands.js +1038 -620
- package/dist/src/index.js +1038 -620
- package/dist/src/report-bug.js +3 -3
- package/package.json +6 -6
|
@@ -182,7 +182,7 @@ function resolveSelectedConnection(projectRoot, options = {}) {
|
|
|
182
182
|
const global = readGlobalConnections(options);
|
|
183
183
|
const connection = global.connections[repo.selected];
|
|
184
184
|
if (!connection) {
|
|
185
|
-
throw new CliError2(`Selected Rig
|
|
185
|
+
throw new CliError2(`Selected Rig server "${repo.selected}" was not found. Run \`rig server list\` or \`rig server use local\`.`, 1);
|
|
186
186
|
}
|
|
187
187
|
return { alias: repo.selected, connection };
|
|
188
188
|
}
|
|
@@ -562,7 +562,7 @@ async function runFastTaskRunPreflight(context, options = {}) {
|
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
564
|
const repo = readRepoConnection(context.projectRoot);
|
|
565
|
-
checks.push(repo ? preflightCheck("project-link", "project linked to Rig
|
|
565
|
+
checks.push(repo ? preflightCheck("project-link", "project linked to Rig server", repo.project ? "pass" : "warn", `${repo.selected}${repo.project ? ` -> ${repo.project}` : ""}`, "Run `rig init --yes --repo owner/repo` to record the GitHub repo slug.") : preflightCheck("project-link", "project linked to Rig server", legacyServerCompatibility ? "warn" : "fail", "missing .rig/state/connection.json", "Run `rig init` or `rig server use <alias|local>`."));
|
|
566
566
|
try {
|
|
567
567
|
const auth = await request("/api/github/auth/status");
|
|
568
568
|
checks.push(isAuthenticated(auth) ? preflightCheck("github-auth", "GitHub auth valid", "pass") : preflightCheck("github-auth", "GitHub auth valid", legacyServerCompatibility ? "warn" : "fail", "not authenticated", "Run `rig github auth import-gh` or `rig github auth token --token <token>`."));
|
|
@@ -1622,11 +1622,16 @@ async function attachRunOperatorView(context, input) {
|
|
|
1622
1622
|
}
|
|
1623
1623
|
|
|
1624
1624
|
// packages/cli/src/commands/_cli-format.ts
|
|
1625
|
+
import { log, note } from "@clack/prompts";
|
|
1625
1626
|
import pc from "picocolors";
|
|
1626
1627
|
function stringField(record, key, fallback = "") {
|
|
1627
1628
|
const value = record[key];
|
|
1628
1629
|
return typeof value === "string" && value.trim() ? value.trim() : fallback;
|
|
1629
1630
|
}
|
|
1631
|
+
function numberField(record, key) {
|
|
1632
|
+
const value = record[key];
|
|
1633
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
1634
|
+
}
|
|
1630
1635
|
function arrayField(record, key) {
|
|
1631
1636
|
const value = record[key];
|
|
1632
1637
|
return Array.isArray(value) ? value.flatMap((entry) => typeof entry === "string" && entry.trim() ? [entry.trim()] : []) : [];
|
|
@@ -1647,16 +1652,40 @@ function pad(value, width) {
|
|
|
1647
1652
|
}
|
|
1648
1653
|
function statusColor(status) {
|
|
1649
1654
|
const normalized = status.toLowerCase();
|
|
1650
|
-
if (["completed", "merged", "closed", "done", "accepted", "pass", "selected"].includes(normalized))
|
|
1655
|
+
if (["completed", "merged", "closed", "done", "accepted", "pass", "selected", "approved"].includes(normalized))
|
|
1651
1656
|
return pc.green;
|
|
1652
|
-
if (["failed", "needs_attention", "needs-attention", "blocked", "error"].includes(normalized))
|
|
1657
|
+
if (["failed", "needs_attention", "needs-attention", "blocked", "error", "rejected"].includes(normalized))
|
|
1653
1658
|
return pc.red;
|
|
1654
1659
|
if (["running", "reviewing", "validating", "in_progress", "in-progress", "remote"].includes(normalized))
|
|
1655
1660
|
return pc.cyan;
|
|
1656
|
-
if (["ready", "open", "queued", "created", "preparing", "local"].includes(normalized))
|
|
1661
|
+
if (["ready", "open", "queued", "created", "preparing", "local", "pending"].includes(normalized))
|
|
1657
1662
|
return pc.yellow;
|
|
1658
1663
|
return pc.dim;
|
|
1659
1664
|
}
|
|
1665
|
+
function compactValue(value) {
|
|
1666
|
+
if (value === null || value === undefined)
|
|
1667
|
+
return "";
|
|
1668
|
+
if (typeof value === "string")
|
|
1669
|
+
return value;
|
|
1670
|
+
if (typeof value === "number" || typeof value === "boolean")
|
|
1671
|
+
return String(value);
|
|
1672
|
+
if (Array.isArray(value))
|
|
1673
|
+
return value.map(compactValue).filter(Boolean).join(", ");
|
|
1674
|
+
return JSON.stringify(value);
|
|
1675
|
+
}
|
|
1676
|
+
function shouldUseClackOutput() {
|
|
1677
|
+
return Boolean(process.stdout.isTTY) && process.env.RIG_CLI_PLAIN_HELP !== "1";
|
|
1678
|
+
}
|
|
1679
|
+
function printFormattedOutput(message2, options = {}) {
|
|
1680
|
+
if (!shouldUseClackOutput()) {
|
|
1681
|
+
console.log(message2);
|
|
1682
|
+
return;
|
|
1683
|
+
}
|
|
1684
|
+
if (options.title)
|
|
1685
|
+
note(message2, options.title);
|
|
1686
|
+
else
|
|
1687
|
+
log.message(message2);
|
|
1688
|
+
}
|
|
1660
1689
|
function formatStatusPill(status) {
|
|
1661
1690
|
const label = status || "unknown";
|
|
1662
1691
|
return statusColor(label)(`\u25CF ${label}`);
|
|
@@ -1665,7 +1694,7 @@ function formatSection(title, subtitle) {
|
|
|
1665
1694
|
return `${pc.bold(pc.cyan("\u25C6"))} ${pc.bold(title)}${subtitle ? pc.dim(` \u2014 ${subtitle}`) : ""}`;
|
|
1666
1695
|
}
|
|
1667
1696
|
function formatSuccessCard(title, rows = []) {
|
|
1668
|
-
const body = rows.filter(([, value]) => value !== undefined && value !== null && String(value).length > 0).map(([key, value]) => `${pc.dim("\u2502")} ${pc.dim(key.padEnd(
|
|
1697
|
+
const body = rows.filter(([, value]) => value !== undefined && value !== null && String(value).length > 0).map(([key, value]) => `${pc.dim("\u2502")} ${pc.dim(key.padEnd(12))} ${value}`);
|
|
1669
1698
|
return [formatSection(title), ...body].join(`
|
|
1670
1699
|
`);
|
|
1671
1700
|
}
|
|
@@ -1705,6 +1734,40 @@ function formatTaskList(tasks, options = {}) {
|
|
|
1705
1734
|
return [formatSection("Tasks", `${rows.length} shown`), header, ...body, "", ...formatNextSteps(["Run one: `rig task run <id>` or `rig task run --next`", "Attach later: `rig run attach <run-id> --follow`"])].join(`
|
|
1706
1735
|
`);
|
|
1707
1736
|
}
|
|
1737
|
+
function formatTaskCard(task, options = {}) {
|
|
1738
|
+
const raw = rawObject(task);
|
|
1739
|
+
const id = stringField(task, "id", stringField(raw, "id", "<unknown>"));
|
|
1740
|
+
const status = stringField(task, "status", stringField(raw, "status", "unknown"));
|
|
1741
|
+
const title = stringField(task, "title", stringField(raw, "title", "Untitled task"));
|
|
1742
|
+
const source = stringField(task, "source", stringField(raw, "source", ""));
|
|
1743
|
+
const url = stringField(task, "url", stringField(raw, "url", ""));
|
|
1744
|
+
const number = numberField(task, "number") ?? numberField(raw, "number");
|
|
1745
|
+
const labels = arrayField(task, "labels").length > 0 ? arrayField(task, "labels") : arrayField(raw, "labels");
|
|
1746
|
+
const assignees = arrayField(task, "assignees").length > 0 ? arrayField(task, "assignees") : arrayField(raw, "assignees");
|
|
1747
|
+
const readiness = compactValue(task.readiness ?? raw.readiness);
|
|
1748
|
+
const validators = compactValue(task.validators ?? raw.validators ?? task.validation ?? raw.validation);
|
|
1749
|
+
const rows = [
|
|
1750
|
+
["task", pc.bold(id)],
|
|
1751
|
+
["status", formatStatusPill(status)],
|
|
1752
|
+
["title", title],
|
|
1753
|
+
["source", source],
|
|
1754
|
+
["number", number],
|
|
1755
|
+
["labels", labels.length ? labels.map((label) => `#${label}`).join(" ") : ""],
|
|
1756
|
+
["assignees", assignees.join(", ")],
|
|
1757
|
+
["readiness", readiness],
|
|
1758
|
+
["validators", validators],
|
|
1759
|
+
["url", url]
|
|
1760
|
+
];
|
|
1761
|
+
return [
|
|
1762
|
+
formatSuccessCard(options.title ?? (options.selected ? "Selected task" : "Task"), rows),
|
|
1763
|
+
"",
|
|
1764
|
+
...formatNextSteps([`Start: \`rig task run ${id}\``, `Details: \`rig task show ${id} --raw\``])
|
|
1765
|
+
].join(`
|
|
1766
|
+
`);
|
|
1767
|
+
}
|
|
1768
|
+
function formatTaskDetails(task) {
|
|
1769
|
+
return formatTaskCard(task, { title: "Task details" });
|
|
1770
|
+
}
|
|
1708
1771
|
function formatSubmittedRun(input) {
|
|
1709
1772
|
const rows = [["run", pc.bold(input.runId)]];
|
|
1710
1773
|
if (input.task) {
|
|
@@ -1713,14 +1776,336 @@ function formatSubmittedRun(input) {
|
|
|
1713
1776
|
const title = stringField(input.task, "title", "Untitled task");
|
|
1714
1777
|
rows.push(["task", `${pc.bold(id)} ${formatStatusPill(status)} ${title}`]);
|
|
1715
1778
|
}
|
|
1779
|
+
const runtime = [input.runtimeAdapter || "pi", input.runtimeMode || "full-access", input.interactionMode || "default"].filter(Boolean).join(" \xB7 ");
|
|
1780
|
+
rows.push(["runtime", runtime]);
|
|
1716
1781
|
return [
|
|
1717
1782
|
formatSuccessCard("Run submitted", rows),
|
|
1718
1783
|
"",
|
|
1719
|
-
...formatNextSteps([
|
|
1784
|
+
...formatNextSteps([
|
|
1785
|
+
`Attach: \`rig run attach ${input.runId} --follow\``,
|
|
1786
|
+
`Inspect: \`rig run show ${input.runId}\``,
|
|
1787
|
+
input.detached ? "Submitted detached; attach when you are ready." : "Interactive mode opens the native bundled Pi frontend."
|
|
1788
|
+
])
|
|
1720
1789
|
].join(`
|
|
1721
1790
|
`);
|
|
1722
1791
|
}
|
|
1723
1792
|
|
|
1793
|
+
// packages/cli/src/commands/_help-catalog.ts
|
|
1794
|
+
import { intro, log as log2, note as note2, outro } from "@clack/prompts";
|
|
1795
|
+
import pc2 from "picocolors";
|
|
1796
|
+
var TOP_LEVEL_SECTIONS = [
|
|
1797
|
+
{
|
|
1798
|
+
title: "Server",
|
|
1799
|
+
subtitle: "choose the local or remote Rig server that owns this repo",
|
|
1800
|
+
commands: [
|
|
1801
|
+
{ command: "rig server status", description: "Show the selected local/remote server for this repo." },
|
|
1802
|
+
{ command: "rig server use local", description: "Switch this repo back to the local Rig server." },
|
|
1803
|
+
{ command: "rig server add <alias> <url>", description: "Save a remote Rig server alias." },
|
|
1804
|
+
{ command: "rig server use <alias>", description: "Switch this repo to a saved remote server." },
|
|
1805
|
+
{ command: "rig server list", description: "Show saved server aliases, including local." }
|
|
1806
|
+
]
|
|
1807
|
+
},
|
|
1808
|
+
{
|
|
1809
|
+
title: "Tasks",
|
|
1810
|
+
subtitle: "find work, inspect it, and submit Pi-backed workers",
|
|
1811
|
+
commands: [
|
|
1812
|
+
{ command: "rig task list", description: "List tasks from the selected task source/server." },
|
|
1813
|
+
{ command: "rig task next", description: "Show the next matching task as a selected-task card." },
|
|
1814
|
+
{ command: "rig task show <id>", description: "Show a human task summary; add --raw or --json for the full payload." },
|
|
1815
|
+
{ command: "rig task run <id|--next> [--detach]", description: "Submit a task run; interactive mode follows with bundled Pi." }
|
|
1816
|
+
]
|
|
1817
|
+
},
|
|
1818
|
+
{
|
|
1819
|
+
title: "Runs",
|
|
1820
|
+
subtitle: "observe, attach to, and stop live or recent runs",
|
|
1821
|
+
commands: [
|
|
1822
|
+
{ command: "rig run list", description: "List recent runs from the selected server or local state." },
|
|
1823
|
+
{ command: "rig run show <id>", description: "Show a human run summary; add --raw or --json for the full payload." },
|
|
1824
|
+
{ command: "rig run attach <id> --follow", description: "Open the native bundled Pi live view for a worker run." },
|
|
1825
|
+
{ command: "rig run stop <id>", description: "Request cancellation for a running worker." }
|
|
1826
|
+
]
|
|
1827
|
+
},
|
|
1828
|
+
{
|
|
1829
|
+
title: "Review / inbox",
|
|
1830
|
+
subtitle: "clear blocked runs and configure completion review",
|
|
1831
|
+
commands: [
|
|
1832
|
+
{ command: "rig inbox approvals", description: "List pending approval requests from local/server run state." },
|
|
1833
|
+
{ command: "rig inbox inputs", description: "List pending user-input requests from local/server run state." },
|
|
1834
|
+
{ command: "rig review show|set", description: "Inspect or change the review gate policy." }
|
|
1835
|
+
]
|
|
1836
|
+
},
|
|
1837
|
+
{
|
|
1838
|
+
title: "Health / setup",
|
|
1839
|
+
subtitle: "bootstrap and diagnose the repo/server/GitHub/Pi path",
|
|
1840
|
+
commands: [
|
|
1841
|
+
{ command: "rig init", description: "Interactive setup: config, GitHub auth, task source, server, checkout, Pi." },
|
|
1842
|
+
{ command: "rig doctor", description: "Diagnose project/server/GitHub/task/Pi wiring." },
|
|
1843
|
+
{ command: "rig github auth status", description: "Show GitHub auth state on the selected Rig server." }
|
|
1844
|
+
]
|
|
1845
|
+
}
|
|
1846
|
+
];
|
|
1847
|
+
var PRIMARY_GROUPS = [
|
|
1848
|
+
{
|
|
1849
|
+
name: "server",
|
|
1850
|
+
summary: "Choose, inspect, and start the Rig server that owns tasks and runs.",
|
|
1851
|
+
usage: ["rig server <status|list|add|use|start> [options]"],
|
|
1852
|
+
commands: [
|
|
1853
|
+
{ command: "status", description: "Show the selected server for this repo.", primary: true },
|
|
1854
|
+
{ command: "use local", description: "Switch this repo to the local Rig server.", primary: true },
|
|
1855
|
+
{ command: "add <alias> <url>", description: "Save a remote Rig server URL.", primary: true },
|
|
1856
|
+
{ command: "use <alias>", description: "Select a saved remote server alias.", primary: true },
|
|
1857
|
+
{ command: "list", description: "List saved local/remote server aliases.", primary: true },
|
|
1858
|
+
{ command: "start [--host <host>] [--port <n>]", description: "Start a local rig-server process." }
|
|
1859
|
+
],
|
|
1860
|
+
examples: [
|
|
1861
|
+
"rig server status",
|
|
1862
|
+
"rig server add prod https://where.rig-does.work",
|
|
1863
|
+
"rig server use prod",
|
|
1864
|
+
"rig server use local",
|
|
1865
|
+
"rig server start --port 3773"
|
|
1866
|
+
],
|
|
1867
|
+
next: ["Use `rig task list` to see server-owned work.", "Use `rig run list` or `rig run attach <id> --follow` to monitor runs."],
|
|
1868
|
+
advanced: ["Compatibility alias: `rig connect ...` remains callable."]
|
|
1869
|
+
},
|
|
1870
|
+
{
|
|
1871
|
+
name: "task",
|
|
1872
|
+
summary: "Find work, start Pi-backed runs, and validate task results.",
|
|
1873
|
+
usage: ["rig task <list|next|show|run> [options]"],
|
|
1874
|
+
commands: [
|
|
1875
|
+
{ command: "list [--assignee <login|@me>] [--state open|closed]", description: "List tasks from the selected server/source.", primary: true },
|
|
1876
|
+
{ command: "next [filters]", description: "Render the next matching task as a selected-task card.", primary: true },
|
|
1877
|
+
{ command: "show <id>|--task <id> [--raw]", description: "Show a human task summary; --raw prints the full payload.", primary: true },
|
|
1878
|
+
{ command: "run [#<issue>|<task-id>|--next|--task <id>]", description: "Submit a task run; interactive follows with bundled Pi.", primary: true },
|
|
1879
|
+
{ command: "validate|verify [--task <id>]", description: "Run configured task checks/review gates." },
|
|
1880
|
+
{ command: "artifacts|artifact-dir|artifact-write", description: "Inspect or write task artifacts." },
|
|
1881
|
+
{ command: "report-bug", description: "Create a structured bug report/task." }
|
|
1882
|
+
],
|
|
1883
|
+
examples: [
|
|
1884
|
+
"rig task list --assignee @me --limit 20",
|
|
1885
|
+
"rig task next",
|
|
1886
|
+
"rig task show 123 --raw",
|
|
1887
|
+
"rig task run --next",
|
|
1888
|
+
"rig task run #123 --runtime-adapter pi",
|
|
1889
|
+
"rig task run --title 'Investigate deploy drift' --initial-prompt 'Check server health'"
|
|
1890
|
+
],
|
|
1891
|
+
next: ["Use `--detach` to submit without attaching.", "Use `rig run attach <run-id> --follow` to rejoin a live run."]
|
|
1892
|
+
},
|
|
1893
|
+
{
|
|
1894
|
+
name: "run",
|
|
1895
|
+
summary: "Observe, attach to, and control Rig runs.",
|
|
1896
|
+
usage: ["rig run <list|status|show|attach|stop> [options]"],
|
|
1897
|
+
commands: [
|
|
1898
|
+
{ command: "list", description: "List recent runs from the selected server or local state.", primary: true },
|
|
1899
|
+
{ command: "status", description: "Render active and recent run groups.", primary: true },
|
|
1900
|
+
{ command: "show <id>|--run <id> [--raw]", description: "Show a human run summary; --raw prints the full payload.", primary: true },
|
|
1901
|
+
{ command: "attach <run-id>|--run <id> [--follow]", description: "Attach to the run; --follow launches native bundled Pi for live Pi runs.", primary: true },
|
|
1902
|
+
{ command: "stop [<run-id>|--run <id>]", description: "Request stop for one run or local active runs.", primary: true },
|
|
1903
|
+
{ command: "timeline --run <id> [--follow]", description: "Stream raw run timeline events." },
|
|
1904
|
+
{ command: "delete|cleanup", description: "Remove completed run records/artifacts." }
|
|
1905
|
+
],
|
|
1906
|
+
examples: [
|
|
1907
|
+
"rig run list",
|
|
1908
|
+
"rig run status",
|
|
1909
|
+
"rig run show <run-id>",
|
|
1910
|
+
"rig run attach <run-id> --follow",
|
|
1911
|
+
"rig run stop <run-id>"
|
|
1912
|
+
],
|
|
1913
|
+
next: ["Use `rig task run --next` to create a new run.", "Use `--json` when scripts need the full structured record."]
|
|
1914
|
+
},
|
|
1915
|
+
{
|
|
1916
|
+
name: "inbox",
|
|
1917
|
+
summary: "Review approval and user-input requests that block worker runs.",
|
|
1918
|
+
usage: ["rig inbox <approvals|approve|inputs|respond> [options]"],
|
|
1919
|
+
commands: [
|
|
1920
|
+
{ command: "approvals [--run <id>] [--task <id>]", description: "List pending approvals.", primary: true },
|
|
1921
|
+
{ command: "inputs [--run <id>] [--task <id>]", description: "List pending user-input requests.", primary: true },
|
|
1922
|
+
{ command: "approve --run <id> --request <id> --decision approve|reject", description: "Resolve an approval request." },
|
|
1923
|
+
{ command: "respond --run <id> --request <id> --answer key=value", description: "Answer a user-input request." }
|
|
1924
|
+
],
|
|
1925
|
+
examples: [
|
|
1926
|
+
"rig inbox approvals",
|
|
1927
|
+
"rig inbox inputs --run <run-id>",
|
|
1928
|
+
"rig inbox approve --run <run-id> --request <request-id> --decision approve"
|
|
1929
|
+
],
|
|
1930
|
+
next: ["Rejoin the run after resolving a block: `rig run attach <run-id> --follow`."]
|
|
1931
|
+
},
|
|
1932
|
+
{
|
|
1933
|
+
name: "review",
|
|
1934
|
+
summary: "Inspect or change completion review gate policy.",
|
|
1935
|
+
usage: ["rig review <show|set>"],
|
|
1936
|
+
commands: [
|
|
1937
|
+
{ command: "show", description: "Show current review gate settings.", primary: true },
|
|
1938
|
+
{ command: "set <off|advisory|required> [--provider greptile]", description: "Change review strictness/provider.", primary: true }
|
|
1939
|
+
],
|
|
1940
|
+
examples: ["rig review show", "rig review set required --provider greptile"],
|
|
1941
|
+
next: ["Use `rig inbox approvals` for blocked run handoffs."]
|
|
1942
|
+
},
|
|
1943
|
+
{
|
|
1944
|
+
name: "init",
|
|
1945
|
+
summary: "Set up Rig for this repo: server, GitHub auth, checkout strategy, task source, and Pi wiring.",
|
|
1946
|
+
usage: ["rig init [--yes] [--server local|remote] [--repo owner/repo] [--remote-url <url>]"],
|
|
1947
|
+
commands: [
|
|
1948
|
+
{ command: "init", description: "Interactive setup wizard for a new or existing Rig repo.", primary: true },
|
|
1949
|
+
{ command: "init --yes", description: "Non-interactive setup using detected/default settings.", primary: true },
|
|
1950
|
+
{ command: "init --server remote --remote-url <url>", description: "Link this repo to a remote Rig server.", primary: true },
|
|
1951
|
+
{ command: "init --repair", description: "Repair missing private state without replacing project config." }
|
|
1952
|
+
],
|
|
1953
|
+
examples: [
|
|
1954
|
+
"rig init",
|
|
1955
|
+
"rig init --yes --repo humanity-org/humanwork",
|
|
1956
|
+
"rig init --server remote --remote-url https://where.rig-does.work --repo owner/repo"
|
|
1957
|
+
],
|
|
1958
|
+
next: ["After init, run `rig server status`.", "Then use `rig task list` and `rig task run --next` for day-to-day work."]
|
|
1959
|
+
},
|
|
1960
|
+
{
|
|
1961
|
+
name: "doctor",
|
|
1962
|
+
summary: "Diagnostics for project/server/GitHub/Pi state.",
|
|
1963
|
+
usage: ["rig doctor"],
|
|
1964
|
+
commands: [
|
|
1965
|
+
{ command: "doctor", description: "Run setup and runtime diagnostics.", primary: true },
|
|
1966
|
+
{ command: "check", description: "Compatibility spelling for diagnostics." }
|
|
1967
|
+
],
|
|
1968
|
+
examples: ["rig doctor", "rig doctor --json"],
|
|
1969
|
+
next: ["Use `rig server status` and `rig github auth status` to inspect common failure points."]
|
|
1970
|
+
},
|
|
1971
|
+
{
|
|
1972
|
+
name: "github",
|
|
1973
|
+
summary: "GitHub auth helpers for the selected Rig server.",
|
|
1974
|
+
usage: ["rig github auth <status|import-gh|token>"],
|
|
1975
|
+
commands: [
|
|
1976
|
+
{ command: "auth status", description: "Show GitHub auth state.", primary: true },
|
|
1977
|
+
{ command: "auth import-gh", description: "Import the current `gh` token into the selected server." },
|
|
1978
|
+
{ command: "auth token --token <token>", description: "Store a token on the selected server." }
|
|
1979
|
+
],
|
|
1980
|
+
examples: ["rig github auth status", "rig github auth import-gh"],
|
|
1981
|
+
next: ["After auth is valid, use `rig task run --next`."]
|
|
1982
|
+
}
|
|
1983
|
+
];
|
|
1984
|
+
var ADVANCED_GROUPS = [
|
|
1985
|
+
{ name: "connect", summary: "Compatibility alias for `rig server` selection commands.", usage: ["rig connect <status|list|add|use>"], commands: [{ command: "status|list|add|use", description: "Use `rig server ...` for the primary UX." }] },
|
|
1986
|
+
{ name: "setup", summary: "Bootstrap/check local setup.", usage: ["rig setup <bootstrap|check|preflight>"], commands: [{ command: "bootstrap|check|preflight", description: "Setup helpers." }] },
|
|
1987
|
+
{ name: "inspect", summary: "Inspect logs, artifacts, graphs, failures.", usage: ["rig inspect <logs|artifacts|failures|graph|audit|diff>"], commands: [{ command: "logs --task <id>", description: "Inspect task logs." }] },
|
|
1988
|
+
{ name: "repo", summary: "Repository sync/baseline helpers.", usage: ["rig repo <sync|reset-baseline>"], commands: [{ command: "sync", description: "Sync project repository state." }] },
|
|
1989
|
+
{ name: "profile", summary: "Runtime profile/model defaults.", usage: ["rig profile <show|set>"], commands: [{ command: "show", description: "Show active profile." }] },
|
|
1990
|
+
{ name: "browser", summary: "Browser/app diagnostics.", usage: ["rig browser <help|explain|demo|app>"], commands: [{ command: "help", description: "Browser command help." }] },
|
|
1991
|
+
{ name: "plugin", summary: "Plugin validation/listing.", usage: ["rig plugin <list|validate>"], commands: [{ command: "list", description: "List plugins." }] },
|
|
1992
|
+
{ name: "queue", summary: "Run task queues locally.", usage: ["rig queue run [options]"], commands: [{ command: "run", description: "Process queue work." }] },
|
|
1993
|
+
{ name: "agent", summary: "Runtime agent workspace helpers.", usage: ["rig agent <list|prepare|run|cleanup>"], commands: [{ command: "list", description: "List prepared agents." }] },
|
|
1994
|
+
{ name: "inspector", summary: "Event stream and drift scanners.", usage: ["rig inspector <stream|scan-upstream-drift>"], commands: [{ command: "stream", description: "Stream events." }] },
|
|
1995
|
+
{ name: "dist", summary: "Build/install packaged Rig CLI.", usage: ["rig dist <build|install|doctor>"], commands: [{ command: "build", description: "Build distribution." }] },
|
|
1996
|
+
{ name: "workspace", summary: "Workspace topology/service helpers.", usage: ["rig workspace <summary|topology|remote-hosts>"], commands: [{ command: "summary", description: "Show workspace summary." }] },
|
|
1997
|
+
{ name: "remote", summary: "Compatibility remote orchestration controls.", usage: ["rig remote <status|watch|pause|resume|...>"], commands: [{ command: "status", description: "Show remote state." }] },
|
|
1998
|
+
{ name: "git", summary: "Pass through to Rig git-flow helper.", usage: ["rig git <args...>"], commands: [{ command: "<args...>", description: "Advanced git flow operations." }] },
|
|
1999
|
+
{ name: "harness", summary: "Pass through to runtime harness CLI.", usage: ["rig harness <args...>"], commands: [{ command: "<args...>", description: "Advanced harness operations." }] },
|
|
2000
|
+
{ name: "test", summary: "Project test wrappers.", usage: ["rig test <unit|e2e|all>"], commands: [{ command: "all", description: "Run configured project tests." }] }
|
|
2001
|
+
];
|
|
2002
|
+
var ALL_GROUPS = [...PRIMARY_GROUPS, ...ADVANCED_GROUPS];
|
|
2003
|
+
function heading(title) {
|
|
2004
|
+
return pc2.bold(pc2.cyan(title));
|
|
2005
|
+
}
|
|
2006
|
+
function commandLine(command, description) {
|
|
2007
|
+
const commandColumn = command.length >= 38 ? `${command} ` : command.padEnd(38);
|
|
2008
|
+
return `${pc2.dim("\u2502")} ${pc2.bold(commandColumn)} ${description}`;
|
|
2009
|
+
}
|
|
2010
|
+
function renderCommandBlock(commands) {
|
|
2011
|
+
return commands.map((entry) => commandLine(entry.command, entry.description)).join(`
|
|
2012
|
+
`);
|
|
2013
|
+
}
|
|
2014
|
+
function renderGroup(group) {
|
|
2015
|
+
const lines = [
|
|
2016
|
+
`${heading(`rig ${group.name}`)} \u2014 ${group.summary}`,
|
|
2017
|
+
"",
|
|
2018
|
+
pc2.bold("Usage"),
|
|
2019
|
+
...group.usage.map((line) => ` ${line}`),
|
|
2020
|
+
"",
|
|
2021
|
+
pc2.bold("Commands"),
|
|
2022
|
+
...group.commands.map((entry) => commandLine(entry.command, entry.description))
|
|
2023
|
+
];
|
|
2024
|
+
if (group.examples?.length) {
|
|
2025
|
+
lines.push("", pc2.bold("Examples"), ...group.examples.map((line) => ` ${pc2.dim("$")} ${line}`));
|
|
2026
|
+
}
|
|
2027
|
+
if (group.next?.length) {
|
|
2028
|
+
lines.push("", pc2.bold("Next steps"), ...group.next.map((line) => ` ${pc2.dim("\u203A")} ${line}`));
|
|
2029
|
+
}
|
|
2030
|
+
if (group.advanced?.length) {
|
|
2031
|
+
lines.push("", pc2.bold("Compatibility / advanced"), ...group.advanced.map((line) => ` ${pc2.dim("\u203A")} ${line}`));
|
|
2032
|
+
}
|
|
2033
|
+
return lines.join(`
|
|
2034
|
+
`);
|
|
2035
|
+
}
|
|
2036
|
+
function renderTopLevelHelp() {
|
|
2037
|
+
return [
|
|
2038
|
+
`${heading("rig")} ${pc2.dim("\u2014 server-owned task/run control plane for Pi-backed engineering work")}`,
|
|
2039
|
+
pc2.dim("Current path: select a server, choose a task, submit a run, attach with native Pi, clear inbox/review gates."),
|
|
2040
|
+
"",
|
|
2041
|
+
...TOP_LEVEL_SECTIONS.flatMap((section) => [
|
|
2042
|
+
`${pc2.bold(pc2.magenta(`\u25C7 ${section.title}`))} \u2014 ${pc2.dim(section.subtitle)}`,
|
|
2043
|
+
renderCommandBlock(section.commands),
|
|
2044
|
+
""
|
|
2045
|
+
]),
|
|
2046
|
+
pc2.dim("More: `rig help --advanced` for dev/compatibility commands; `rig <group> --help` for rich per-group help; `rig --version` for the installed version."),
|
|
2047
|
+
"",
|
|
2048
|
+
pc2.bold("Global options"),
|
|
2049
|
+
commandLine("--project <path>", "Use a project root instead of auto-discovery."),
|
|
2050
|
+
commandLine("--json", "Emit structured output for scripts/agents."),
|
|
2051
|
+
commandLine("--dry-run", "Print the command plan without mutating state.")
|
|
2052
|
+
].join(`
|
|
2053
|
+
`).trimEnd();
|
|
2054
|
+
}
|
|
2055
|
+
function renderGroupHelp(groupName) {
|
|
2056
|
+
const group = ALL_GROUPS.find((candidate) => candidate.name === groupName);
|
|
2057
|
+
return group ? renderGroup(group) : null;
|
|
2058
|
+
}
|
|
2059
|
+
function shouldUseClackOutput2() {
|
|
2060
|
+
return Boolean(process.stdout.isTTY) && process.env.RIG_CLI_PLAIN_HELP !== "1";
|
|
2061
|
+
}
|
|
2062
|
+
function printTopLevelHelp() {
|
|
2063
|
+
if (!shouldUseClackOutput2()) {
|
|
2064
|
+
console.log(renderTopLevelHelp());
|
|
2065
|
+
return;
|
|
2066
|
+
}
|
|
2067
|
+
intro("rig");
|
|
2068
|
+
for (const section of TOP_LEVEL_SECTIONS) {
|
|
2069
|
+
note2(renderCommandBlock(section.commands), `${section.title} \u2014 ${section.subtitle}`);
|
|
2070
|
+
}
|
|
2071
|
+
log2.info("More: rig help --advanced \xB7 rig <group> --help \xB7 rig --version");
|
|
2072
|
+
note2([
|
|
2073
|
+
commandLine("--project <path>", "Use a project root instead of auto-discovery."),
|
|
2074
|
+
commandLine("--json", "Emit structured output for scripts/agents."),
|
|
2075
|
+
commandLine("--dry-run", "Print the command plan without mutating state.")
|
|
2076
|
+
].join(`
|
|
2077
|
+
`), "Global options");
|
|
2078
|
+
outro("Server \u2192 task \u2192 run \u2192 inbox/review.");
|
|
2079
|
+
}
|
|
2080
|
+
function printGroupHelpDocument(groupName) {
|
|
2081
|
+
const rendered = renderGroupHelp(groupName) ?? renderTopLevelHelp();
|
|
2082
|
+
if (!shouldUseClackOutput2()) {
|
|
2083
|
+
console.log(rendered);
|
|
2084
|
+
return;
|
|
2085
|
+
}
|
|
2086
|
+
const group = ALL_GROUPS.find((candidate) => candidate.name === groupName);
|
|
2087
|
+
if (!group) {
|
|
2088
|
+
printTopLevelHelp();
|
|
2089
|
+
return;
|
|
2090
|
+
}
|
|
2091
|
+
intro(`rig ${group.name}`);
|
|
2092
|
+
note2(group.summary, "Purpose");
|
|
2093
|
+
note2(group.usage.join(`
|
|
2094
|
+
`), "Usage");
|
|
2095
|
+
note2(group.commands.map((entry) => commandLine(entry.command, entry.description)).join(`
|
|
2096
|
+
`), "Commands");
|
|
2097
|
+
if (group.examples?.length)
|
|
2098
|
+
note2(group.examples.map((line) => `$ ${line}`).join(`
|
|
2099
|
+
`), "Examples");
|
|
2100
|
+
if (group.next?.length)
|
|
2101
|
+
note2(group.next.map((line) => `\u203A ${line}`).join(`
|
|
2102
|
+
`), "Next steps");
|
|
2103
|
+
if (group.advanced?.length)
|
|
2104
|
+
log2.info(group.advanced.join(`
|
|
2105
|
+
`));
|
|
2106
|
+
outro("Run with --json when scripts need structured output.");
|
|
2107
|
+
}
|
|
2108
|
+
|
|
1724
2109
|
// packages/cli/src/commands/task.ts
|
|
1725
2110
|
import { buildPluginHostContext } from "@rig/runtime/control-plane/plugin-host-context";
|
|
1726
2111
|
import { loadConfig } from "@rig/core/load-config";
|
|
@@ -1872,27 +2257,30 @@ function summarizeTask(task, options = {}) {
|
|
|
1872
2257
|
...options.raw ? { raw: raw ?? task } : {}
|
|
1873
2258
|
};
|
|
1874
2259
|
}
|
|
1875
|
-
function printTaskSummary(task) {
|
|
1876
|
-
console.log(formatTaskList([task]));
|
|
1877
|
-
}
|
|
1878
2260
|
async function validatorRegistryForTaskCommands(projectRoot) {
|
|
1879
2261
|
return buildPluginHostContext(projectRoot).then((ctx) => ctx?.validatorRegistry ?? undefined).catch(() => {
|
|
1880
2262
|
return;
|
|
1881
2263
|
});
|
|
1882
2264
|
}
|
|
1883
2265
|
async function executeTask(context, args, options) {
|
|
1884
|
-
|
|
2266
|
+
if (args.length === 0) {
|
|
2267
|
+
if (context.outputMode === "text") {
|
|
2268
|
+
printGroupHelpDocument("task");
|
|
2269
|
+
}
|
|
2270
|
+
return { ok: true, group: "task", command: "help" };
|
|
2271
|
+
}
|
|
2272
|
+
const [command = "help", ...rest] = args;
|
|
1885
2273
|
switch (command) {
|
|
1886
2274
|
case "list": {
|
|
1887
2275
|
let pending = rest;
|
|
1888
2276
|
const rawResult = takeFlag(pending, "--raw");
|
|
1889
2277
|
pending = rawResult.rest;
|
|
1890
2278
|
const { filters, rest: remaining } = parseTaskFilters(pending);
|
|
1891
|
-
requireNoExtraArgs(remaining, "
|
|
2279
|
+
requireNoExtraArgs(remaining, "rig task list [--raw] [--assignee <login|@me>] [--assigned-to <login|me|@me>] [--state open|closed] [--status <status>] [--limit <n>]");
|
|
1892
2280
|
const tasks = await listWorkspaceTasksViaServer(context, filters);
|
|
1893
2281
|
if (context.outputMode === "text") {
|
|
1894
2282
|
const renderedTasks = rawResult.value ? tasks.map((task) => summarizeTask(task, { raw: true })) : tasks.map((task) => summarizeTask(task));
|
|
1895
|
-
|
|
2283
|
+
printFormattedOutput(formatTaskList(renderedTasks, { raw: rawResult.value }));
|
|
1896
2284
|
}
|
|
1897
2285
|
return {
|
|
1898
2286
|
ok: true,
|
|
@@ -1902,10 +2290,13 @@ async function executeTask(context, args, options) {
|
|
|
1902
2290
|
};
|
|
1903
2291
|
}
|
|
1904
2292
|
case "show": {
|
|
1905
|
-
|
|
2293
|
+
let pending = rest;
|
|
2294
|
+
const rawResult = takeFlag(pending, "--raw");
|
|
2295
|
+
pending = rawResult.rest;
|
|
2296
|
+
const taskOption = takeOption(pending, "--task");
|
|
1906
2297
|
const positional = taskOption.rest.length > 0 && taskOption.rest[0] && !taskOption.rest[0].startsWith("-") ? taskOption.rest[0] : undefined;
|
|
1907
2298
|
const remaining = positional ? taskOption.rest.slice(1) : taskOption.rest;
|
|
1908
|
-
requireNoExtraArgs(remaining, "
|
|
2299
|
+
requireNoExtraArgs(remaining, "rig task show <id>|--task <id> [--raw]");
|
|
1909
2300
|
const taskId3 = normalizeTaskRunTaskId(taskOption.value ?? positional);
|
|
1910
2301
|
if (!taskId3)
|
|
1911
2302
|
throw new CliError2("task show requires a task id.", 2);
|
|
@@ -1913,19 +2304,20 @@ async function executeTask(context, args, options) {
|
|
|
1913
2304
|
if (!task)
|
|
1914
2305
|
throw new CliError2(`Task not found: ${taskId3}`, 3);
|
|
1915
2306
|
const summary = summarizeTask(task, { raw: true });
|
|
1916
|
-
if (context.outputMode === "text")
|
|
1917
|
-
|
|
1918
|
-
|
|
2307
|
+
if (context.outputMode === "text") {
|
|
2308
|
+
printFormattedOutput(rawResult.value ? JSON.stringify(summary, null, 2) : formatTaskDetails(summary));
|
|
2309
|
+
}
|
|
2310
|
+
return { ok: true, group: "task", command, details: { task: summary, raw: rawResult.value } };
|
|
1919
2311
|
}
|
|
1920
2312
|
case "next": {
|
|
1921
2313
|
const { filters, rest: remaining } = parseTaskFilters(rest);
|
|
1922
|
-
requireNoExtraArgs(remaining, "
|
|
2314
|
+
requireNoExtraArgs(remaining, "rig task next [--assignee <login|@me>] [--assigned-to <login|me|@me>] [--state open|closed] [--status <status>] [--limit <n>]");
|
|
1923
2315
|
const selected = await selectNextWorkspaceTaskViaServer(context, filters);
|
|
1924
2316
|
if (context.outputMode === "text") {
|
|
1925
2317
|
if (selected.task) {
|
|
1926
|
-
|
|
2318
|
+
printFormattedOutput(formatTaskCard(summarizeTask(selected.task, { raw: true }), { title: "Selected task", selected: true }));
|
|
1927
2319
|
} else {
|
|
1928
|
-
|
|
2320
|
+
printFormattedOutput("No matching tasks.\n\nNext\n\u203A Try `rig task list` to inspect available work.\n\u203A Check server: `rig server status`");
|
|
1929
2321
|
}
|
|
1930
2322
|
}
|
|
1931
2323
|
return {
|
|
@@ -1941,31 +2333,31 @@ async function executeTask(context, args, options) {
|
|
|
1941
2333
|
}
|
|
1942
2334
|
case "info": {
|
|
1943
2335
|
const { value: task, rest: remaining } = takeOption(rest, "--task");
|
|
1944
|
-
requireNoExtraArgs(remaining, "
|
|
2336
|
+
requireNoExtraArgs(remaining, "rig task info [--task <task-id>]");
|
|
1945
2337
|
await withMutedConsole(context.outputMode === "json", () => taskInfo(context.projectRoot, task || undefined));
|
|
1946
2338
|
return { ok: true, group: "task", command, details: { task: task || null } };
|
|
1947
2339
|
}
|
|
1948
2340
|
case "scope": {
|
|
1949
2341
|
const filesFlag = takeFlag(rest, "--files");
|
|
1950
2342
|
const { value: task, rest: remaining } = takeOption(filesFlag.rest, "--task");
|
|
1951
|
-
requireNoExtraArgs(remaining, "
|
|
2343
|
+
requireNoExtraArgs(remaining, "rig task scope [--task <id>] [--files]");
|
|
1952
2344
|
await withMutedConsole(context.outputMode === "json", () => taskScope(context.projectRoot, filesFlag.value, task || undefined));
|
|
1953
2345
|
return { ok: true, group: "task", command, details: { files: filesFlag.value, task: task || null } };
|
|
1954
2346
|
}
|
|
1955
2347
|
case "deps":
|
|
1956
|
-
requireNoExtraArgs(rest, "
|
|
2348
|
+
requireNoExtraArgs(rest, "rig task deps");
|
|
1957
2349
|
await withMutedConsole(context.outputMode === "json", () => taskDeps(context.projectRoot));
|
|
1958
2350
|
return { ok: true, group: "task", command };
|
|
1959
2351
|
case "status":
|
|
1960
|
-
requireNoExtraArgs(rest, "
|
|
2352
|
+
requireNoExtraArgs(rest, "rig task status");
|
|
1961
2353
|
withMutedConsole(context.outputMode === "json", () => taskStatus2(context.projectRoot));
|
|
1962
2354
|
return { ok: true, group: "task", command };
|
|
1963
2355
|
case "artifacts":
|
|
1964
|
-
requireNoExtraArgs(rest, "
|
|
2356
|
+
requireNoExtraArgs(rest, "rig task artifacts");
|
|
1965
2357
|
withMutedConsole(context.outputMode === "json", () => taskArtifacts(context.projectRoot));
|
|
1966
2358
|
return { ok: true, group: "task", command };
|
|
1967
2359
|
case "artifact-dir": {
|
|
1968
|
-
requireNoExtraArgs(rest, "
|
|
2360
|
+
requireNoExtraArgs(rest, "rig task artifact-dir");
|
|
1969
2361
|
const path = taskArtifactDir(context.projectRoot);
|
|
1970
2362
|
if (context.outputMode === "text") {
|
|
1971
2363
|
console.log(path);
|
|
@@ -1974,7 +2366,7 @@ async function executeTask(context, args, options) {
|
|
|
1974
2366
|
}
|
|
1975
2367
|
case "artifact-write": {
|
|
1976
2368
|
if (rest.length < 1) {
|
|
1977
|
-
throw new CliError2(`Usage:
|
|
2369
|
+
throw new CliError2(`Usage: rig task artifact-write <filename> [--file <path>]
|
|
1978
2370
|
` + ` Reads content from stdin (or --file), writes to the active task artifact dir.
|
|
1979
2371
|
` + " Example: echo '...' | rig task artifact-write collection-audit.md");
|
|
1980
2372
|
}
|
|
@@ -1987,7 +2379,7 @@ async function executeTask(context, args, options) {
|
|
|
1987
2379
|
content = await readStdin();
|
|
1988
2380
|
}
|
|
1989
2381
|
if (!artifactFilename) {
|
|
1990
|
-
throw new CliError2("Usage:
|
|
2382
|
+
throw new CliError2("Usage: rig task artifact-write <filename> [--file path]");
|
|
1991
2383
|
}
|
|
1992
2384
|
withMutedConsole(context.outputMode === "json", () => taskArtifactWrite(context.projectRoot, artifactFilename, content));
|
|
1993
2385
|
return { ok: true, group: "task", command, details: { filename: artifactFilename } };
|
|
@@ -1996,11 +2388,11 @@ async function executeTask(context, args, options) {
|
|
|
1996
2388
|
return options.executeTaskReportBug(context, rest);
|
|
1997
2389
|
case "lookup": {
|
|
1998
2390
|
if (rest.length !== 1) {
|
|
1999
|
-
throw new CliError2("Usage:
|
|
2391
|
+
throw new CliError2("Usage: rig task lookup <task-id>");
|
|
2000
2392
|
}
|
|
2001
2393
|
const lookupId = rest[0];
|
|
2002
2394
|
if (!lookupId) {
|
|
2003
|
-
throw new CliError2("Usage:
|
|
2395
|
+
throw new CliError2("Usage: rig task lookup <task-id>");
|
|
2004
2396
|
}
|
|
2005
2397
|
const result = taskLookup(context.projectRoot, lookupId);
|
|
2006
2398
|
if (context.outputMode === "text") {
|
|
@@ -2010,17 +2402,17 @@ async function executeTask(context, args, options) {
|
|
|
2010
2402
|
}
|
|
2011
2403
|
case "record": {
|
|
2012
2404
|
if (rest.length < 2) {
|
|
2013
|
-
throw new CliError2("Usage:
|
|
2405
|
+
throw new CliError2("Usage: rig task record <decision|failure> <text>");
|
|
2014
2406
|
}
|
|
2015
2407
|
const type = rest[0];
|
|
2016
2408
|
if (type !== "decision" && type !== "failure") {
|
|
2017
|
-
throw new CliError2("Usage:
|
|
2409
|
+
throw new CliError2("Usage: rig task record <decision|failure> <text>");
|
|
2018
2410
|
}
|
|
2019
2411
|
withMutedConsole(context.outputMode === "json", () => taskRecord(context.projectRoot, type, rest.slice(1).join(" ")));
|
|
2020
2412
|
return { ok: true, group: "task", command, details: { type: rest[0] } };
|
|
2021
2413
|
}
|
|
2022
2414
|
case "ready":
|
|
2023
|
-
requireNoExtraArgs(rest, "
|
|
2415
|
+
requireNoExtraArgs(rest, "rig task ready");
|
|
2024
2416
|
await withMutedConsole(context.outputMode === "json", () => taskReady(context.projectRoot));
|
|
2025
2417
|
return { ok: true, group: "task", command };
|
|
2026
2418
|
case "run": {
|
|
@@ -2057,7 +2449,7 @@ async function executeTask(context, args, options) {
|
|
|
2057
2449
|
if (positionalTaskId) {
|
|
2058
2450
|
pending = pending.slice(1);
|
|
2059
2451
|
}
|
|
2060
|
-
requireNoExtraArgs(pending, "
|
|
2452
|
+
requireNoExtraArgs(pending, "rig task run [#<issue>|<task-id>] [--next] [--task <id>] [--detach] [--assignee <login|@me>] [--assigned-to <login|me|@me>] [--state open|closed] [--status <status>] [--limit <n>] [--title <text>] [--runtime-adapter claude-code|codex|pi] [--model <model>] [--runtime-mode <mode>] [--interaction-mode <mode>] [--initial-prompt <text>] [--pr auto|ask|off] [--no-pr] [--dirty-baseline head|dirty-snapshot] [--skip-project-sync]");
|
|
2061
2453
|
if (nextResult.value && (taskResult.value || positionalTaskId)) {
|
|
2062
2454
|
throw new CliError2("task run cannot combine --next with an explicit task id.", 2);
|
|
2063
2455
|
}
|
|
@@ -2111,10 +2503,24 @@ async function executeTask(context, args, options) {
|
|
|
2111
2503
|
});
|
|
2112
2504
|
let attachDetails = null;
|
|
2113
2505
|
if (!detachResult.value && context.outputMode === "text") {
|
|
2114
|
-
|
|
2506
|
+
printFormattedOutput(formatSubmittedRun({
|
|
2507
|
+
runId: submitted.runId,
|
|
2508
|
+
task: selectedTask ? summarizeTask(selectedTask) : null,
|
|
2509
|
+
runtimeAdapter,
|
|
2510
|
+
runtimeMode: runtimeModeResult.value || projectDefaults.runtimeMode || "full-access",
|
|
2511
|
+
interactionMode: interactionModeResult.value || "default",
|
|
2512
|
+
detached: false
|
|
2513
|
+
}));
|
|
2115
2514
|
attachDetails = await attachRunOperatorView(context, { runId: submitted.runId, follow: true });
|
|
2116
2515
|
} else if (context.outputMode === "text") {
|
|
2117
|
-
|
|
2516
|
+
printFormattedOutput(formatSubmittedRun({
|
|
2517
|
+
runId: submitted.runId,
|
|
2518
|
+
task: selectedTask ? summarizeTask(selectedTask) : null,
|
|
2519
|
+
runtimeAdapter,
|
|
2520
|
+
runtimeMode: runtimeModeResult.value || projectDefaults.runtimeMode || "full-access",
|
|
2521
|
+
interactionMode: interactionModeResult.value || "default",
|
|
2522
|
+
detached: true
|
|
2523
|
+
}));
|
|
2118
2524
|
}
|
|
2119
2525
|
return {
|
|
2120
2526
|
ok: true,
|
|
@@ -2138,7 +2544,7 @@ async function executeTask(context, args, options) {
|
|
|
2138
2544
|
}
|
|
2139
2545
|
case "validate": {
|
|
2140
2546
|
const { value: task, rest: remaining } = takeOption(rest, "--task");
|
|
2141
|
-
requireNoExtraArgs(remaining, "
|
|
2547
|
+
requireNoExtraArgs(remaining, "rig task validate [--task <task-id>]");
|
|
2142
2548
|
if (context.dryRun) {
|
|
2143
2549
|
await context.runCommand(["rig", "task", "validate", ...task ? ["--task", task] : []]);
|
|
2144
2550
|
return { ok: true, group: "task", command, details: { task: task || "active" } };
|
|
@@ -2151,7 +2557,7 @@ async function executeTask(context, args, options) {
|
|
|
2151
2557
|
}
|
|
2152
2558
|
case "verify": {
|
|
2153
2559
|
const { value: task, rest: remaining } = takeOption(rest, "--task");
|
|
2154
|
-
requireNoExtraArgs(remaining, "
|
|
2560
|
+
requireNoExtraArgs(remaining, "rig task verify [--task <task-id>]");
|
|
2155
2561
|
if (context.dryRun) {
|
|
2156
2562
|
await context.runCommand(["rig", "task", "verify", ...task ? ["--task", task] : []]);
|
|
2157
2563
|
return { ok: true, group: "task", command, details: { task: task || "active" } };
|
|
@@ -2164,15 +2570,15 @@ async function executeTask(context, args, options) {
|
|
|
2164
2570
|
}
|
|
2165
2571
|
case "reset": {
|
|
2166
2572
|
const { value: task, rest: remaining } = takeOption(rest, "--task");
|
|
2167
|
-
requireNoExtraArgs(remaining, "
|
|
2168
|
-
const requiredTask = requireTask(task, "
|
|
2573
|
+
requireNoExtraArgs(remaining, "rig task reset --task <task-id>");
|
|
2574
|
+
const requiredTask = requireTask(task, "rig task reset --task <task-id>");
|
|
2169
2575
|
await context.runCommand(["br", "--no-db", "update", requiredTask, "--status", "open"]);
|
|
2170
2576
|
return { ok: true, group: "task", command, details: { task: requiredTask } };
|
|
2171
2577
|
}
|
|
2172
2578
|
case "details": {
|
|
2173
2579
|
const { value: task, rest: remaining } = takeOption(rest, "--task");
|
|
2174
|
-
requireNoExtraArgs(remaining, "
|
|
2175
|
-
const requiredTask = requireTask(task, "
|
|
2580
|
+
requireNoExtraArgs(remaining, "rig task details --task <task-id>");
|
|
2581
|
+
const requiredTask = requireTask(task, "rig task details --task <task-id>");
|
|
2176
2582
|
await withMutedConsole(context.outputMode === "json", () => taskInfo(context.projectRoot, requiredTask));
|
|
2177
2583
|
return { ok: true, group: "task", command, details: { task: requiredTask } };
|
|
2178
2584
|
}
|
|
@@ -2180,9 +2586,9 @@ async function executeTask(context, args, options) {
|
|
|
2180
2586
|
const { value: task, rest: rest1 } = takeOption(rest, "--task");
|
|
2181
2587
|
const allFlag = takeFlag(rest1, "--all");
|
|
2182
2588
|
const { rest: remaining } = takeOption(allFlag.rest, "--reason");
|
|
2183
|
-
requireNoExtraArgs(remaining, "
|
|
2589
|
+
requireNoExtraArgs(remaining, "rig task reopen [--task <id> | --all] [--reason <text>]");
|
|
2184
2590
|
if (!allFlag.value && !task) {
|
|
2185
|
-
throw new CliError2("Usage:
|
|
2591
|
+
throw new CliError2("Usage: rig task reopen [--task <id> | --all] [--reason <text>]");
|
|
2186
2592
|
}
|
|
2187
2593
|
const summary = withMutedConsole(context.outputMode === "json", () => taskReopen(context.projectRoot, {
|
|
2188
2594
|
all: allFlag.value,
|