@tasklumina/cli 1.0.2 → 1.1.0

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.
Files changed (2) hide show
  1. package/dist/index.js +28 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2185,20 +2185,43 @@ colorRulesCommand.command("remove").description("Remove a color rule").argument(
2185
2185
  // src/commands/lists.ts
2186
2186
  import { Command as Command9 } from "commander";
2187
2187
  import { confirm as confirm6 } from "@inquirer/prompts";
2188
- var listsCommand = new Command9("lists").description("Manage lists").action(async () => {
2188
+ var SORT_FIELDS = ["name", "created", "updated", "items"];
2189
+ function sortLists(lists, sort, reverse) {
2190
+ const sorted = [...lists].sort((a, b) => {
2191
+ switch (sort) {
2192
+ case "name":
2193
+ return a.name.localeCompare(b.name);
2194
+ case "created":
2195
+ return b.createdAt.localeCompare(a.createdAt);
2196
+ case "updated":
2197
+ return b.updatedAt.localeCompare(a.updatedAt);
2198
+ case "items":
2199
+ return b.itemCount - a.itemCount;
2200
+ }
2201
+ });
2202
+ return reverse ? sorted.reverse() : sorted;
2203
+ }
2204
+ var listsCommand = new Command9("lists").description("Manage lists").option("--sort <field>", "Sort by: name, created, updated, items (default: created)").option("--reverse", "Reverse sort order").action(async (opts) => {
2189
2205
  try {
2206
+ const sort = opts.sort && SORT_FIELDS.includes(opts.sort) ? opts.sort : "created";
2207
+ if (opts.sort && !SORT_FIELDS.includes(opts.sort)) {
2208
+ printError(`Invalid sort field: ${opts.sort}. Valid: ${SORT_FIELDS.join(", ")}`);
2209
+ process.exitCode = 1;
2210
+ return;
2211
+ }
2190
2212
  const data = await graphql(listLists);
2213
+ const lists = sortLists(data.listLists, sort, !!opts.reverse);
2191
2214
  if (isJsonMode()) {
2192
- printJson(data.listLists);
2215
+ printJson(lists);
2193
2216
  return;
2194
2217
  }
2195
- if (data.listLists.length === 0) {
2218
+ if (lists.length === 0) {
2196
2219
  console.log("No lists.");
2197
2220
  return;
2198
2221
  }
2199
2222
  printTable(
2200
2223
  ["ID", "Name", "Items", "Created"],
2201
- data.listLists.map((l) => [truncateId(l.id), l.name, String(l.itemCount), formatDate(l.createdAt)])
2224
+ lists.map((l) => [truncateId(l.id), l.name, String(l.itemCount), formatDate(l.createdAt)])
2202
2225
  );
2203
2226
  } catch (err) {
2204
2227
  printError(err.message);
@@ -2888,7 +2911,7 @@ apikeysCommand.command("revoke").description("Revoke an API key").argument("<id>
2888
2911
 
2889
2912
  // src/index.ts
2890
2913
  var program = new Command13();
2891
- program.name("tasklumina").version("1.0.0").description("Task Lumina CLI \u2014 manage tasks from the terminal").option("--json", "Output as JSON").option("--no-color", "Disable colored output").option("--verbose", "Show detailed request info (endpoint masked)").option("--redact", "Mask emails and sensitive data in output");
2914
+ program.name("tasklumina").version("1.0.3").description("Task Lumina CLI \u2014 manage tasks from the terminal").option("--json", "Output as JSON").option("--no-color", "Disable colored output").option("--verbose", "Show detailed request info (endpoint masked)").option("--redact", "Mask emails and sensitive data in output");
2892
2915
  program.hook("postAction", async () => {
2893
2916
  await maybeAutoRotate();
2894
2917
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tasklumina/cli",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Task Lumina CLI — manage tasks, notes, categories, and shares from the terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",