tuturuuu 0.11.0 → 0.12.1

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 CHANGED
@@ -74,8 +74,14 @@ ttr lists use
74
74
  ttr tasks use
75
75
  ttr tasks --board <board-id>
76
76
  ttr tasks --compact
77
+ ttr tasks search "deadline review"
78
+ ttr tasks search "deadline review" --mode text
79
+ ttr tasks search "deadline review" --mode semantic
77
80
  ttr tasks create "Add Tuturuuu CLI"
78
81
  ttr tasks create --list <list-id> --name "Write release notes"
82
+ ttr task-templates create "Bug report" --key bug-report --title "Investigate bug"
83
+ ttr task-templates use bug-report --list <list-id>
84
+ ttr tasks create --template bug-report --list <list-id> --name "Investigate checkout bug"
79
85
  ttr tasks done <task-id>
80
86
  ttr tasks close <task-id>
81
87
  ttr tasks update <task-id> --json-payload '{"completed":true}'
@@ -145,7 +151,11 @@ ttr calendar events --help
145
151
  ttr finance --help
146
152
  ttr finance transactions --help
147
153
  ttr tasks --help
154
+ ttr tasks search --help
148
155
  ttr tasks create --help
156
+ ttr task-templates --help
157
+ ttr task-templates import --help
158
+ ttr task-templates export --help
149
159
  ttr tasks done --help
150
160
  ttr tasks close --help
151
161
  ttr tasks update --help
@@ -182,8 +192,18 @@ count and current page/max page. Add `--compact` to task lists when an agent
182
192
  only needs the task title, task list name, and per-task workspace name. Task
183
193
  lists are ordered by priority and due date, with prettier due dates and
184
194
  configured task-list colors in table output. Use `--json` on read commands when
185
- another agent or script needs machine-readable output. `tasks
186
- create`, `boards create`, and `lists create` accept a quoted positional name as
195
+ another agent or script needs machine-readable output.
196
+
197
+ Use `ttr tasks search <query>` for ranked task search. Search defaults to
198
+ `--mode hybrid`, accepts `--mode text` for PostgreSQL full-text search only and
199
+ `--mode semantic` for embedding similarity only, and supports
200
+ `--query`/`--q`, `--limit`/`--match-count`, `--threshold`/`--match-threshold`,
201
+ `--workspace`/`--ws`, `--compact`, and `--json`. Search output preserves API
202
+ relevance order and shows the score when available. Existing list filtering
203
+ with `ttr tasks --q <query>` is unchanged and remains the lightweight list text
204
+ filter.
205
+
206
+ `tasks create`, `boards create`, and `lists create` accept a quoted positional name as
187
207
  a shorthand for `--name`. Task CRUD accepts either the task UUID or the board
188
208
  identifier shown in the UI, such as `VHP-12`; prefixed identifiers resolve
189
209
  within the selected workspace even when another list is selected. Marking a task
@@ -194,6 +214,32 @@ completed stamps `completed_at` so Tuturuuu moves it to the first
194
214
  `closed_at`; pass `--list <closed-list-id>` to choose a specific closed
195
215
  destination.
196
216
 
217
+ Task templates are single-task starters, separate from board templates. Workspace
218
+ templates are managed with `ttr task-templates list/show/create/update/delete/use`
219
+ and can be imported from or exported to local markdown files. Local templates
220
+ live under `.tuturuuu/task-templates/*.md`, use YAML frontmatter for fields such
221
+ as `key`, `name`, `task_name`, `priority`, `label_ids`, `assignee_ids`, and
222
+ `project_ids`, and use the markdown body as the task description. Markdown
223
+ descriptions from `--description-format markdown` and local template bodies
224
+ support GFM pipe tables and are stored as TipTap/Yjs table content for the web
225
+ editor. `ttr tasks create --template <key-or-path>` resolves workspace keys or
226
+ local markdown paths; explicit flags such as `--name`, `--list`, `--priority`,
227
+ `--labels`, and `--projects` override template defaults.
228
+
229
+ ```markdown
230
+ ---
231
+ key: qa-handoff
232
+ name: QA handoff
233
+ task_name: Verify release handoff
234
+ priority: high
235
+ ---
236
+
237
+ | Field | Value |
238
+ | --- | --- |
239
+ | Owner | Platform |
240
+ | Environment | Staging |
241
+ ```
242
+
197
243
  Finance commands cover workspace wallets, transactions, categories, budgets,
