@nowline/cli 0.8.6 → 0.10.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 (91) hide show
  1. package/README.md +32 -9
  2. package/dist/cli/args.d.ts +20 -4
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +20 -0
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/cli/help.d.ts.map +1 -1
  7. package/dist/cli/help.js +31 -3
  8. package/dist/cli/help.js.map +1 -1
  9. package/dist/cli/options.d.ts +74 -0
  10. package/dist/cli/options.d.ts.map +1 -0
  11. package/dist/cli/options.js +209 -0
  12. package/dist/cli/options.js.map +1 -0
  13. package/dist/commands/init.d.ts.map +1 -1
  14. package/dist/commands/init.js +2 -3
  15. package/dist/commands/init.js.map +1 -1
  16. package/dist/commands/mcp-install.d.ts +18 -0
  17. package/dist/commands/mcp-install.d.ts.map +1 -0
  18. package/dist/commands/mcp-install.js +151 -0
  19. package/dist/commands/mcp-install.js.map +1 -0
  20. package/dist/commands/mcp.d.ts.map +1 -1
  21. package/dist/commands/mcp.js +7 -12
  22. package/dist/commands/mcp.js.map +1 -1
  23. package/dist/commands/render.d.ts +7 -0
  24. package/dist/commands/render.d.ts.map +1 -1
  25. package/dist/commands/render.js +161 -155
  26. package/dist/commands/render.js.map +1 -1
  27. package/dist/commands/serve.d.ts.map +1 -1
  28. package/dist/commands/serve.js +87 -60
  29. package/dist/commands/serve.js.map +1 -1
  30. package/dist/diagnostics/adapt.d.ts +12 -1
  31. package/dist/diagnostics/adapt.d.ts.map +1 -1
  32. package/dist/diagnostics/adapt.js +53 -1
  33. package/dist/diagnostics/adapt.js.map +1 -1
  34. package/dist/diagnostics/model.d.ts +1 -1
  35. package/dist/generated/version.d.ts +1 -1
  36. package/dist/generated/version.d.ts.map +1 -1
  37. package/dist/generated/version.js +2 -2
  38. package/dist/generated/version.js.map +1 -1
  39. package/dist/i18n/locale.d.ts.map +1 -1
  40. package/dist/i18n/locale.js +2 -5
  41. package/dist/i18n/locale.js.map +1 -1
  42. package/dist/index.js +4 -0
  43. package/dist/index.js.map +1 -1
  44. package/dist/io/config.d.ts +1 -1
  45. package/dist/io/config.d.ts.map +1 -1
  46. package/dist/io/config.js +1 -1
  47. package/dist/io/config.js.map +1 -1
  48. package/dist/io/log.d.ts +17 -0
  49. package/dist/io/log.d.ts.map +1 -0
  50. package/dist/io/log.js +16 -0
  51. package/dist/io/log.js.map +1 -0
  52. package/dist/mcp-install/clients.d.ts +58 -0
  53. package/dist/mcp-install/clients.d.ts.map +1 -0
  54. package/dist/mcp-install/clients.js +304 -0
  55. package/dist/mcp-install/clients.js.map +1 -0
  56. package/dist/mcp-install/host.d.ts +29 -0
  57. package/dist/mcp-install/host.d.ts.map +1 -0
  58. package/dist/mcp-install/host.js +72 -0
  59. package/dist/mcp-install/host.js.map +1 -0
  60. package/dist/mcp-install/json-config.d.ts +29 -0
  61. package/dist/mcp-install/json-config.d.ts.map +1 -0
  62. package/dist/mcp-install/json-config.js +139 -0
  63. package/dist/mcp-install/json-config.js.map +1 -0
  64. package/dist/mcp-install/server-command.d.ts +26 -0
  65. package/dist/mcp-install/server-command.d.ts.map +1 -0
  66. package/dist/mcp-install/server-command.js +52 -0
  67. package/dist/mcp-install/server-command.js.map +1 -0
  68. package/man/fr/nowline.1 +248 -19
  69. package/man/fr/nowline.5 +819 -45
  70. package/man/nowline.1 +193 -18
  71. package/man/nowline.5 +764 -36
  72. package/package.json +19 -19
  73. package/src/cli/args.ts +55 -5
  74. package/src/cli/help.ts +31 -3
  75. package/src/cli/options.ts +286 -0
  76. package/src/commands/init.ts +2 -3
  77. package/src/commands/mcp-install.ts +211 -0
  78. package/src/commands/mcp.ts +10 -14
  79. package/src/commands/render.ts +198 -195
  80. package/src/commands/serve.ts +102 -74
  81. package/src/diagnostics/adapt.ts +62 -0
  82. package/src/diagnostics/model.ts +1 -1
  83. package/src/generated/version.ts +2 -2
  84. package/src/i18n/locale.ts +2 -6
  85. package/src/index.ts +3 -0
  86. package/src/io/config.ts +0 -1
  87. package/src/io/log.ts +33 -0
  88. package/src/mcp-install/clients.ts +443 -0
  89. package/src/mcp-install/host.ts +106 -0
  90. package/src/mcp-install/json-config.ts +179 -0
  91. package/src/mcp-install/server-command.ts +75 -0
