@cleocode/cleo 2026.4.17 → 2026.4.18
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/cli/index.js +249 -15
- package/dist/cli/index.js.map +4 -4
- package/package.json +7 -7
package/dist/cli/index.js
CHANGED
|
@@ -75307,6 +75307,7 @@ __export(src_exports, {
|
|
|
75307
75307
|
});
|
|
75308
75308
|
var init_src2 = __esm({
|
|
75309
75309
|
"packages/core/src/index.ts"() {
|
|
75310
|
+
"use strict";
|
|
75310
75311
|
init_src();
|
|
75311
75312
|
init_adapters();
|
|
75312
75313
|
init_admin();
|
|
@@ -100331,7 +100332,7 @@ var init_normalizer = __esm({
|
|
|
100331
100332
|
});
|
|
100332
100333
|
|
|
100333
100334
|
// packages/cleo/src/cli/renderers/colors.ts
|
|
100334
|
-
function
|
|
100335
|
+
function ansi2(code) {
|
|
100335
100336
|
return colorsEnabled ? code : "";
|
|
100336
100337
|
}
|
|
100337
100338
|
function statusSymbol(status) {
|
|
@@ -100424,15 +100425,15 @@ var init_colors = __esm({
|
|
|
100424
100425
|
if (lang === "C" || lang === "POSIX") return false;
|
|
100425
100426
|
return lang.includes("UTF") || process.platform === "darwin";
|
|
100426
100427
|
})();
|
|
100427
|
-
BOLD =
|
|
100428
|
-
DIM =
|
|
100429
|
-
NC =
|
|
100430
|
-
RED =
|
|
100431
|
-
GREEN =
|
|
100432
|
-
YELLOW =
|
|
100433
|
-
BLUE =
|
|
100434
|
-
MAGENTA =
|
|
100435
|
-
CYAN =
|
|
100428
|
+
BOLD = ansi2("\x1B[1m");
|
|
100429
|
+
DIM = ansi2("\x1B[2m");
|
|
100430
|
+
NC = ansi2("\x1B[0m");
|
|
100431
|
+
RED = ansi2("\x1B[0;31m");
|
|
100432
|
+
GREEN = ansi2("\x1B[0;32m");
|
|
100433
|
+
YELLOW = ansi2("\x1B[1;33m");
|
|
100434
|
+
BLUE = ansi2("\x1B[0;34m");
|
|
100435
|
+
MAGENTA = ansi2("\x1B[0;35m");
|
|
100436
|
+
CYAN = ansi2("\x1B[0;36m");
|
|
100436
100437
|
BOX = unicodeEnabled ? {
|
|
100437
100438
|
tl: "\u256D",
|
|
100438
100439
|
tr: "\u256E",
|
|
@@ -116140,11 +116141,11 @@ var CLIError = class extends Error {
|
|
|
116140
116141
|
function parseRawArgs(args = [], opts = {}) {
|
|
116141
116142
|
const booleans = new Set(opts.boolean || []);
|
|
116142
116143
|
const strings = new Set(opts.string || []);
|
|
116143
|
-
const
|
|
116144
|
+
const aliasMap2 = opts.alias || {};
|
|
116144
116145
|
const defaults = opts.default || {};
|
|
116145
116146
|
const aliasToMain = /* @__PURE__ */ new Map();
|
|
116146
116147
|
const mainToAliases = /* @__PURE__ */ new Map();
|
|
116147
|
-
for (const [key, value] of Object.entries(
|
|
116148
|
+
for (const [key, value] of Object.entries(aliasMap2)) {
|
|
116148
116149
|
const targets = value;
|
|
116149
116150
|
for (const target of targets) {
|
|
116150
116151
|
aliasToMain.set(key, target);
|
|
@@ -116165,8 +116166,8 @@ function parseRawArgs(args = [], opts = {}) {
|
|
|
116165
116166
|
const allOptions = /* @__PURE__ */ new Set([
|
|
116166
116167
|
...booleans,
|
|
116167
116168
|
...strings,
|
|
116168
|
-
...Object.keys(
|
|
116169
|
-
...Object.values(
|
|
116169
|
+
...Object.keys(aliasMap2),
|
|
116170
|
+
...Object.values(aliasMap2).flat(),
|
|
116170
116171
|
...Object.keys(defaults)
|
|
116171
116172
|
]);
|
|
116172
116173
|
for (const name2 of allOptions) if (!options[name2]) options[name2] = {
|
|
@@ -116582,6 +116583,237 @@ function camelToKebab2(str) {
|
|
|
116582
116583
|
init_field_context();
|
|
116583
116584
|
init_format_context();
|
|
116584
116585
|
|
|
116586
|
+
// packages/cleo/src/cli/help-renderer.ts
|
|
116587
|
+
var noColor2 = (() => {
|
|
116588
|
+
const env = globalThis.process?.env ?? {};
|
|
116589
|
+
return env.NO_COLOR === "1" || env.TERM === "dumb" || env.TEST || env.CI;
|
|
116590
|
+
})();
|
|
116591
|
+
var ansi = (code, reset = 39) => (t) => noColor2 ? t : `\x1B[${code}m${t}\x1B[${reset}m`;
|
|
116592
|
+
var bold2 = ansi(1, 22);
|
|
116593
|
+
var cyan2 = ansi(36);
|
|
116594
|
+
var gray2 = ansi(90);
|
|
116595
|
+
var underline2 = ansi(4, 24);
|
|
116596
|
+
var IMPLICIT_ALIASES = {
|
|
116597
|
+
tags: "labels"
|
|
116598
|
+
};
|
|
116599
|
+
var NATIVE_COMMAND_DESCS = {
|
|
116600
|
+
version: "Display CLEO version",
|
|
116601
|
+
code: "Code analysis via tree-sitter AST"
|
|
116602
|
+
};
|
|
116603
|
+
var COMMAND_GROUPS = [
|
|
116604
|
+
{
|
|
116605
|
+
name: "Task Management",
|
|
116606
|
+
commands: [
|
|
116607
|
+
"add",
|
|
116608
|
+
"show",
|
|
116609
|
+
"find",
|
|
116610
|
+
"list",
|
|
116611
|
+
"update",
|
|
116612
|
+
"complete",
|
|
116613
|
+
"delete",
|
|
116614
|
+
"start",
|
|
116615
|
+
"stop",
|
|
116616
|
+
"current",
|
|
116617
|
+
"next",
|
|
116618
|
+
"exists",
|
|
116619
|
+
"bug"
|
|
116620
|
+
]
|
|
116621
|
+
},
|
|
116622
|
+
{
|
|
116623
|
+
name: "Task Organization",
|
|
116624
|
+
commands: [
|
|
116625
|
+
"archive",
|
|
116626
|
+
"labels",
|
|
116627
|
+
"promote",
|
|
116628
|
+
"relates",
|
|
116629
|
+
"reorder",
|
|
116630
|
+
"reparent",
|
|
116631
|
+
"deps",
|
|
116632
|
+
"tree",
|
|
116633
|
+
"blockers"
|
|
116634
|
+
]
|
|
116635
|
+
},
|
|
116636
|
+
{
|
|
116637
|
+
name: "Sessions & Planning",
|
|
116638
|
+
commands: ["session", "briefing", "dash", "plan", "safestop", "context"]
|
|
116639
|
+
},
|
|
116640
|
+
{
|
|
116641
|
+
name: "Phases & Lifecycle",
|
|
116642
|
+
commands: ["phase", "phases", "lifecycle", "release", "roadmap"]
|
|
116643
|
+
},
|
|
116644
|
+
{
|
|
116645
|
+
name: "Memory & Notes",
|
|
116646
|
+
commands: ["memory", "brain", "observe", "refresh-memory", "sticky", "reason"]
|
|
116647
|
+
},
|
|
116648
|
+
{
|
|
116649
|
+
name: "Analysis & Stats",
|
|
116650
|
+
commands: ["analyze", "stats", "history", "archive-stats"]
|
|
116651
|
+
},
|
|
116652
|
+
{
|
|
116653
|
+
name: "Validation & Compliance",
|
|
116654
|
+
commands: [
|
|
116655
|
+
"check",
|
|
116656
|
+
"validate",
|
|
116657
|
+
"verify",
|
|
116658
|
+
"testing",
|
|
116659
|
+
"compliance",
|
|
116660
|
+
"implementation",
|
|
116661
|
+
"specification",
|
|
116662
|
+
"consensus",
|
|
116663
|
+
"contribution",
|
|
116664
|
+
"decomposition",
|
|
116665
|
+
"backfill"
|
|
116666
|
+
]
|
|
116667
|
+
},
|
|
116668
|
+
{
|
|
116669
|
+
name: "Code & Documentation",
|
|
116670
|
+
commands: ["code", "docs", "detect-drift", "map"]
|
|
116671
|
+
},
|
|
116672
|
+
{
|
|
116673
|
+
name: "Research & Orchestration",
|
|
116674
|
+
commands: ["research", "orchestrate"]
|
|
116675
|
+
},
|
|
116676
|
+
{
|
|
116677
|
+
name: "Import / Export",
|
|
116678
|
+
commands: ["export", "import", "export-tasks", "import-tasks", "snapshot", "inject"]
|
|
116679
|
+
},
|
|
116680
|
+
{
|
|
116681
|
+
name: "Collaboration",
|
|
116682
|
+
commands: ["nexus", "remote", "push", "pull", "checkpoint"]
|
|
116683
|
+
},
|
|
116684
|
+
{
|
|
116685
|
+
name: "Agents",
|
|
116686
|
+
commands: ["agent", "grade"]
|
|
116687
|
+
},
|
|
116688
|
+
{
|
|
116689
|
+
name: "System & Admin",
|
|
116690
|
+
commands: [
|
|
116691
|
+
"version",
|
|
116692
|
+
"init",
|
|
116693
|
+
"config",
|
|
116694
|
+
"env",
|
|
116695
|
+
"admin",
|
|
116696
|
+
"doctor",
|
|
116697
|
+
"upgrade",
|
|
116698
|
+
"self-update",
|
|
116699
|
+
"commands",
|
|
116700
|
+
"ops",
|
|
116701
|
+
"schema",
|
|
116702
|
+
"log",
|
|
116703
|
+
"sequence",
|
|
116704
|
+
"adr",
|
|
116705
|
+
"cant",
|
|
116706
|
+
"token",
|
|
116707
|
+
"otel",
|
|
116708
|
+
"migrate",
|
|
116709
|
+
"detect",
|
|
116710
|
+
"generate-changelog",
|
|
116711
|
+
"issue",
|
|
116712
|
+
"skills",
|
|
116713
|
+
"web",
|
|
116714
|
+
"backup",
|
|
116715
|
+
"restore"
|
|
116716
|
+
]
|
|
116717
|
+
}
|
|
116718
|
+
];
|
|
116719
|
+
function buildAliasMap(shims) {
|
|
116720
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
116721
|
+
for (const shim of shims) {
|
|
116722
|
+
for (const alias of shim._aliases) {
|
|
116723
|
+
map2.set(alias, shim._name);
|
|
116724
|
+
}
|
|
116725
|
+
}
|
|
116726
|
+
for (const [alias, primary] of Object.entries(IMPLICIT_ALIASES)) {
|
|
116727
|
+
map2.set(alias, primary);
|
|
116728
|
+
}
|
|
116729
|
+
return map2;
|
|
116730
|
+
}
|
|
116731
|
+
function getShortDescription(desc7) {
|
|
116732
|
+
if (!desc7) return "";
|
|
116733
|
+
const match = desc7.match(/^Description:\s*(.+)/);
|
|
116734
|
+
if (match) return match[1].trim();
|
|
116735
|
+
const firstLine = desc7.split("\n").find((l) => l.trim().length > 0);
|
|
116736
|
+
return firstLine?.trim() ?? desc7.trim();
|
|
116737
|
+
}
|
|
116738
|
+
function renderGroupedHelp(version2, shims, aliasMap2) {
|
|
116739
|
+
const descMap = /* @__PURE__ */ new Map();
|
|
116740
|
+
for (const shim of shims) {
|
|
116741
|
+
descMap.set(shim._name, getShortDescription(shim._description));
|
|
116742
|
+
}
|
|
116743
|
+
for (const [name2, desc7] of Object.entries(NATIVE_COMMAND_DESCS)) {
|
|
116744
|
+
if (!descMap.has(name2)) {
|
|
116745
|
+
descMap.set(name2, desc7);
|
|
116746
|
+
}
|
|
116747
|
+
}
|
|
116748
|
+
const cmdAliases = /* @__PURE__ */ new Map();
|
|
116749
|
+
for (const [alias, primary] of aliasMap2) {
|
|
116750
|
+
const existing = cmdAliases.get(primary) ?? [];
|
|
116751
|
+
existing.push(alias);
|
|
116752
|
+
cmdAliases.set(primary, existing);
|
|
116753
|
+
}
|
|
116754
|
+
let maxCmdWidth = 0;
|
|
116755
|
+
const allGroupedCmds = COMMAND_GROUPS.flatMap((g2) => g2.commands);
|
|
116756
|
+
const allCmds = [.../* @__PURE__ */ new Set([...allGroupedCmds, ...shims.map((s3) => s3._name), "version"])];
|
|
116757
|
+
for (const cmd of allCmds) {
|
|
116758
|
+
if (!descMap.has(cmd) || aliasMap2.has(cmd)) continue;
|
|
116759
|
+
const aliases = cmdAliases.get(cmd);
|
|
116760
|
+
const display = aliases && aliases.length > 0 ? `${cmd} (${aliases.join(", ")})` : cmd;
|
|
116761
|
+
if (display.length > maxCmdWidth) maxCmdWidth = display.length;
|
|
116762
|
+
}
|
|
116763
|
+
const lines = [];
|
|
116764
|
+
lines.push(gray2(`CLEO V2 - Task management for AI coding agents (cleo v${version2})`));
|
|
116765
|
+
lines.push("");
|
|
116766
|
+
lines.push(`${underline2(bold2("USAGE"))} ${cyan2("cleo <command> [OPTIONS]")}`);
|
|
116767
|
+
lines.push("");
|
|
116768
|
+
const rendered = /* @__PURE__ */ new Set();
|
|
116769
|
+
for (const group of COMMAND_GROUPS) {
|
|
116770
|
+
const groupLines = [];
|
|
116771
|
+
for (const cmd of group.commands) {
|
|
116772
|
+
if (!descMap.has(cmd)) continue;
|
|
116773
|
+
rendered.add(cmd);
|
|
116774
|
+
const aliases = cmdAliases.get(cmd);
|
|
116775
|
+
const display = aliases && aliases.length > 0 ? `${cmd} (${aliases.join(", ")})` : cmd;
|
|
116776
|
+
const desc7 = descMap.get(cmd) ?? "";
|
|
116777
|
+
groupLines.push(` ${cyan2(display.padEnd(maxCmdWidth + 2))}${desc7}`);
|
|
116778
|
+
}
|
|
116779
|
+
if (groupLines.length > 0) {
|
|
116780
|
+
lines.push(underline2(bold2(group.name.toUpperCase())));
|
|
116781
|
+
lines.push(...groupLines);
|
|
116782
|
+
lines.push("");
|
|
116783
|
+
}
|
|
116784
|
+
}
|
|
116785
|
+
const ungrouped = [];
|
|
116786
|
+
for (const shim of shims) {
|
|
116787
|
+
if (!rendered.has(shim._name) && !aliasMap2.has(shim._name)) {
|
|
116788
|
+
ungrouped.push(shim._name);
|
|
116789
|
+
}
|
|
116790
|
+
}
|
|
116791
|
+
if (ungrouped.length > 0) {
|
|
116792
|
+
lines.push(underline2(bold2("OTHER")));
|
|
116793
|
+
for (const cmd of ungrouped) {
|
|
116794
|
+
const aliases = cmdAliases.get(cmd);
|
|
116795
|
+
const display = aliases && aliases.length > 0 ? `${cmd} (${aliases.join(", ")})` : cmd;
|
|
116796
|
+
const desc7 = descMap.get(cmd) ?? "";
|
|
116797
|
+
lines.push(` ${cyan2(display.padEnd(maxCmdWidth + 2))}${desc7}`);
|
|
116798
|
+
}
|
|
116799
|
+
lines.push("");
|
|
116800
|
+
}
|
|
116801
|
+
lines.push(`Use ${cyan2("cleo <command> --help")} for more information about a command.`);
|
|
116802
|
+
return lines.join("\n");
|
|
116803
|
+
}
|
|
116804
|
+
function createCustomShowUsage(version2, shims, aliasMap2) {
|
|
116805
|
+
return async (cmd, parent) => {
|
|
116806
|
+
if (!parent) {
|
|
116807
|
+
const meta3 = await (typeof cmd.meta === "function" ? cmd.meta() : cmd.meta);
|
|
116808
|
+
if (meta3?.name === "cleo") {
|
|
116809
|
+
console.log(renderGroupedHelp(version2, shims, aliasMap2) + "\n");
|
|
116810
|
+
return;
|
|
116811
|
+
}
|
|
116812
|
+
}
|
|
116813
|
+
await showUsage(cmd, parent);
|
|
116814
|
+
};
|
|
116815
|
+
}
|
|
116816
|
+
|
|
116585
116817
|
// packages/cleo/src/cli/middleware/output-format.ts
|
|
116586
116818
|
import { resolveOutputFormat } from "@cleocode/lafs";
|
|
116587
116819
|
function resolveFormat2(opts, defaults) {
|
|
@@ -125330,5 +125562,7 @@ var main = defineCommand({
|
|
|
125330
125562
|
},
|
|
125331
125563
|
subCommands
|
|
125332
125564
|
});
|
|
125333
|
-
|
|
125565
|
+
var aliasMap = buildAliasMap(rootShim._subcommands);
|
|
125566
|
+
var customShowUsage = createCustomShowUsage(CLI_VERSION, rootShim._subcommands, aliasMap);
|
|
125567
|
+
runMain(main, { showUsage: customShowUsage });
|
|
125334
125568
|
//# sourceMappingURL=index.js.map
|