@dypt/cli 0.1.15 → 0.1.17
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/README.md +35 -0
- package/dist/index.js +127 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,6 +34,21 @@ dypt task list
|
|
|
34
34
|
dypt task list --limit 10
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
+
Result filters such as `--priority`, `--status`, and `--tag` describe the task
|
|
38
|
+
returned by the list. Branch filters describe one ancestor-or-self anchor and
|
|
39
|
+
include that anchor's descendants. All supplied `--branch-*` predicates must
|
|
40
|
+
match the same anchor:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
dypt task list --priority high --branch-tag project
|
|
44
|
+
dypt task list --branch-priority high --branch-tag project --branch-tag client --branch-tag-mode all
|
|
45
|
+
dypt task list --scope Work --branch-deadline-to 2026-08-31 --show-path
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Branch filtering is query-time ancestry matching. It does not copy tags,
|
|
49
|
+
priority, status, deadlines, or time estimates onto descendants. Run
|
|
50
|
+
`dypt task list --help` for the branch priority, deadline, and tag flags.
|
|
51
|
+
|
|
37
52
|
### Create a task
|
|
38
53
|
|
|
39
54
|
Create a new task:
|
|
@@ -129,6 +144,26 @@ dypt reminder list 123 --json
|
|
|
129
144
|
dypt reminder add 123 1d --json
|
|
130
145
|
```
|
|
131
146
|
|
|
147
|
+
### Manage tags
|
|
148
|
+
|
|
149
|
+
Create, inspect, and update reusable tags from the CLI:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
dypt tag create "deep work" --colour violet --description "Requires uninterrupted focus."
|
|
153
|
+
dypt tag get "deep work"
|
|
154
|
+
dypt tag get tag_abc123 --json
|
|
155
|
+
dypt tag update tag_abc123 --description "Use for focused work without meetings."
|
|
156
|
+
dypt tag update tag_abc123 --clear-description
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Descriptions are optional plain text, are trimmed when stored, and can contain
|
|
160
|
+
up to 500 characters. `tag list` keeps one tag per line and indicates when a
|
|
161
|
+
description exists; `tag get` prints the complete description. Add `--json` to
|
|
162
|
+
creation, inspection, or update commands for the complete structured tag.
|
|
163
|
+
|
|
164
|
+
When tags are merged, the destination tag keeps its name, colour, and
|
|
165
|
+
description. The source definition is discarded with the source tag.
|
|
166
|
+
|
|
132
167
|
## JSON output
|
|
133
168
|
|
|
134
169
|
Most commands support `--json` for agent and automation use.
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Argument, Command, Option } from "commander";
|
|
|
9
9
|
// package.json
|
|
10
10
|
var package_default = {
|
|
11
11
|
name: "@dypt/cli",
|
|
12
|
-
version: "0.1.
|
|
12
|
+
version: "0.1.17",
|
|
13
13
|
description: "Command-line interface for dypt task management",
|
|
14
14
|
license: "SEE LICENSE IN LICENSE",
|
|
15
15
|
homepage: "https://dypt.app",
|
|
@@ -345,6 +345,7 @@ async function createCliApi(options = {}) {
|
|
|
345
345
|
setReminders: (input) => cliClient.cli.v1.reminders.set.mutate(input),
|
|
346
346
|
removeReminder: (input) => cliClient.cli.v1.reminders.remove.mutate(input),
|
|
347
347
|
listTags: (input) => cliClient.cli.v1.tags.list.query(input),
|
|
348
|
+
getTag: (input) => cliClient.cli.v1.tags.get.query(input),
|
|
348
349
|
createTag: (input) => cliClient.cli.v1.tags.create.mutate(input),
|
|
349
350
|
updateTag: (input) => cliClient.cli.v1.tags.update.mutate(input),
|
|
350
351
|
deleteTag: (input) => cliClient.cli.v1.tags.delete.mutate(input),
|
|
@@ -779,13 +780,20 @@ async function getAgentStatus(input) {
|
|
|
779
780
|
|
|
780
781
|
// src/commands/agent/install.ts
|
|
781
782
|
function resolveSource2(input) {
|
|
782
|
-
|
|
783
|
+
const source = input.source ?? "github-release";
|
|
784
|
+
if (input.path && source !== "local") {
|
|
785
|
+
throw new Error("Use --path only with --source local.");
|
|
786
|
+
}
|
|
787
|
+
if (input.version && source !== "github-release") {
|
|
788
|
+
throw new Error("Use --version only with --source github-release.");
|
|
789
|
+
}
|
|
790
|
+
if (source === "local") {
|
|
783
791
|
if (!input.path) {
|
|
784
792
|
throw new Error("Use --path <local-toolkit-path> with --source local.");
|
|
785
793
|
}
|
|
786
794
|
return { type: "local", path: input.path };
|
|
787
795
|
}
|
|
788
|
-
if (
|
|
796
|
+
if (source === "github-main") {
|
|
789
797
|
return { type: "github-main" };
|
|
790
798
|
}
|
|
791
799
|
return {
|
|
@@ -1137,7 +1145,12 @@ async function runTaskList(input, deps) {
|
|
|
1137
1145
|
limit: input.limit ?? "50",
|
|
1138
1146
|
cursor: input.cursor,
|
|
1139
1147
|
tag: input.tag,
|
|
1140
|
-
tagMode: input.tagMode
|
|
1148
|
+
tagMode: input.tagMode,
|
|
1149
|
+
branchPriority: input.branchPriority,
|
|
1150
|
+
branchDeadlineFrom: input.branchDeadlineFrom,
|
|
1151
|
+
branchDeadlineTo: input.branchDeadlineTo,
|
|
1152
|
+
branchTag: input.branchTag,
|
|
1153
|
+
branchTagMode: input.branchTagMode
|
|
1141
1154
|
});
|
|
1142
1155
|
if (input.json) {
|
|
1143
1156
|
deps.printJson(result);
|
|
@@ -1507,10 +1520,14 @@ async function runTagList(input, deps) {
|
|
|
1507
1520
|
async function runTagCreate(input, deps) {
|
|
1508
1521
|
const result = await deps.createTag({
|
|
1509
1522
|
name: input.name,
|
|
1510
|
-
colour: input.colour
|
|
1523
|
+
colour: input.colour,
|
|
1524
|
+
description: input.description
|
|
1511
1525
|
});
|
|
1512
1526
|
print(result, input.json, deps);
|
|
1513
1527
|
}
|
|
1528
|
+
async function runTagGet(input, deps) {
|
|
1529
|
+
print(await deps.getTag({ ref: input.ref }), input.json, deps);
|
|
1530
|
+
}
|
|
1514
1531
|
async function runTagUpdate(input, deps) {
|
|
1515
1532
|
const { json, ...mutation } = input;
|
|
1516
1533
|
print(await deps.updateTag(mutation), json, deps);
|
|
@@ -1622,6 +1639,9 @@ function isTaskLike(value) {
|
|
|
1622
1639
|
function isNoteLike(value) {
|
|
1623
1640
|
return isRecord(value) && typeof value.id === "number" && typeof value.taskId === "number" && typeof value.content === "string";
|
|
1624
1641
|
}
|
|
1642
|
+
function isTagLike(value) {
|
|
1643
|
+
return isRecord(value) && typeof value.publicId === "string" && value.publicId.startsWith("tag_") && typeof value.name === "string" && typeof value.colour === "string" && (value.description === void 0 || value.description === null || typeof value.description === "string");
|
|
1644
|
+
}
|
|
1625
1645
|
function isDependencyLike(value) {
|
|
1626
1646
|
return isRecord(value) && typeof value.id === "number" && typeof value.title === "string";
|
|
1627
1647
|
}
|
|
@@ -2236,6 +2256,21 @@ function renderNotes(notes, color) {
|
|
|
2236
2256
|
${renderMarkdownNote(note.content, color)}`;
|
|
2237
2257
|
}).join("\n\n");
|
|
2238
2258
|
}
|
|
2259
|
+
function renderTagDetail(tag, color) {
|
|
2260
|
+
return [
|
|
2261
|
+
`${colorize(tag.publicId, "cyan", color)} ${emphasize(tag.name, "bold", color)}`,
|
|
2262
|
+
`Colour: ${tag.colour}`,
|
|
2263
|
+
`Description: ${tag.description ?? "-"}`,
|
|
2264
|
+
`Status: ${tag.archivedAt ? "archived" : "active"}`,
|
|
2265
|
+
`System identity: ${tag.systemKey ?? "-"}`,
|
|
2266
|
+
...tag.usageCount === void 0 ? [] : [`Usage: ${tag.usageCount} tasks`]
|
|
2267
|
+
].join("\n");
|
|
2268
|
+
}
|
|
2269
|
+
function renderTags(tags, color) {
|
|
2270
|
+
return tags.map(
|
|
2271
|
+
(tag) => `${colorize(tag.publicId, "cyan", color)} ${tag.name} \xB7 ${tag.colour}${tag.archivedAt ? " \xB7 archived" : ""}${tag.description ? " \xB7 description" : ""}`
|
|
2272
|
+
).join("\n");
|
|
2273
|
+
}
|
|
2239
2274
|
function renderDeleteMany(result, color) {
|
|
2240
2275
|
const lines = [
|
|
2241
2276
|
`${colorize("Deleted", "green", color)} ${result.tasksDeleted} task${result.tasksDeleted === 1 ? "" : "s"}.`,
|
|
@@ -2500,6 +2535,9 @@ function formatHumanOutput(value, options = {}) {
|
|
|
2500
2535
|
return renderUpdateMany(value, color);
|
|
2501
2536
|
}
|
|
2502
2537
|
if (Array.isArray(value)) {
|
|
2538
|
+
if (value.every(isTagLike)) {
|
|
2539
|
+
return renderTags(value, color);
|
|
2540
|
+
}
|
|
2503
2541
|
if (value.every(isTaskLike)) {
|
|
2504
2542
|
return renderTaskList({ items: value }, color);
|
|
2505
2543
|
}
|
|
@@ -2516,6 +2554,9 @@ function formatHumanOutput(value, options = {}) {
|
|
|
2516
2554
|
if (isNoteLike(value)) {
|
|
2517
2555
|
return renderNotes([value], color);
|
|
2518
2556
|
}
|
|
2557
|
+
if (isTagLike(value)) {
|
|
2558
|
+
return renderTagDetail(value, color);
|
|
2559
|
+
}
|
|
2519
2560
|
return JSON.stringify(value, null, 2);
|
|
2520
2561
|
}
|
|
2521
2562
|
function printJson(value) {
|
|
@@ -2541,6 +2582,7 @@ async function confirmAction(message, deps = {}) {
|
|
|
2541
2582
|
var cliVersion = package_default.version;
|
|
2542
2583
|
var taskStatusChoices = ["not started", "in progress", "completed"];
|
|
2543
2584
|
var taskPriorityChoices = ["low", "mid", "medium", "high"];
|
|
2585
|
+
var nullableTaskPriorityChoices = ["none", ...taskPriorityChoices];
|
|
2544
2586
|
var agentTargetChoices = ["codex", "claude"];
|
|
2545
2587
|
var agentSourceChoices = ["github-release", "github-main", "local"];
|
|
2546
2588
|
var tagColourChoices = [
|
|
@@ -2555,6 +2597,22 @@ var tagColourChoices = [
|
|
|
2555
2597
|
"violet",
|
|
2556
2598
|
"pink"
|
|
2557
2599
|
];
|
|
2600
|
+
var MAX_TAG_DESCRIPTION_LENGTH = 500;
|
|
2601
|
+
function normalizeTagDescriptionOption(value) {
|
|
2602
|
+
if (value === void 0) return void 0;
|
|
2603
|
+
const normalized = value.trim();
|
|
2604
|
+
if (!normalized) {
|
|
2605
|
+
throw new Error(
|
|
2606
|
+
"Description cannot be empty. Omit --description or use --clear-description when updating."
|
|
2607
|
+
);
|
|
2608
|
+
}
|
|
2609
|
+
if (normalized.length > MAX_TAG_DESCRIPTION_LENGTH) {
|
|
2610
|
+
throw new Error(
|
|
2611
|
+
`Description must be ${MAX_TAG_DESCRIPTION_LENGTH} characters or fewer.`
|
|
2612
|
+
);
|
|
2613
|
+
}
|
|
2614
|
+
return normalized;
|
|
2615
|
+
}
|
|
2558
2616
|
function normalizePriority(priority) {
|
|
2559
2617
|
if (!priority) return void 0;
|
|
2560
2618
|
if (priority === "medium") return "mid";
|
|
@@ -2563,6 +2621,9 @@ function normalizePriority(priority) {
|
|
|
2563
2621
|
}
|
|
2564
2622
|
throw new Error(`Unsupported priority: ${priority}`);
|
|
2565
2623
|
}
|
|
2624
|
+
function normalizeNullablePriority(priority) {
|
|
2625
|
+
return priority === "none" ? null : normalizePriority(priority);
|
|
2626
|
+
}
|
|
2566
2627
|
function normalizeStatus(status) {
|
|
2567
2628
|
if (!status) return void 0;
|
|
2568
2629
|
if (status === "not started" || status === "in progress" || status === "completed") {
|
|
@@ -2733,7 +2794,7 @@ async function promptLine(prompt) {
|
|
|
2733
2794
|
}
|
|
2734
2795
|
function buildCli() {
|
|
2735
2796
|
const program = new Command();
|
|
2736
|
-
program.name("dypt").version(cliVersion, "-V, --version");
|
|
2797
|
+
program.name("dypt").version(cliVersion, "-V, --version").enablePositionalOptions();
|
|
2737
2798
|
const addGroupHelpAction = (command) => {
|
|
2738
2799
|
command.action(() => {
|
|
2739
2800
|
command.outputHelp();
|
|
@@ -2846,9 +2907,17 @@ function buildCli() {
|
|
|
2846
2907
|
);
|
|
2847
2908
|
tag.command("create").argument("<name>").addOption(
|
|
2848
2909
|
new Option("--colour <colour>", "tag colour").choices([...tagColourChoices]).default("gray")
|
|
2910
|
+
).option(
|
|
2911
|
+
"--description <text>",
|
|
2912
|
+
`optional plain-text description (max ${MAX_TAG_DESCRIPTION_LENGTH} characters)`
|
|
2849
2913
|
).option("--json", "print JSON output").action(
|
|
2850
2914
|
async (name, options) => runTagCreate(
|
|
2851
|
-
{
|
|
2915
|
+
{
|
|
2916
|
+
name,
|
|
2917
|
+
colour: options.colour,
|
|
2918
|
+
description: normalizeTagDescriptionOption(options.description),
|
|
2919
|
+
json: Boolean(options.json)
|
|
2920
|
+
},
|
|
2852
2921
|
{
|
|
2853
2922
|
createTag: (input) => withCliApi((api) => api.createTag(input)),
|
|
2854
2923
|
printJson,
|
|
@@ -2856,19 +2925,37 @@ function buildCli() {
|
|
|
2856
2925
|
}
|
|
2857
2926
|
)
|
|
2858
2927
|
);
|
|
2928
|
+
tag.command("get").description("Inspect a complete tag definition").argument("<id-or-name>").option("--json", "print JSON output").action(
|
|
2929
|
+
(ref, options) => runTagGet(
|
|
2930
|
+
{ ref, json: Boolean(options.json) },
|
|
2931
|
+
{
|
|
2932
|
+
getTag: (input) => withCliApi((api) => api.getTag(input)),
|
|
2933
|
+
printJson,
|
|
2934
|
+
printTable
|
|
2935
|
+
}
|
|
2936
|
+
)
|
|
2937
|
+
);
|
|
2859
2938
|
tag.command("update").argument("<tag-id>").option("--name <name>", "new tag name").addOption(
|
|
2860
2939
|
new Option("--colour <colour>", "new tag colour").choices([
|
|
2861
2940
|
...tagColourChoices
|
|
2862
2941
|
])
|
|
2863
|
-
).option(
|
|
2942
|
+
).option(
|
|
2943
|
+
"--description <text>",
|
|
2944
|
+
`new plain-text description (max ${MAX_TAG_DESCRIPTION_LENGTH} characters)`
|
|
2945
|
+
).option("--clear-description", "remove the tag description").option("--archive", "archive the tag").option("--restore", "restore the tag").option("--json", "print JSON output").action(
|
|
2864
2946
|
async (tagPublicId, options) => {
|
|
2865
2947
|
if (options.archive && options.restore)
|
|
2866
2948
|
throw new Error("Choose either --archive or --restore.");
|
|
2949
|
+
if (options.description !== void 0 && options.clearDescription)
|
|
2950
|
+
throw new Error(
|
|
2951
|
+
"Choose either --description or --clear-description."
|
|
2952
|
+
);
|
|
2867
2953
|
await runTagUpdate(
|
|
2868
2954
|
{
|
|
2869
2955
|
tagPublicId,
|
|
2870
2956
|
name: options.name,
|
|
2871
2957
|
colour: options.colour,
|
|
2958
|
+
description: options.clearDescription ? null : normalizeTagDescriptionOption(options.description),
|
|
2872
2959
|
archived: options.archive ? true : options.restore ? false : void 0,
|
|
2873
2960
|
json: Boolean(options.json)
|
|
2874
2961
|
},
|
|
@@ -3012,6 +3099,20 @@ function buildCli() {
|
|
|
3012
3099
|
(value, values = []) => [...values, value]
|
|
3013
3100
|
).addOption(
|
|
3014
3101
|
new Option("--tag-mode <mode>", "match any or all selected tags").choices(["any", "all"]).default("any")
|
|
3102
|
+
).addOption(
|
|
3103
|
+
new Option(
|
|
3104
|
+
"--branch-priority <priority>",
|
|
3105
|
+
"require the same ancestor-or-self anchor to have this priority"
|
|
3106
|
+
).choices([...nullableTaskPriorityChoices])
|
|
3107
|
+
).option("--branch-deadline-from <iso>", "inclusive anchor deadline start").option("--branch-deadline-to <iso>", "inclusive anchor deadline end").option(
|
|
3108
|
+
"--branch-tag <name>",
|
|
3109
|
+
"require a tag on the same ancestor-or-self anchor; repeatable",
|
|
3110
|
+
(value, values = []) => [...values, value]
|
|
3111
|
+
).addOption(
|
|
3112
|
+
new Option(
|
|
3113
|
+
"--branch-tag-mode <mode>",
|
|
3114
|
+
"match any or all branch tags on that anchor"
|
|
3115
|
+
).choices(["any", "all"]).default("any")
|
|
3015
3116
|
).option("--limit <n>", "page size (1-100, default: 50)").option("--cursor <id>", "cursor task id for pagination").option("--json", "print JSON output").addHelpText(
|
|
3016
3117
|
"after",
|
|
3017
3118
|
[
|
|
@@ -3050,6 +3151,11 @@ function buildCli() {
|
|
|
3050
3151
|
cursor: options.cursor,
|
|
3051
3152
|
tag: options.tag,
|
|
3052
3153
|
tagMode: options.tagMode,
|
|
3154
|
+
branchPriority: options.branchPriority,
|
|
3155
|
+
branchDeadlineFrom: options.branchDeadlineFrom,
|
|
3156
|
+
branchDeadlineTo: options.branchDeadlineTo,
|
|
3157
|
+
branchTag: options.branchTag,
|
|
3158
|
+
branchTagMode: options.branchTagMode,
|
|
3053
3159
|
json: Boolean(options.json)
|
|
3054
3160
|
},
|
|
3055
3161
|
{
|
|
@@ -3093,6 +3199,19 @@ function buildCli() {
|
|
|
3093
3199
|
showPath: input.showPath,
|
|
3094
3200
|
tagNames: input.tag,
|
|
3095
3201
|
tagMode: input.tagMode === "all" ? "all" : "any",
|
|
3202
|
+
branchPriority: normalizeNullablePriority(
|
|
3203
|
+
input.branchPriority
|
|
3204
|
+
),
|
|
3205
|
+
branchDeadlineFrom: parseDateOption(
|
|
3206
|
+
input.branchDeadlineFrom,
|
|
3207
|
+
"start"
|
|
3208
|
+
),
|
|
3209
|
+
branchDeadlineTo: parseDateOption(
|
|
3210
|
+
input.branchDeadlineTo,
|
|
3211
|
+
"end"
|
|
3212
|
+
),
|
|
3213
|
+
branchTagNames: input.branchTag,
|
|
3214
|
+
branchTagMode: input.branchTagMode === "all" ? "all" : "any",
|
|
3096
3215
|
limit: parseIntegerOption(input.limit, "limit", 1, 100),
|
|
3097
3216
|
cursor: input.cursor ? {
|
|
3098
3217
|
id: parseIntegerOption(input.cursor, "cursor", 1)
|