pm-csv 0.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 - 2026-05-26
4
+
5
+ ### Other
6
+
7
+ - Release readiness hardening for pm-csv ([pm-csv-1pty](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/tasks/pm-csv-1pty.toon))
package/README.md ADDED
@@ -0,0 +1,187 @@
1
+ # pm-csv
2
+
3
+ CSV importer and exporter for [pm-cli](https://github.com/unbraind/pm-cli).
4
+
5
+ Import pm items from a CSV file, export them back out, or wire up a programmatic `csv-import` importer — all with zero external runtime dependencies.
6
+
7
+ ---
8
+
9
+ ## Installation
10
+
11
+ Add the extension to your pm-cli config:
12
+
13
+ ```jsonc
14
+ // pm-config.json (or wherever your pm-cli extensions are configured)
15
+ {
16
+ "extensions": [
17
+ { "path": "/path/to/pm-csv" }
18
+ ]
19
+ }
20
+ ```
21
+
22
+ Build the extension before use:
23
+
24
+ ```bash
25
+ npm install
26
+ npm run build
27
+ ```
28
+
29
+ The compiled entry point is `dist/index.js`, which is referenced by `manifest.json` as `"entry": "index.js"` — ensure your pm-cli host resolves it relative to the `dist/` directory, or adjust `manifest.json` to point at `dist/index.js` if needed.
30
+
31
+ ---
32
+
33
+ ## Commands
34
+
35
+ ### `pm csv import <file>`
36
+
37
+ Read a CSV file and create or update pm items.
38
+
39
+ ```
40
+ pm csv import tasks.csv
41
+ pm csv import backlog.csv --delimiter ';'
42
+ pm csv import items.csv --dry-run
43
+ ```
44
+
45
+ **Flags**
46
+
47
+ | Flag | Type | Default | Description |
48
+ |---|---|---|---|
49
+ | `--delimiter <char>` | string | `,` | CSV field delimiter |
50
+ | `--dry-run` | boolean | false | Preview what would be imported without writing any data |
51
+
52
+ **Required column:** `title`
53
+
54
+ **Optional columns:** `type`, `status`, `priority`, `tags`, `milestone`, `due_date`, `body`
55
+
56
+ ---
57
+
58
+ ### `pm csv export`
59
+
60
+ Export all pm items (or a filtered subset) to CSV. Without `--output` the CSV is returned in the command result object.
61
+
62
+ ```
63
+ pm csv export
64
+ pm csv export --output items.csv
65
+ pm csv export --output backlog.csv --delimiter ';'
66
+ pm csv export --status todo --output todos.csv
67
+ pm csv export --type Feature --output features.csv
68
+ ```
69
+
70
+ **Flags**
71
+
72
+ | Flag | Type | Default | Description |
73
+ |---|---|---|---|
74
+ | `--output <file>` | string | — | Write CSV to this file path instead of returning it |
75
+ | `--delimiter <char>` | string | `,` | CSV field delimiter |
76
+ | `--status <status>` | string | — | Filter: `todo`, `wip`, `done`, `blocked` |
77
+ | `--type <type>` | string | — | Filter by item type |
78
+
79
+ **Export columns (fixed order):**
80
+ `id, title, type, status, priority, tags, milestone, due_date, body, created_at, updated_at`
81
+
82
+ ---
83
+
84
+ ## Programmatic importer: `csv-import`
85
+
86
+ Register the importer in your pm-cli config to automatically pull from a CSV file on every sync:
87
+
88
+ ```jsonc
89
+ {
90
+ "importers": [
91
+ {
92
+ "name": "csv-import",
93
+ "config": {
94
+ "file": "./data/items.csv",
95
+ "delimiter": ","
96
+ }
97
+ }
98
+ ]
99
+ }
100
+ ```
101
+
102
+ **Config options**
103
+
104
+ | Key | Type | Required | Description |
105
+ |---|---|---|---|
106
+ | `file` | string | yes | Path to the CSV file to import |
107
+ | `delimiter` | string | no (default `,`) | CSV field delimiter |
108
+
109
+ ---
110
+
111
+ ## CSV Format
112
+
113
+ ### Import format
114
+
115
+ The first row must be a header row. Column names are **case-insensitive**. Column order does not matter. Only `title` is required.
116
+
117
+ ```csv
118
+ title,type,status,priority,tags,milestone,due_date,body
119
+ "Add login page",Feature,open,2,"auth,ui",v1.0,2026-05-30,"Landing page with email+password login"
120
+ "Fix navbar bug",Issue,in_progress,1,"bug,ui",,,"Navbar collapses on mobile Safari"
121
+ "Write API docs",Task,todo,3,docs,,,
122
+ ```
123
+
124
+ ### Column reference
125
+
126
+ | Column | Description | Notes |
127
+ |---|---|---|
128
+ | `title` | Item title | **Required** |
129
+ | `type` | Item type | Any string, e.g. `Feature`, `Bug`, `Task` |
130
+ | `status` | Item status | See status mapping below |
131
+ | `priority` | Numeric priority | Integer |
132
+ | `tags` | Comma-separated tags | Quote the field if tags contain commas |
133
+ | `milestone` | Milestone name | Any string |
134
+ | `due_date` | Due date | ISO 8601 format recommended, e.g. `2026-05-30` |
135
+ | `body` | Description / body text | Supports multiline when quoted |
136
+
137
+ ### Status mapping
138
+
139
+ The importer accepts common status strings and maps them to pm-cli statuses:
140
+
141
+ | Input values | pm-cli status |
142
+ |---|---|
143
+ | `todo`, `open`, `new` | `todo` |
144
+ | `done`, `closed`, `complete`, `completed` | `done` |
145
+ | `wip`, `in_progress`, `in progress`, `doing` | `wip` |
146
+ | `blocked`, `on_hold`, `on hold` | `blocked` |
147
+
148
+ Unrecognized values default to `todo`.
149
+
150
+ ### Export format
151
+
152
+ Exports use the same CSV format and can be re-imported:
153
+
154
+ ```csv
155
+ id,title,type,status,priority,tags,milestone,due_date,body,created_at,updated_at
156
+ item-abc123,Add login page,Feature,todo,2,"auth,ui",v1.0,2026-05-30,Landing page with email+password login,2026-05-01T10:00:00Z,2026-05-09T12:00:00Z
157
+ ```
158
+
159
+ ---
160
+
161
+ ## CSV parsing rules
162
+
163
+ - Fields containing the delimiter, double-quotes, or newlines must be wrapped in double-quotes.
164
+ - Embedded double-quotes inside a quoted field are escaped by doubling them: `""`.
165
+ - Multiline field values (newlines inside quotes) are fully supported.
166
+ - Both `\n` (LF) and `\r\n` (CRLF) line endings are accepted on import.
167
+
168
+ ---
169
+
170
+ ## Building
171
+
172
+ ```bash
173
+ npm install
174
+ npm run build # runs tsc → dist/
175
+ ```
176
+
177
+ TypeScript 5, ES2022 target, NodeNext module resolution, strict mode. Zero runtime dependencies.
178
+
179
+ ---
180
+
181
+ ## License
182
+
183
+ MIT
184
+
185
+ ## Release Automation
186
+
187
+ This package is release-ready for GitHub, npm, and Bun-compatible installs. CI runs type checking, build, production dependency audit, package packing, Bun install verification, and pm-changelog validation. The daily release workflow publishes only when commits exist after the latest release tag and uses pm-changelog to generate CHANGELOG.md and GitHub release notes.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,465 @@
1
+ import { readFileSync, writeFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { spawnSync } from "node:child_process";
4
+ const defineExtension = ((extension) => extension);
5
+ // Columns accepted on import (order independent — driven by header row)
6
+ const IMPORT_COLUMNS = [
7
+ "title",
8
+ "type",
9
+ "status",
10
+ "priority",
11
+ "tags",
12
+ "milestone",
13
+ "due_date",
14
+ "body",
15
+ ];
16
+ // Columns written on export (fixed order)
17
+ const EXPORT_COLUMNS = [
18
+ "id",
19
+ "title",
20
+ "type",
21
+ "status",
22
+ "priority",
23
+ "tags",
24
+ "milestone",
25
+ "due_date",
26
+ "body",
27
+ "created_at",
28
+ "updated_at",
29
+ ];
30
+ // ---------------------------------------------------------------------------
31
+ // CSV parser — no external dependencies
32
+ // ---------------------------------------------------------------------------
33
+ /**
34
+ * Parse a full CSV string into rows of string arrays.
35
+ * Handles:
36
+ * - Quoted fields (double-quotes), including embedded newlines inside quotes
37
+ * - Escaped quotes ("" inside a quoted field → single ")
38
+ * - Custom delimiter
39
+ * - CRLF and LF line endings
40
+ */
41
+ function parseCSV(text, delimiter = ",") {
42
+ const rows = [];
43
+ let row = [];
44
+ let field = "";
45
+ let inQuotes = false;
46
+ let i = 0;
47
+ while (i < text.length) {
48
+ const ch = text[i];
49
+ if (inQuotes) {
50
+ if (ch === '"') {
51
+ // Peek ahead: "" means escaped quote
52
+ if (text[i + 1] === '"') {
53
+ field += '"';
54
+ i += 2;
55
+ continue;
56
+ }
57
+ // Closing quote
58
+ inQuotes = false;
59
+ i++;
60
+ continue;
61
+ }
62
+ // Any other character (including newlines) inside quotes
63
+ field += ch;
64
+ i++;
65
+ continue;
66
+ }
67
+ // Not in quotes
68
+ if (ch === '"') {
69
+ inQuotes = true;
70
+ i++;
71
+ continue;
72
+ }
73
+ if (ch === delimiter) {
74
+ row.push(field);
75
+ field = "";
76
+ i++;
77
+ continue;
78
+ }
79
+ if (ch === "\r" && text[i + 1] === "\n") {
80
+ row.push(field);
81
+ field = "";
82
+ rows.push(row);
83
+ row = [];
84
+ i += 2;
85
+ continue;
86
+ }
87
+ if (ch === "\n") {
88
+ row.push(field);
89
+ field = "";
90
+ rows.push(row);
91
+ row = [];
92
+ i++;
93
+ continue;
94
+ }
95
+ field += ch;
96
+ i++;
97
+ }
98
+ // Flush last field / row
99
+ if (field !== "" || row.length > 0) {
100
+ row.push(field);
101
+ rows.push(row);
102
+ }
103
+ return rows;
104
+ }
105
+ /**
106
+ * Serialize a single field value for CSV output.
107
+ * Wraps in double-quotes when the value contains the delimiter, quotes, or newlines.
108
+ */
109
+ function serializeField(value, delimiter) {
110
+ const needsQuoting = value.includes(delimiter) ||
111
+ value.includes('"') ||
112
+ value.includes("\n") ||
113
+ value.includes("\r");
114
+ if (!needsQuoting)
115
+ return value;
116
+ // Escape embedded double-quotes by doubling them
117
+ return `"${value.replace(/"/g, '""')}"`;
118
+ }
119
+ /**
120
+ * Serialize a full array of rows into a CSV string.
121
+ */
122
+ function serializeCSV(rows, delimiter) {
123
+ return rows
124
+ .map((row) => row.map((f) => serializeField(f, delimiter)).join(delimiter))
125
+ .join("\n");
126
+ }
127
+ // ---------------------------------------------------------------------------
128
+ // Helpers
129
+ // ---------------------------------------------------------------------------
130
+ /**
131
+ * Map an arbitrary status string (from the CSV) to a valid SDK status.
132
+ * Falls back to "open".
133
+ */
134
+ function normalizeStatus(raw) {
135
+ const s = raw.trim().toLowerCase();
136
+ const map = {
137
+ open: "open",
138
+ todo: "open",
139
+ new: "open",
140
+ in_progress: "in_progress",
141
+ wip: "in_progress",
142
+ "in progress": "in_progress",
143
+ doing: "in_progress",
144
+ blocked: "blocked",
145
+ on_hold: "blocked",
146
+ "on hold": "blocked",
147
+ closed: "closed",
148
+ done: "closed",
149
+ complete: "closed",
150
+ completed: "closed",
151
+ canceled: "canceled",
152
+ cancelled: "canceled",
153
+ draft: "draft",
154
+ };
155
+ return map[s] ?? "open";
156
+ }
157
+ /**
158
+ * Parse a comma-separated tags string into an array, stripping whitespace.
159
+ */
160
+ function parseTags(raw) {
161
+ if (!raw.trim())
162
+ return [];
163
+ return raw.split(",").map((t) => t.trim()).filter(Boolean);
164
+ }
165
+ /**
166
+ * Stringify a tags array back to a semicolon-free comma-separated string
167
+ * (safe to embed in a single CSV field).
168
+ */
169
+ function stringifyTags(tags) {
170
+ if (!tags || tags.length === 0)
171
+ return "";
172
+ return tags.join(",");
173
+ }
174
+ /**
175
+ * Read rows from a CSV file, returning header and data rows separately.
176
+ * Skips fully-empty rows.
177
+ */
178
+ function readCSVFile(filePath, delimiter) {
179
+ const text = readFileSync(filePath, "utf-8");
180
+ const rows = parseCSV(text, delimiter).filter((r) => r.some((f) => f.trim() !== ""));
181
+ if (rows.length === 0) {
182
+ return { headers: [], dataRows: [] };
183
+ }
184
+ const headers = rows[0].map((h) => h.trim().toLowerCase());
185
+ const dataRows = rows.slice(1);
186
+ return { headers, dataRows };
187
+ }
188
+ // ---------------------------------------------------------------------------
189
+ // Extension
190
+ // ---------------------------------------------------------------------------
191
+ defineExtension({
192
+ name: "pm-csv",
193
+ version: "0.1.0",
194
+ activate(api) {
195
+ // -----------------------------------------------------------------------
196
+ // Command: pm csv import <file>
197
+ // -----------------------------------------------------------------------
198
+ api.registerCommand({
199
+ name: "csv import",
200
+ description: "Import pm items from a CSV file. " +
201
+ "Expected columns: title, type, status, priority, tags, milestone, due_date, body. " +
202
+ "Only 'title' is required; all other columns are optional.",
203
+ intent: "import items from a CSV file into pm",
204
+ examples: [
205
+ "pm csv import tasks.csv",
206
+ "pm csv import backlog.csv --delimiter ';'",
207
+ "pm csv import items.csv --dry-run",
208
+ ],
209
+ flags: [
210
+ { long: "--delimiter", value_name: "char", description: "CSV field delimiter (default: ,)" },
211
+ { long: "--dry-run", description: "Preview without writing" },
212
+ ],
213
+ async run(ctx) {
214
+ const filePath = ctx.args[0];
215
+ if (!filePath) {
216
+ console.error("Usage: pm csv import <file> [--delimiter <char>] [--dry-run]");
217
+ return { error: "No file path provided" };
218
+ }
219
+ const delimiter = ctx.options["delimiter"] ?? ",";
220
+ const dryRun = Boolean(ctx.options["dry-run"]);
221
+ const absolutePath = resolve(filePath);
222
+ console.error(`Reading CSV from: ${absolutePath}`);
223
+ let headers;
224
+ let dataRows;
225
+ try {
226
+ ({ headers, dataRows } = readCSVFile(absolutePath, delimiter));
227
+ }
228
+ catch (err) {
229
+ const msg = err instanceof Error ? err.message : String(err);
230
+ console.error(`Failed to read file: ${msg}`);
231
+ return { error: msg };
232
+ }
233
+ if (headers.length === 0) {
234
+ console.error("CSV file is empty or has no headers.");
235
+ return { imported: 0, skipped: 0 };
236
+ }
237
+ // Validate that at minimum 'title' is present
238
+ if (!headers.includes("title")) {
239
+ console.error(`CSV is missing required 'title' column. Found: ${headers.join(", ")}`);
240
+ return { error: "Missing required 'title' column" };
241
+ }
242
+ // Index columns
243
+ const col = (name) => headers.indexOf(name);
244
+ let imported = 0;
245
+ let skipped = 0;
246
+ const previews = [];
247
+ for (let rowIndex = 0; rowIndex < dataRows.length; rowIndex++) {
248
+ const row = dataRows[rowIndex];
249
+ const get = (name) => {
250
+ const idx = col(name);
251
+ return idx >= 0 ? (row[idx] ?? "").trim() : "";
252
+ };
253
+ const title = get("title");
254
+ if (!title) {
255
+ console.error(`Row ${rowIndex + 2}: skipping — 'title' is empty`);
256
+ skipped++;
257
+ continue;
258
+ }
259
+ const rawStatus = get("status");
260
+ const status = rawStatus ? normalizeStatus(rawStatus) : "open";
261
+ const rawPriority = get("priority");
262
+ const priority = rawPriority ? parseInt(rawPriority, 10) : undefined;
263
+ const tags = parseTags(get("tags"));
264
+ const type = get("type") || undefined;
265
+ const milestone = get("milestone") || undefined;
266
+ const due_date = get("due_date") || undefined;
267
+ const body = get("body") || undefined;
268
+ if (dryRun) {
269
+ previews.push({ title, type, status, priority, tags, milestone, due_date, body });
270
+ imported++;
271
+ continue;
272
+ }
273
+ try {
274
+ const spawnArgs = [
275
+ "--path", ctx.pm_root,
276
+ "create",
277
+ "--title", title,
278
+ "--status", status,
279
+ ];
280
+ if (body)
281
+ spawnArgs.push("--body", body);
282
+ if (priority !== undefined && !isNaN(priority))
283
+ spawnArgs.push("--priority", String(priority));
284
+ if (type)
285
+ spawnArgs.push("--type", type);
286
+ if (milestone)
287
+ spawnArgs.push("--milestone", milestone);
288
+ if (due_date)
289
+ spawnArgs.push("--due-date", due_date);
290
+ if (tags.length > 0)
291
+ spawnArgs.push("--tags", tags.join(","));
292
+ const result = spawnSync("pm", spawnArgs, { encoding: "utf-8" });
293
+ if (result.status !== 0) {
294
+ throw new Error(result.stderr || "pm create failed");
295
+ }
296
+ imported++;
297
+ }
298
+ catch (err) {
299
+ const msg = err instanceof Error ? err.message : String(err);
300
+ console.error(`Row ${rowIndex + 2}: create failed — ${msg}`);
301
+ skipped++;
302
+ }
303
+ }
304
+ if (dryRun) {
305
+ console.error(`[dry-run] Would import ${imported} item(s), skip ${skipped} item(s).`);
306
+ return { dryRun: true, wouldImport: imported, wouldSkip: skipped, previews };
307
+ }
308
+ console.error(`Imported ${imported} item(s), skipped ${skipped} item(s).`);
309
+ return { imported, skipped };
310
+ },
311
+ });
312
+ // -----------------------------------------------------------------------
313
+ // Command: pm csv export [--output <file>]
314
+ // -----------------------------------------------------------------------
315
+ api.registerCommand({
316
+ name: "csv export",
317
+ description: "Export pm items to a CSV file (or print to stdout if --output is not given). " +
318
+ `Columns: ${EXPORT_COLUMNS.join(", ")}.`,
319
+ intent: "export pm items to a CSV file",
320
+ examples: [
321
+ "pm csv export",
322
+ "pm csv export --output items.csv",
323
+ "pm csv export --output backlog.csv --delimiter ';'",
324
+ "pm csv export --status open --output todos.csv",
325
+ "pm csv export --type Feature --output features.csv",
326
+ ],
327
+ flags: [
328
+ { long: "--output", value_name: "file", description: "Output file path (default: print to stdout)" },
329
+ { long: "--delimiter", value_name: "char", description: "CSV field delimiter (default: ,)" },
330
+ { long: "--status", value_name: "filter", description: "Filter by status: open | in_progress | blocked | closed | canceled | draft" },
331
+ { long: "--type", value_name: "type", description: "Filter by item type" },
332
+ ],
333
+ async run(ctx) {
334
+ const delimiter = ctx.options["delimiter"] ?? ",";
335
+ const outputPath = ctx.options["output"];
336
+ const statusFilter = ctx.options["status"];
337
+ const typeFilter = ctx.options["type"];
338
+ const spawnArgs = ["--path", ctx.pm_root, "list-all", "--json"];
339
+ console.error("Fetching pm items…");
340
+ const result = spawnSync("pm", spawnArgs, { encoding: "utf-8" });
341
+ if (result.status !== 0) {
342
+ const msg = result.stderr || "pm list-all failed";
343
+ console.error(msg);
344
+ return { error: msg };
345
+ }
346
+ let allItems = JSON.parse(result.stdout).items ?? [];
347
+ // Apply filters client-side
348
+ if (statusFilter) {
349
+ allItems = allItems.filter((item) => item.status === statusFilter);
350
+ }
351
+ if (typeFilter) {
352
+ allItems = allItems.filter((item) => item.type === typeFilter);
353
+ }
354
+ const items = allItems;
355
+ if (items.length === 0) {
356
+ console.error("No items found.");
357
+ return { exported: 0 };
358
+ }
359
+ // Build CSV rows
360
+ const headerRow = EXPORT_COLUMNS.map(String);
361
+ const dataRows = items.map((item) => EXPORT_COLUMNS.map((col) => {
362
+ const val = item[col];
363
+ if (val === undefined || val === null)
364
+ return "";
365
+ if (Array.isArray(val))
366
+ return stringifyTags(val);
367
+ return String(val);
368
+ }));
369
+ const csvText = serializeCSV([headerRow, ...dataRows], delimiter);
370
+ if (outputPath) {
371
+ const absolutePath = resolve(outputPath);
372
+ writeFileSync(absolutePath, csvText + "\n", "utf-8");
373
+ console.error(`Exported ${items.length} item(s) to: ${absolutePath}`);
374
+ return { exported: items.length, file: absolutePath };
375
+ }
376
+ // Print to stdout — return as data so the CLI host renders it
377
+ console.error(`Exported ${items.length} item(s).`);
378
+ return { exported: items.length, csv: csvText };
379
+ },
380
+ });
381
+ // -----------------------------------------------------------------------
382
+ // Importer: csv-import (programmatic / config-driven)
383
+ // -----------------------------------------------------------------------
384
+ api.registerImporter("csv-import", async (ctx) => {
385
+ const filePath = ctx.options["file"];
386
+ if (!filePath) {
387
+ console.error("csv-import: no 'file' provided in options — skipping.");
388
+ return;
389
+ }
390
+ const delimiter = ctx.options["delimiter"] ?? ",";
391
+ const absolutePath = resolve(filePath);
392
+ console.error(`csv-import: reading ${absolutePath}`);
393
+ let headers;
394
+ let dataRows;
395
+ try {
396
+ ({ headers, dataRows } = readCSVFile(absolutePath, delimiter));
397
+ }
398
+ catch (err) {
399
+ const msg = err instanceof Error ? err.message : String(err);
400
+ console.error(`csv-import: failed to read file — ${msg}`);
401
+ return;
402
+ }
403
+ if (!headers.includes("title")) {
404
+ console.error("csv-import: CSV is missing required 'title' column — skipping.");
405
+ return;
406
+ }
407
+ const col = (name) => headers.indexOf(name);
408
+ let imported = 0;
409
+ let skipped = 0;
410
+ for (let rowIndex = 0; rowIndex < dataRows.length; rowIndex++) {
411
+ const row = dataRows[rowIndex];
412
+ const get = (name) => {
413
+ const idx = col(name);
414
+ return idx >= 0 ? (row[idx] ?? "").trim() : "";
415
+ };
416
+ const title = get("title");
417
+ if (!title) {
418
+ skipped++;
419
+ continue;
420
+ }
421
+ const rawStatus = get("status");
422
+ const status = rawStatus ? normalizeStatus(rawStatus) : "open";
423
+ const rawPriority = get("priority");
424
+ const priority = rawPriority ? parseInt(rawPriority, 10) : undefined;
425
+ const tags = parseTags(get("tags"));
426
+ const type = get("type") || undefined;
427
+ const milestone = get("milestone") || undefined;
428
+ const due_date = get("due_date") || undefined;
429
+ const body = get("body") || undefined;
430
+ try {
431
+ const spawnArgs = [
432
+ "--path", ctx.pm_root,
433
+ "create",
434
+ "--title", title,
435
+ "--status", status,
436
+ ];
437
+ if (body)
438
+ spawnArgs.push("--body", body);
439
+ if (priority !== undefined && !isNaN(priority))
440
+ spawnArgs.push("--priority", String(priority));
441
+ if (type)
442
+ spawnArgs.push("--type", type);
443
+ if (milestone)
444
+ spawnArgs.push("--milestone", milestone);
445
+ if (due_date)
446
+ spawnArgs.push("--due-date", due_date);
447
+ if (tags.length > 0)
448
+ spawnArgs.push("--tags", tags.join(","));
449
+ const result = spawnSync("pm", spawnArgs, { encoding: "utf-8" });
450
+ if (result.status !== 0) {
451
+ throw new Error(result.stderr || "pm create failed");
452
+ }
453
+ imported++;
454
+ }
455
+ catch (err) {
456
+ const msg = err instanceof Error ? err.message : String(err);
457
+ console.error(`csv-import: row ${rowIndex + 2} create failed — ${msg}`);
458
+ skipped++;
459
+ }
460
+ }
461
+ console.error(`csv-import: done — imported ${imported}, skipped ${skipped}.`);
462
+ });
463
+ },
464
+ });
465
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,MAAM,eAAe,GAA+B,CAAC,CAAC,SAAc,EAAE,EAAE,CAAC,SAAS,CAAQ,CAAC;AAsB3F,wEAAwE;AACxE,MAAM,cAAc,GAAG;IACrB,OAAO;IACP,MAAM;IACN,QAAQ;IACR,UAAU;IACV,MAAM;IACN,WAAW;IACX,UAAU;IACV,MAAM;CACE,CAAC;AAEX,0CAA0C;AAC1C,MAAM,cAAc,GAAwB;IAC1C,IAAI;IACJ,OAAO;IACP,MAAM;IACN,QAAQ;IACR,UAAU;IACV,MAAM;IACN,WAAW;IACX,UAAU;IACV,MAAM;IACN,YAAY;IACZ,YAAY;CACb,CA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AAmB,QAAQ,GAAG,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAC;oBACxE,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC;YAED,OAAO,CAAC,KAAK,CAAC,+BAA+B,QAAQ,aAAa,OAAO,GAAG,CAAC,CAAC;QAChF,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
package/manifest.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "pm-csv",
3
+ "version": "0.1.0",
4
+ "description": "CSV importer and exporter for pm-cli",
5
+ "author": "@unbraind",
6
+ "entry": "./dist/index.js",
7
+ "priority": 50,
8
+ "capabilities": [
9
+ "commands",
10
+ "schema",
11
+ "importers"
12
+ ],
13
+ "pm": {
14
+ "compatibility": "v2"
15
+ }
16
+ }
package/package.json ADDED
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "pm-csv",
3
+ "version": "0.1.0",
4
+ "description": "CSV importer and exporter for pm-cli",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/unbraind/pm-csv.git"
8
+ },
9
+ "bugs": {
10
+ "url": "https://github.com/unbraind/pm-csv/issues"
11
+ },
12
+ "homepage": "https://github.com/unbraind/pm-csv#readme",
13
+ "type": "module",
14
+ "main": "dist/index.js",
15
+ "types": "dist/index.d.ts",
16
+ "files": [
17
+ "dist/",
18
+ "manifest.json",
19
+ "README.md",
20
+ "CHANGELOG.md"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsc",
24
+ "prepack": "npm run build",
25
+ "typecheck": "tsc --noEmit",
26
+ "check": "npm run typecheck",
27
+ "audit:prod": "npm audit --omit=dev",
28
+ "pack:dry-run": "npm pack --dry-run",
29
+ "changelog": "pm-changelog --pm-root .agents/pm --mode prepend --output CHANGELOG.md --release-version-from-package --since-previous-tag --until-release-tag --item-url-base https://github.com/unbraind/pm-csv/blob/main/.agents/pm",
30
+ "changelog:full": "pm-changelog --pm-root .agents/pm --mode replace --output CHANGELOG.md --all-release-tags --release-version-from-package --item-url-base https://github.com/unbraind/pm-csv/blob/main/.agents/pm",
31
+ "changelog:check": "pm-changelog --pm-root .agents/pm --mode replace --output CHANGELOG.md --all-release-tags --release-version-from-package --item-url-base https://github.com/unbraind/pm-csv/blob/main/.agents/pm --check",
32
+ "release:check": "npm run typecheck && npm run build && npm run audit:prod && npm run pack:dry-run && npm run changelog:check"
33
+ },
34
+ "peerDependencies": {
35
+ "@unbrained/pm-cli": ">=2026.5.24"
36
+ },
37
+ "devDependencies": {
38
+ "@unbrained/pm-cli": "^2026.5.24",
39
+ "typescript": "^6.0.3",
40
+ "pm-changelog": "^2026.5.25",
41
+ "@types/node": "^25.9.1"
42
+ },
43
+ "keywords": [
44
+ "csv",
45
+ "exporter",
46
+ "importer",
47
+ "pm-cli",
48
+ "pm-extension",
49
+ "pm-package"
50
+ ],
51
+ "license": "MIT",
52
+ "engines": {
53
+ "node": ">=20.0.0"
54
+ },
55
+ "author": "@unbraind",
56
+ "pm": {
57
+ "aliases": [
58
+ "csv"
59
+ ],
60
+ "extensions": [
61
+ "."
62
+ ],
63
+ "catalog": {
64
+ "display_name": "CSV Import/Export",
65
+ "category": "import-export",
66
+ "summary": "CSV importer and exporter for pm-cli",
67
+ "tags": [
68
+ "csv",
69
+ "import",
70
+ "export"
71
+ ],
72
+ "links": {
73
+ "docs": "https://github.com/unbraind/pm-csv#readme",
74
+ "npm": "https://www.npmjs.com/package/pm-csv",
75
+ "repository": "https://github.com/unbraind/pm-csv",
76
+ "report": "https://github.com/unbraind/pm-csv/issues"
77
+ }
78
+ },
79
+ "docs": [
80
+ "README.md",
81
+ "CHANGELOG.md"
82
+ ],
83
+ "examples": [
84
+ "README.md"
85
+ ]
86
+ }
87
+ }