198
244
  and recurring transactions through the same authenticated internal APIs as the
199
245
  web app. Use `--workspace` or `--ws` to target a specific workspace, and
@@ -256,8 +302,18 @@ Common task examples:
256
302
  ttr tasks
257
303
  ttr tasks --compact
258
304
  ttr tasks --json --no-update-check
305
+ ttr tasks search "deadline review"
306
+ ttr tasks search "deadline review" --mode hybrid --limit 20 --threshold 0.25
307
+ ttr tasks search --query "deadline review" --mode text --json --no-update-check
259
308
  ttr tasks create "Add Tuturuuu CLI"
260
309
  ttr tasks create --list <list-id> --name "Write release notes"
310
+ ttr task-templates list
311
+ ttr task-templates create "Bug report" --key bug-report --title "Investigate bug" --priority high
312
+ ttr task-templates export bug-report --file .tuturuuu/task-templates/bug-report.md
313
+ ttr task-templates import .tuturuuu/task-templates/bug-report.md
314
+ ttr tiptap parse --text "| Field | Value |\n| --- | --- |\n| Owner | Platform |" --format markdown --output json
315
+ ttr tasks create --template bug-report --list <list-id> --name "Investigate checkout bug"
316
+ ttr tasks create "QA handoff" --description-file table.md --description-format markdown
261
317
  ttr tasks done VHP-12
262
318
  ttr tasks done <task-id> --list <done-list-id>
263
319
  ttr tasks close VHP-12