package/man/nowline.1 CHANGED
@@ -22,6 +22,17 @@
22
22
  .Fl -init
23
23
  .Op Ar name
24
24
  .Nm
25
+ .Fl -mcp
26
+ .Op Fl -root Ar dir
27
+ .Nm
28
+ .Fl -mcp-install
29
+ .Op Ar client
30
+ .Op Ar options
31
+ .Nm
32
+ .Fl -mcp-uninstall
33
+ .Op Ar client
34
+ .Op Ar options
35
+ .Nm
25
36
  .Fl -dry-run
26
37
  .Op Ar options
27
38
  .Ar input
@@ -128,6 +139,9 @@ successful render.
128
139
  Opt-in
129
140
  .Fl o Ar path
130
141
  also writes the rendered output to disk on each rebuild.
142
+ It takes the same render options as a plain render (theme, width, links,
143
+ strict mode, and the rest) and draws what a plain render of the file
144
+ draws for the same options.
131
145
  .It Fl -init Op Ar name
132
146
  Scaffold a starter
133
147
  .Pa .nowline
@@ -140,6 +154,35 @@ is auto-appended if missing.
140
154
  Default name is
141
155
  .Sy roadmap .
142
156
  Existing files are silently overwritten.
157
+ .It Fl -mcp
158
+ Start a Model Context Protocol (MCP) server on standard input and
159
+ output, exposing validate, render, export, and file tools to an agent.
160
+ With
161
+ .Fl -port Ar n ,
162
+ it serves local Streamable HTTP instead.
163
+ It is the same server as
164
+ .Ql npx @nowline/mcp .
165
+ .It Fl -mcp-install Op Ar client
166
+ Register the MCP server with an agent harness:
167
+ .Sy claude-code , claude-desktop , cursor , vscode , codex , gemini ,
168
+ .Sy antigravity , muse , opencode , copilot , windsurf , zed , amp , goose ,
169
+ or
170
+ .Sy all .
171
+ Without
172
+ .Ar client ,
173
+ installs into every harness found on this machine.
174
+ JSON configurations are edited in place, keeping comments and other
175
+ entries; Claude Code (user scope) and Codex go through their own
176
+ .Ql mcp add
177
+ command; Goose gets a snippet to paste.
178
+ Re-running is safe.
179
+ With
180
+ .Fl n ,
181
+ prints the change without writing or running anything.
182
+ See
183
+ .Sx MCP OPTIONS .
184
+ .It Fl -mcp-uninstall Op Ar client
185
+ Remove the server from the same configurations.
143
186
  .It Fl n , -dry-run
144
187
  Run the full pipeline (parse + validate + layout + format) but skip the
145
188
  write step.
@@ -180,7 +223,14 @@ Default: inferred from extension; standard input defaults to
180
223
  .Sh RENDER OPTIONS
181
224
  .Bl -tag -width Fl
182
225
  .It Fl t , -theme Ar name
183
- .Sy light | dark .
226
+ .Sy light | dark | grayscale ;
227
+ .Sy greyscale
228
+ is accepted as an alias.
229
+ Default:
230
+ .Pa .nowlinerc
231
+ .Sy theme ,
232
+ else
233
+ .Sy light .
184
234
  .It Fl -now Ar date
185
235
  .Sq Now
186
236
  anchor for the now-line and date math.
@@ -190,12 +240,15 @@ Accepts a bare
190
240
  .Pa 2026-06-04T23:00:00Z
191
241
  or
192
242
  .Pa 2026-06-05T06:00:00+07:00