@@ -1 +1 @@
1
- {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACjC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA+BpD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,sBAGpE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,sBAa9C;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;;;;eAOnD,MAAM;;;;YAQT,MAAM;;;;EASnB;AAED,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,YAOtC"}
1
+ {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACjC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA+BpD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,sBAGpE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,sBAc9C;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;;;;eAOnD,MAAM;;;;YAQT,MAAM;;;;EASnB;AAED,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,YAOtC"}
package/dist/cli/args.js CHANGED
@@ -44,6 +44,7 @@ function getDefaultAction(group) {
44
44
  'lists',
45
45
  'projects',
46
46
  'relationships',
47
+ 'task-templates',
47
48
  'tasks',
48
49
  'workspaces',
49
50
  ].includes(group)
@@ -1 +1 @@
1
- {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":";;;;;;;AAOA,mBAA0B,IAAc;IACtC,MAAM,KAAK,GAA8B,EAAE,CAAC;IAC5C,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAE,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACtB,SAAS;QACX,CAAC;QAED,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,GAAG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B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QACpD,OAAO;YACL,SAAS,EAAE,MAAe;YAC1B,MAAM,EAAE,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAE,MAAgB,CAAC,CAAC,CAAC,SAAS;SAC9D,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO;YACL,SAAS,EAAE,SAAS;YACpB,MAAM,EAAE,MAAe;SACxB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,SAAS,EACP,KAAK,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,SAAmB;QACnE,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,SAAmB;KAC5E,CAAC;AACJ,CAAC;AAED,kBAAyB,KAAc;IACrC,OAAO,KAAK;QACV,CAAC,CAAC,KAAK;aACF,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;aAC5B,MAAM,CAAC,OAAO,CAAC;QACpB,CAAC,CAAC,EAAE,CAAC;AACT,CAAC"}
@@ -18,6 +18,10 @@ export declare function listTasksForCli(client: TuturuuuUserClient, _config: Cli
18
18
  response: CliWorkspaceTasksResponse;
19
19
  workspaceName?: string;
20
20
  }>;
21
+ export declare function searchTasksForCli(client: TuturuuuUserClient, _config: CliConfig, workspaceId: string, flags: Record<string, FlagValue>, positionals: string[]): Promise<{
22
+ response: Awaited<ReturnType<TuturuuuUserClient['tasks']['search']>>;
23
+ workspaceName?: string;
24
+ }>;
21
25
  export declare function getTaskUpdatePayload(flags: Record<string, FlagValue>): Record<string, unknown>;
22
26
  export declare function getTaskDonePayload(flags: Record<string, FlagValue>, listId?: string): Record<string, unknown>;
23
27
  export declare function getTaskClosePayload(flags: Record<string, FlagValue>, listId?: string): Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,KAAK,SAAS,EAMf,MAAM,QAAQ,CAAC;AAQhB,OAAO,EACL,KAAK,SAAS,EAQf,MAAM,UAAU,CAAC;AAoElB,UAAU,qBAAqB;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAOD,KAAK,yBAAyB,GAAG,sBAAsB,GAAG;IACxD,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC,CAAC;AA8SF,wBAAsB,eAAe,CACnC,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,SAAS,EAClB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAC/B,OAAO,CAAC;IAAE,QAAQ,EAAE,yBAAyB,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAyG1E;AAsMD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,2BAiBpE;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAChC,MAAM,CAAC,EAAE,MAAM,2BAiBhB;AAED,wBA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M,EAAE,SAAS,CAAC,EAChC,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC;IACT,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC,CAwBD;AAsMD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,2BAiBpE;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAChC,MAAM,CAAC,EAAE,MAAM,2BAiBhB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAChC,MAAM,CAAC,EAAE,MAAM,2BAqBhB;AAsPD,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,UAQjD;AAED,wBAAsB,MAAM,CAAC,IAAI,WAAwB,iBAo/BxD"}
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.listTasksForCli = listTasksForCli;
7
+ exports.searchTasksForCli = searchTasksForCli;
7
8
  exports.getTaskUpdatePayload = getTaskUpdatePayload;
8
9
  exports.getTaskDonePayload = getTaskDonePayload;
9
10
  exports.getTaskClosePayload = getTaskClosePayload;
@@ -22,6 +23,7 @@ const help_1 = require("./help");
22
23
  const render_1 = require("./render");
23
24
  const selection_1 = require("./selection");
24
25
  const task_description_1 = require("./task-description");
26
+ const task_templates_1 = require("./task-templates");
25
27
  const tiptap_1 = require("./tiptap");
26
28
  const update_1 = require("./update");
27
29
  const doneActions = new Set(['complete', 'completed', 'done', 'mark-done']);
@@ -29,9 +31,12 @@ const closeActions = new Set(['archive', 'close', 'closed', 'mark-closed']);
29
31
  const DEFAULT_TASK_PAGE_SIZE = 50;
30
32
  const ACTIVE_TASK_LIST_STATUSES = ['not_started', 'active'];
31
33
  const DOCUMENT_TASK_LIST_STATUSES = ['documents'];
34
+ const TASK_TEMPLATE_PRIORITIES = ['critical', 'high', 'normal', 'low'];
35
+ const TASK_TEMPLATE_VISIBILITIES = ['private', 'workspace'];
32
36
  const REVIEW_TASK_LIST_STATUSES = ['review'];
33
37
  const DONE_TASK_LIST_STATUSES = ['review', 'done'];
34
38
  const CLOSED_TASK_LIST_STATUSES = ['closed'];
39
+ const TASK_SEARCH_MODES = ['text', 'semantic', 'hybrid'];
35
40
  const LABEL_COLOR_ALIASES = {
36
41
  amber: '#D97706',
37
42
  blue: '#2563EB',
@@ -112,6 +117,46 @@ function parseNonNegativeInteger(value) {
112
117
  const parsed = Number.parseInt(value, 10);
113
118
  return Number.isFinite(parsed) && parsed >= 0 ? parsed : undefined;
114
119
  }
120
+ function parseTaskSearchMode(flags) {
121
+ const mode = (0, args_1.getFlag)(flags, 'mode') || 'hybrid';
122
+ if (TASK_SEARCH_MODES.includes(mode)) {
123
+ return mode;
124
+ }
125
+ throw new Error('Invalid task search mode. Use text, semantic, or hybrid.');
126
+ }
127
+ function parseTaskSearchPositiveInteger(value, flagName) {
128
+ if (!value)
129
+ return undefined;
130
+ const parsed = Number(value);
131
+ if (Number.isInteger(parsed) && parsed > 0)
132
+ return parsed;
133
+ throw new Error(`${flagName} must be a positive integer.`);
134
+ }
135
+ function parseTaskSearchThreshold(value) {
136
+ if (!value)
137
+ return undefined;
138
+ const parsed = Number(value);
139
+ if (Number.isFinite(parsed) && parsed >= 0 && parsed <= 1) {
140
+ return parsed;
141
+ }
142
+ throw new Error('--threshold must be a number between 0 and 1.');
143
+ }
144
+ function parseTaskTemplatePriority(value) {
145
+ if (!value)
146
+ return undefined;
147
+ if (TASK_TEMPLATE_PRIORITIES.includes(value)) {
148
+ return value;
149
+ }
150
+ throw new Error('Invalid task template priority. Use critical, high, normal, or low.');
151
+ }
152
+ function parseTaskTemplateVisibility(value) {
153
+ if (!value)
154
+ return undefined;
155
+ if (TASK_TEMPLATE_VISIBILITIES.includes(value)) {
156
+ return value;
157
+ }
158
+ throw new Error('Invalid task template visibility. Use private or workspace.');
159
+ }
115
160
  function getTaskPagination(flags) {
116
161
  const limit = parsePositiveInteger((0, args_1.getFlag)(flags, 'limit')) ??
117
162
  parsePositiveInteger((0, args_1.getFlag)(flags, 'page-size')) ??
@@ -212,6 +257,23 @@ function getCliTaskListOptions(flags) {
212
257
  q: (0, args_1.getFlag)(flags, 'q'),
213
258
  };
214
259
  }
260
+ function getCliTaskSearchPayload(flags, positionals) {
261
+ const query = (0, args_1.getFlag)(flags, 'query') ||
262
+ (0, args_1.getFlag)(flags, 'q') ||
263
+ positionals.slice(2).join(' ');
264
+ const trimmedQuery = query.trim();
265
+ if (!trimmedQuery) {
266
+ throw new Error('Missing search query. Use `ttr tasks search <query>` or --query.');
267
+ }
268
+ const matchCount = parseTaskSearchPositiveInteger((0, args_1.getFlag)(flags, 'match-count') || (0, args_1.getFlag)(flags, 'limit'), '--match-count');
269
+ const matchThreshold = parseTaskSearchThreshold((0, args_1.getFlag)(flags, 'match-threshold') || (0, args_1.getFlag)(flags, 'threshold'));
270
+ return {
271
+ ...(matchCount !== undefined ? { matchCount } : {}),
272
+ ...(matchThreshold !== undefined ? { matchThreshold } : {}),
273
+ mode: parseTaskSearchMode(flags),
274
+ query: trimmedQuery,
275
+ };
276
+ }
215
277
  function getTaskListStatus(task) {
216
278
  const taskWithRelations = task;
217
279
  return (task.source_list_status ?? taskWithRelations.task_lists?.status ?? null);
@@ -328,6 +390,29 @@ async function listTasksForCli(client, _config, workspaceId, flags) {
328
390
  workspaceName,
329
391
  };
330
392
  }
393
+ async function searchTasksForCli(client, _config, workspaceId, flags, positionals) {
394
+ const payload = getCliTaskSearchPayload(flags, positionals);
395
+ const workspaces = await client.workspaces.list();
396
+ const requestedWorkspace = resolveWorkspace(workspaceId, workspaces);
397
+ const personalWorkspace = workspaces.find((workspace) => workspace.personal);
398
+ const currentWorkspace = shouldUseDefaultPersonalTaskScope(flags) && personalWorkspace
399
+ ? personalWorkspace
400
+ : requestedWorkspace;
401
+ const effectiveWorkspaceId = currentWorkspace?.id ?? workspaceId;
402
+ const workspaceName = currentWorkspace?.name || workspaceId;
403
+ const response = await client.tasks.search(effectiveWorkspaceId, payload);
404
+ return {
405
+ response: {
406
+ ...response,
407
+ tasks: response.tasks.map((task) => ({
408
+ ...task,
409
+ workspace_id: effectiveWorkspaceId,
410
+ workspace_name: workspaceName,
411
+ })),
412
+ },
413
+ workspaceName,
414
+ };
415
+ }
331
416
  function getClient(config) {
332
417
  if (!config.session?.accessToken || !config.session.refreshToken) {
333
418
  throw new Error('Not logged in. Run `ttr login` first.');
@@ -512,6 +597,113 @@ function getTaskClosePayload(flags, listId) {
512
597
  }
513
598
  return payload;
514
599
  }
600
+ function getTaskTemplatePayloadFromFlags(flags, fallbackName) {
601
+ const payload = getPayload(flags);
602
+ const priority = parseTaskTemplatePriority((0, args_1.getFlag)(flags, 'priority'));
603
+ const visibility = parseTaskTemplateVisibility((0, args_1.getFlag)(flags, 'visibility'));
604
+ const name = (0, args_1.getFlag)(flags, 'name') || (0, args_1.getFlag)(flags, 'template-name') || fallbackName;
605
+ const taskName = (0, args_1.getFlag)(flags, 'title') || (0, args_1.getFlag)(flags, 'task-name') || fallbackName;
606
+ return {
607
+ ...payload,
608
+ ...((0, args_1.getFlag)(flags, 'assignees')
609
+ ? { assignee_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'assignees')) }
610
+ : {}),
611
+ ...((0, args_1.getFlag)(flags, 'board') || (0, args_1.getFlag)(flags, 'board-id')
612
+ ? {
613
+ default_board_id: (0, args_1.getFlag)(flags, 'board') || (0, args_1.getFlag)(flags, 'board-id'),
614
+ }
615
+ : {}),
616
+ ...((0, args_1.getFlag)(flags, 'description')
617
+ ? { description: (0, args_1.getFlag)(flags, 'description') }
618
+ : {}),
619
+ ...((0, args_1.getFlag)(flags, 'end-date')
620
+ ? { end_date: (0, args_1.getFlag)(flags, 'end-date') }
621
+ : {}),
622
+ ...((0, args_1.getFlag)(flags, 'estimate') || (0, args_1.getFlag)(flags, 'estimation-points')
623
+ ? {
624
+ estimation_points: Number((0, args_1.getFlag)(flags, 'estimate') || (0, args_1.getFlag)(flags, 'estimation-points')),
625
+ }
626
+ : {}),
627
+ ...((0, args_1.getFlag)(flags, 'key') || (0, args_1.getFlag)(flags, 'slug')
628
+ ? { key: (0, args_1.getFlag)(flags, 'key') || (0, args_1.getFlag)(flags, 'slug') }
629
+ : {}),
630
+ ...((0, args_1.getFlag)(flags, 'labels')
631
+ ? { label_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'labels')) }
632
+ : {}),
633
+ ...((0, args_1.getFlag)(flags, 'list') || (0, args_1.getFlag)(flags, 'list-id')
634
+ ? { default_list_id: (0, args_1.getFlag)(flags, 'list') || (0, args_1.getFlag)(flags, 'list-id') }
635
+ : {}),
636
+ ...(name ? { name } : {}),
637
+ ...(priority ? { priority } : {}),
638
+ ...((0, args_1.getFlag)(flags, 'projects')
639
+ ? { project_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'projects')) }
640
+ : {}),
641
+ ...((0, args_1.getFlag)(flags, 'start-date')
642
+ ? { start_date: (0, args_1.getFlag)(flags, 'start-date') }
643
+ : {}),
644
+ ...(taskName ? { task_name: taskName } : {}),
645
+ ...(visibility ? { visibility } : {}),
646
+ };
647
+ }
648
+ function getTaskTemplateCreateOverrides(flags, listId, fallbackName) {
649
+ const payload = getPayload(flags);
650
+ const priority = parseTaskTemplatePriority((0, args_1.getFlag)(flags, 'priority'));
651
+ return {
652
+ ...payload,
653
+ ...((0, args_1.getFlag)(flags, 'assignees')
654
+ ? { assignee_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'assignees')) }
655
+ : {}),
656
+ ...((0, args_1.getFlag)(flags, 'end-date')
657
+ ? { end_date: (0, args_1.getFlag)(flags, 'end-date') }
658
+ : {}),
659
+ ...((0, args_1.getFlag)(flags, 'description')
660
+ ? { description: (0, args_1.getFlag)(flags, 'description') }
661
+ : {}),
662
+ ...((0, args_1.getFlag)(flags, 'estimate') || (0, args_1.getFlag)(flags, 'estimation-points')
663
+ ? {
664
+ estimation_points: Number((0, args_1.getFlag)(flags, 'estimate') || (0, args_1.getFlag)(flags, 'estimation-points')),
665
+ }
666
+ : {}),
667
+ ...((0, args_1.getFlag)(flags, 'labels')
668
+ ? { label_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'labels')) }
669
+ : {}),
670
+ listId,
671
+ ...((0, args_1.getFlag)(flags, 'name') || fallbackName
672
+ ? { name: (0, args_1.getFlag)(flags, 'name') || fallbackName }
673
+ : {}),
674
+ ...(priority ? { priority } : {}),
675
+ ...((0, args_1.getFlag)(flags, 'projects')
676
+ ? { project_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'projects')) }
677
+ : {}),
678
+ ...((0, args_1.getFlag)(flags, 'start-date')
679
+ ? { start_date: (0, args_1.getFlag)(flags, 'start-date') }
680
+ : {}),
681
+ };
682
+ }
683
+ async function createTaskFromLocalTemplate({ client, flags, listId, reference, workspaceId, }) {
684
+ const localTemplate = (0, task_templates_1.parseLocalTaskTemplateFile)((0, task_templates_1.resolveLocalTaskTemplatePath)(reference));
685
+ const overrides = getTaskTemplateCreateOverrides(flags, listId);
686
+ const hasDescriptionOverride = Object.hasOwn(overrides, 'description') ||
687
+ Object.hasOwn(overrides, 'description_yjs_state');
688
+ return client.tasks.create(workspaceId, {
689
+ assignee_ids: localTemplate.payload.assignee_ids ?? [],
690
+ description: localTemplate.payload.description ?? null,
691
+ description_yjs_state: hasDescriptionOverride
692
+ ? null
693
+ : (localTemplate.payload.description_yjs_state ?? null),
694
+ end_date: localTemplate.payload.end_date ?? null,
695
+ estimation_points: localTemplate.payload.estimation_points ?? null,
696
+ label_ids: localTemplate.payload.label_ids ?? [],
697
+ name: typeof overrides.name === 'string'
698
+ ? overrides.name
699
+ : (localTemplate.payload.task_name ?? localTemplate.payload.name),
700
+ priority: localTemplate.payload.priority ?? null,
701
+ project_ids: localTemplate.payload.project_ids ?? [],
702
+ start_date: localTemplate.payload.start_date ?? null,
703
+ ...overrides,
704
+ listId,
705
+ });
706
+ }
515
707
  async function getDefaultStatusListId({ client, config, flags, json, status, taskId, workspaceId, }) {
516
708
  const explicitListId = (0, args_1.getFlag)(flags, 'list') || (0, args_1.getFlag)(flags, 'list-id');
517
709
  if (explicitListId) {
@@ -855,6 +1047,122 @@ async function runCli(argv = process.argv.slice(2)) {
855
1047
  return;
856
1048
  }
857
1049
  }
1050
+ if (group === 'task-templates') {
1051
+ if (action === 'list') {
1052
+ if (flags.local === true) {
1053
+ const localTemplates = (0, task_templates_1.listLocalTaskTemplates)().map((template) => ({
1054
+ path: template.path,
1055
+ ...template.payload,
1056
+ }));
1057
+ (0, render_1.render)(localTemplates, { group, json });
1058
+ return;
1059
+ }
1060
+ const payload = await client.tasks.listTemplates(workspaceId, {
1061
+ includeArchived: flags.all === true || flags.archived === true,
1062
+ q: (0, args_1.getFlag)(flags, 'q'),
1063
+ visibility: (0, args_1.getFlag)(flags, 'visibility'),
1064
+ });
1065
+ (0, render_1.render)(json ? payload : payload.templates, { group, json });
1066
+ return;
1067
+ }
1068
+ if (action === 'show' || action === 'get') {
1069
+ if (!firstId)
1070
+ throw new Error('Missing task template key.');
1071
+ if (flags.local === true || (0, task_templates_1.isLocalTaskTemplateReference)(firstId)) {
1072
+ (0, render_1.render)((0, task_templates_1.parseLocalTaskTemplateFile)((0, task_templates_1.resolveLocalTaskTemplatePath)(firstId)), {
1073
+ group,
1074
+ json,
1075
+ });
1076
+ return;
1077
+ }
1078
+ (0, render_1.render)(await client.tasks.getTemplate(workspaceId, firstId), {
1079
+ group,
1080
+ json,
1081
+ });
1082
+ return;
1083
+ }
1084
+ if (action === 'create') {
1085
+ const payload = getTaskTemplatePayloadFromFlags(flags, positionalValue || 'Untitled Template');
1086
+ if (flags.local === true || (0, args_1.getFlag)(flags, 'file')) {
1087
+ const file = (0, args_1.getFlag)(flags, 'file') ||
1088
+ (0, task_templates_1.resolveLocalTaskTemplatePath)(String((0, args_1.getFlag)(flags, 'key') || (0, args_1.getFlag)(flags, 'slug') || payload.name));
1089
+ const path = (0, task_templates_1.writeLocalTaskTemplate)(file, payload);
1090
+ (0, render_1.render)({ path, template: payload }, { group, json });
1091
+ return;
1092
+ }
1093
+ (0, render_1.render)(await client.tasks.createTemplate(workspaceId, payload), {
1094
+ group,
1095
+ json,
1096
+ });
1097
+ return;
1098
+ }
1099
+ if (action === 'update') {
1100
+ if (!firstId)
1101
+ throw new Error('Missing task template key.');
1102
+ (0, render_1.render)(await client.tasks.updateTemplate(workspaceId, firstId, getTaskTemplatePayloadFromFlags(flags)), { group, json });
1103
+ return;
1104
+ }
1105
+ if (action === 'delete' || action === 'archive') {
1106
+ if (!firstId)
1107
+ throw new Error('Missing task template key.');
1108
+ (0, render_1.render)(await client.tasks.deleteTemplate(workspaceId, firstId, {
1109
+ permanent: flags.permanent === true,
1110
+ }), { group, json });
1111
+ return;
1112
+ }
1113
+ if (action === 'use') {
1114
+ if (!firstId)
1115
+ throw new Error('Missing task template key or file.');
1116
+ const listSelection = await (0, selection_1.selectListId)(client, config, workspaceId, flags, json);
1117
+ config = listSelection.config;
1118
+ if (flags.local === true || (0, task_templates_1.isLocalTaskTemplateReference)(firstId)) {
1119
+ (0, render_1.render)(await createTaskFromLocalTemplate({
1120
+ client,
1121
+ flags,
1122
+ listId: listSelection.listId,
1123
+ reference: firstId,
1124
+ workspaceId,
1125
+ }), { group: 'tasks', json });
1126
+ return;
1127
+ }
1128
+ (0, render_1.render)(await client.tasks.useTemplate(workspaceId, firstId, getTaskTemplateCreateOverrides(flags, listSelection.listId, (0, args_1.getFlag)(flags, 'name'))), { group: 'tasks', json });
1129
+ return;
1130
+ }
1131
+ if (action === 'import') {
1132
+ if (!firstId)
1133
+ throw new Error('Missing local task template file.');
1134
+ const localTemplate = (0, task_templates_1.parseLocalTaskTemplateFile)((0, task_templates_1.resolveLocalTaskTemplatePath)(firstId));
1135
+ (0, render_1.render)(await client.tasks.createTemplate(workspaceId, {
1136
+ ...localTemplate.payload,
1137
+ ...getTaskTemplatePayloadFromFlags(flags),
1138
+ }), { group, json });
1139
+ return;
1140
+ }
1141
+ if (action === 'export') {
1142
+ if (!firstId)
1143
+ throw new Error('Missing task template key.');
1144
+ const { template } = await client.tasks.getTemplate(workspaceId, firstId);
1145
+ const file = (0, args_1.getFlag)(flags, 'file');
1146
+ if (file) {
1147
+ const path = (0, task_templates_1.writeLocalTaskTemplate)(file, template);
1148
+ (0, render_1.render)({ path, template }, { group, json });
1149
+ return;
1150
+ }
1151
+ process.stdout.write((0, task_templates_1.taskTemplateToMarkdown)(template));
1152
+ return;
1153
+ }
1154
+ if (action === 'save-from-task') {
1155
+ const taskId = firstId || (0, args_1.getFlag)(flags, 'task') || (0, args_1.getFlag)(flags, 'task-id');
1156
+ if (!taskId)
1157
+ throw new Error('Missing task id.');
1158
+ (0, render_1.render)(await client.tasks.saveTemplateFromTask(workspaceId, {
1159
+ name: (0, args_1.getFlag)(flags, 'name') || (0, args_1.getFlag)(flags, 'template-name'),
1160
+ taskId,
1161
+ visibility: (0, args_1.getFlag)(flags, 'visibility') || 'private',
1162
+ }), { group, json });
1163
+ return;
1164
+ }
1165
+ }
858
1166
  if (group === 'tasks') {
859
1167
  if (action === 'description' ||
860
1168
  action === 'descriptions' ||
@@ -880,6 +1188,19 @@ async function runCli(argv = process.argv.slice(2)) {
880
1188
  });
881
1189
  return;
882
1190
  }
1191
+ if (action === 'search') {
1192
+ const { response: taskResponse, workspaceName } = await searchTasksForCli(client, config, workspaceId, flags, positionals);
1193
+ (0, render_1.render)(taskResponse, {
1194
+ compact: flags.compact === true,
1195
+ currentWorkspaceId: workspaceId,
1196
+ group,
1197
+ json,
1198
+ preserveTaskOrder: true,
1199
+ showTaskScore: true,
1200
+ workspaceName,
1201
+ });
1202
+ return;
1203
+ }
883
1204
  if (action === 'use' || action === 'select') {
884
1205
  const selection = await (0, selection_1.selectTaskId)(client, config, workspaceId, flags, json, firstId);
885
1206
  config = selection.config;
@@ -898,8 +1219,40 @@ async function runCli(argv = process.argv.slice(2)) {
898
1219
  if (action === 'create') {
899
1220
  const listSelection = await (0, selection_1.selectListId)(client, config, workspaceId, flags, json);
900
1221
  config = listSelection.config;
1222
+ const templateReference = (0, args_1.getFlag)(flags, 'template');
901
1223
  const descriptionPayload = await (0, task_description_1.getTaskDescriptionPayloadFromFlags)(flags);
902
1224
  const chunkDescriptionAfterCreate = (0, task_description_1.shouldUseChunkedTaskDescriptionUpdate)(descriptionPayload);
1225
+ if (templateReference) {
1226
+ const createOverrides = {
1227
+ ...getTaskTemplateCreateOverrides(flags, listSelection.listId, positionalValue),
1228
+ ...(descriptionPayload && !chunkDescriptionAfterCreate
1229
+ ? descriptionPayload
1230
+ : {}),
1231
+ };
1232
+ const response = flags.local === true ||
1233
+ (0, task_templates_1.isLocalTaskTemplateReference)(templateReference)
1234
+ ? await createTaskFromLocalTemplate({
1235
+ client,
1236
+ flags,
1237
+ listId: listSelection.listId,
1238
+ reference: templateReference,
1239
+ workspaceId,
1240
+ })
1241
+ : await client.tasks.useTemplate(workspaceId, templateReference, createOverrides);
1242
+ if (descriptionPayload &&
1243
+ (chunkDescriptionAfterCreate ||
1244
+ flags.local === true ||
1245
+ (0, task_templates_1.isLocalTaskTemplateReference)(templateReference))) {
1246
+ await (0, task_description_1.updateTaskDescriptionWithBestTransport)({
1247
+ client,
1248
+ payload: descriptionPayload,
1249
+ taskId: response.task.id,
1250
+ workspaceId,
1251
+ });
1252
+ }
1253
+ (0, render_1.render)(response, { group, json });
1254
+ return;
1255
+ }
903
1256
  const createPayload = {
904
1257
  assignee_ids: (0, args_1.parseCsv)((0, args_1.getFlag)(flags, 'assignees')),
905
1258
  end_date: (0, args_1.getFlag)(flags, 'end-date') || null,