193
- (an embedded Z or \(pmHH:MM offset overrides
243
+ (an embedded Z or \(+-HH:MM offset overrides
194
244
  .Fl -timezone ) .
195
245
  A bare date or an instant without an offset is floating: the written date
196
246
  part is used and
197
247
  .Fl -timezone
198
248
  is ignored.
249
+ The date part must be a real calendar day:
250
+ .Pa 2026-02-30
251
+ is an input error, not March\~2.
199
252
  Default: today's civil date in the host zone (or
200
253
  .Fl -timezone
201
254
  if given).
@@ -217,7 +270,7 @@ UTC.
217
270
  .It Sy Z , +00:00
218
271
  Zero-offset shorthand (equivalent to
219
272
  .Sy UTC ) .
220
- .It Sy \(pmHH , \(pmHH:MM , \(pmHHMM
273
+ .It Sy \(+-HH , \(+-HH:MM , \(+-HHMM
221
274
  Fixed offset (DST-naive; documented caveat).
222
275
  .It Sy America/Los_Angeles
223
276
  Any valid IANA timezone name.
@@ -276,10 +329,33 @@ Raster scale factor (PNG only; default 1).
276
329
  .It Fl -strict
277
330
  Promote asset / sanitizer warnings to errors.
278
331
  .It Fl w , -width Ar px
279
- Canvas width in pixels (default 1280).
332
+ Maximum canvas width in pixels.
333
+ Default:
334
+ .Pa .nowlinerc
335
+ .Sy width ,
336
+ else unset, so the canvas fits its content.
337
+ A wider roadmap shrinks its timeline to fit, down to one pixel per day;
338
+ captions that spill past their bars can still make the canvas wider.
339
+ .It Fl -non-working Ar mode
340
+ How a business calendar's non-working days appear on the chart:
341
+ .Sy hide
342
+ collapses them (the default),
343
+ .Sy show
344
+ draws them as shaded bands.
345
+ Overrides the file's
346
+ .Sy default roadmap non-working:
347
+ key; leave it unset and the key applies, then
348
+ .Sy hide .
349
+ Any other value exits with status 2.
350
+ The schedule is the same in both views, so Mermaid, MS Project, and XLSX output
351
+ does not change.
280
352
  .It Fl -asset-root Ar dir
281
353
  Directory from which logo / image assets may be loaded
282
- (default: input file's directory).
354
+ (default: the
355
+ .Sy assetRoot
356
+ key of
357
+ .Pa .nowlinerc ,
358
+ then the input file's directory).
283
359
  .El
284
360
  .Sh FORMAT-SPECIFIC OPTIONS
285
361
  .Bl -tag -width Fl
@@ -317,12 +393,13 @@ Monospace font for PNG/PDF; same resolution chain as
317
393
  Skip the platform font probe and force the bundled DejaVu pair.
318
394
  Output is byte-stable across machines.
319
395
  .It Fl -start Ar date
320
- MS Project: anchor date
321
- .Pq Pa YYYY-MM-DD
322
- for relative-only roadmaps.
323
- Default:
324
- .Fl -now ,
325
- then deterministic fallback.
396
+ MS Project: project start date
397
+ .Pq Pa YYYY-MM-DD .
398
+ Default: the roadmap's
399
+ .Cm start: ,
400
+ else
401
+ .Fl -now
402
+ (today).
326
403
  .El
327
404
  .Sh SERVE OPTIONS
328
405
  .Bl -tag -width Fl
@@ -337,6 +414,38 @@ to expose on the LAN).
337
414
  .It Fl -open
338
415
  Open the browser on start.
339
416
  .El
417
+ .Sh MCP OPTIONS
418
+ .Bl -tag -width Fl
419
+ .It Fl -root Ar dir
420
+ Directory the MCP file tools may read and write.
421
+ Without it, the server uses the roots the client advertises over MCP
422
+ (relative paths resolve against the first), or the current directory
423
+ when the client has none.
424
+ With
425
+ .Fl -mcp-install ,
426
+ it is written into the registered command as an absolute path.
427
+ .It Fl -scope Ar scope
428
+ Where
429
+ .Fl -mcp-install
430
+ writes:
431
+ .Sy user
432
+ (default; the harness's per-user configuration) or
433
+ .Sy project
434
+ (the configuration file in the current directory, for committing).
435
+ .It Fl -server Ar kind
436
+ What
437
+ .Fl -mcp-install
438
+ registers:
439
+ .Sy self
440
+ (default; this
441
+ .Nm
442
+ binary with
443
+ .Fl -mcp ,
444
+ so a Homebrew install needs no Node.js) or
445
+ .Sy npx
446
+ .Pq Ql npx -y @nowline/mcp ,
447
+ which follows npm independently of the CLI.
448
+ .El
340
449
  .Sh LOGGING OPTIONS
341
450
  The logging flags are mutually exclusive.
342
451
  .Bl -tag -width Fl
@@ -344,7 +453,9 @@ The logging flags are mutually exclusive.
344
453
  Print extra diagnostics to standard error (config path, pipeline
345
454
  timings, font resolution, fallback decisions).
346
455
  .It Fl q , -quiet
347
- Suppress non-error standard error.
456
+ Suppress non-error standard error: warnings, notices, and the warnings
457
+ in a failed run's diagnostic report.
458
+ Errors and JSON diagnostics still print, and the exit code is unchanged.
348
459
  .El
349
460
  .Sh STANDARD OPTIONS
350
461
  .Bl -tag -width Fl
@@ -394,24 +505,81 @@ for the resolution matrix.
394
505
  .It Pa .nowlinerc
395
506
  Optional JSON or YAML configuration file.
396
507
  Walked up from the input file's directory; nearest one wins.
397
- CLI flags override config values.
398
- Recognized keys:
399
- .Sy theme , defaultFormat , width , pdfPageSize , pdfOrientation ,
400
- .Sy pdfMargin , fontSans , fontMono , headlessFonts , locale .
508
+ Each recognized key is the default for one flag: the flag wins when
509
+ given, then the key, then the built-in default.
510
+ .Sy theme
511
+ .Pq Fl t ,
512
+ .Sy defaultFormat
513
+ .Pq Fl f ,
514
+ .Sy width
515
+ .Pq Fl w ,
516
+ .Sy pdfPageSize
517
+ .Pq Fl -page-size ,
518
+ .Sy pdfOrientation
519
+ .Pq Fl -orientation ,
520
+ .Sy pdfMargin
521
+ .Pq Fl -margin ,
522
+ .Sy fontSans
523
+ .Pq Fl -font-sans ,
524
+ .Sy fontMono
525
+ .Pq Fl -font-mono ,
526
+ .Sy headlessFonts
527
+ .Pq Fl -headless ,
528
+ .Sy useSystemFonts
529
+ .Pq Fl -use-system-fonts ,
530
+ .Sy assetRoot
531
+ .Pq Fl -asset-root ,
532
+ .Sy locale
533
+ .Pq Fl -locale .
534
+ .Sy defaultFormat
535
+ applies only when
536
+ .Fl o
537
+ has no recognized extension;
538
+ .Sy locale
539
+ ranks below the locale environment variables.
540
+ A relative
541
+ .Sy assetRoot
542
+ is resolved against the directory of the
543
+ .Pa .nowlinerc
544
+ that holds it, while a relative
545
+ .Fl -asset-root
546
+ is resolved against the working directory.
547
+ .Fl -serve
548
+ reads
549
+ .Sy theme ,
550
+ .Sy width ,
551
+ .Sy assetRoot
552
+ and
553
+ .Sy locale .
554
+ An invalid value is a usage error that names the key.
401
555
  Unknown keys are ignored.
556
+ There is no logging key:
557
+ .Sy quiet
558
+ is ignored, and
559
+ .Fl q
560
+ and
561
+ .Fl v
562
+ apply only on the command line.
402
563
  .El
403
564
  .Sh EXIT STATUS
404
565
  .Bl -tag -width Ds
405
566
  .It 0
406
567
  Success.
407
568
  .It 1
408
- Validation error (parse failure, invalid reference, etc.).
569
+ Validation error (parse failure, invalid reference, etc.), including
570
+ the wave rules checked across included files, such as
571
+ .Sy NL.E0202 .
572
+ Those are reported like validator diagnostics, at the file and line
573
+ they point into.
409
574
  .It 2
410
575
  Usage error (missing input, bad flags, mutually-exclusive flags,
411
576
  unsupported format, file not found, binary output to TTY, unreadable
412
577
  input).
413
578
  .It 3
414
- Output error (cannot write to destination, exporter pipeline failure).
579
+ Output error (cannot write to destination, exporter pipeline failure),
580
+ including an include that cannot be resolved (unreadable, circular or
581
+ duplicate include, mismatched
582
+ .Cm start: ) .
415
583
  .El
416
584
  .Sh EXAMPLES
417
585
  Render the default SVG to the current directory:
@@ -448,6 +616,13 @@ nowline --init
448
616
  nowline --init my-project
449
617
  .Ed
450
618
  .Pp
619
+ Serve the MCP tools, or register them with every agent found:
620
+ .Bd -literal -offset indent
621
+ nowline --mcp
622
+ nowline --mcp-install
623
+ nowline --mcp-install cursor --scope project -n
624
+ .Ed
625
+ .Pp
451
626
  PDF with explicit page geometry, byte-stable across machines:
452
627
  .Bd -literal -offset indent
453
628
  nowline roadmap.nowline -f pdf --page-size a4 \\