@nowline/cli 0.8.6 → 0.9.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 (89) 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 +30 -2
  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 +5 -11
  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.js +2 -2
  37. package/dist/i18n/locale.d.ts.map +1 -1
  38. package/dist/i18n/locale.js +2 -5
  39. package/dist/i18n/locale.js.map +1 -1
  40. package/dist/index.js +4 -0
  41. package/dist/index.js.map +1 -1
  42. package/dist/io/config.d.ts +1 -1
  43. package/dist/io/config.d.ts.map +1 -1
  44. package/dist/io/config.js +1 -1
  45. package/dist/io/config.js.map +1 -1
  46. package/dist/io/log.d.ts +17 -0
  47. package/dist/io/log.d.ts.map +1 -0
  48. package/dist/io/log.js +16 -0
  49. package/dist/io/log.js.map +1 -0
  50. package/dist/mcp-install/clients.d.ts +58 -0
  51. package/dist/mcp-install/clients.d.ts.map +1 -0
  52. package/dist/mcp-install/clients.js +304 -0
  53. package/dist/mcp-install/clients.js.map +1 -0
  54. package/dist/mcp-install/host.d.ts +29 -0
  55. package/dist/mcp-install/host.d.ts.map +1 -0
  56. package/dist/mcp-install/host.js +72 -0
  57. package/dist/mcp-install/host.js.map +1 -0
  58. package/dist/mcp-install/json-config.d.ts +29 -0
  59. package/dist/mcp-install/json-config.d.ts.map +1 -0
  60. package/dist/mcp-install/json-config.js +139 -0
  61. package/dist/mcp-install/json-config.js.map +1 -0
  62. package/dist/mcp-install/server-command.d.ts +26 -0
  63. package/dist/mcp-install/server-command.d.ts.map +1 -0
  64. package/dist/mcp-install/server-command.js +52 -0
  65. package/dist/mcp-install/server-command.js.map +1 -0
  66. package/man/fr/nowline.1 +246 -19
  67. package/man/fr/nowline.5 +819 -45
  68. package/man/nowline.1 +191 -18
  69. package/man/nowline.5 +764 -36
  70. package/package.json +19 -19
  71. package/src/cli/args.ts +55 -5
  72. package/src/cli/help.ts +30 -2
  73. package/src/cli/options.ts +286 -0
  74. package/src/commands/init.ts +2 -3
  75. package/src/commands/mcp-install.ts +211 -0
  76. package/src/commands/mcp.ts +8 -13
  77. package/src/commands/render.ts +198 -195
  78. package/src/commands/serve.ts +102 -74
  79. package/src/diagnostics/adapt.ts +62 -0
  80. package/src/diagnostics/model.ts +1 -1
  81. package/src/generated/version.ts +2 -2
  82. package/src/i18n/locale.ts +2 -6
  83. package/src/index.ts +3 -0
  84. package/src/io/config.ts +0 -1
  85. package/src/io/log.ts +33 -0
  86. package/src/mcp-install/clients.ts +443 -0
  87. package/src/mcp-install/host.ts +106 -0
  88. package/src/mcp-install/json-config.ts +179 -0
  89. 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,36 @@ 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 (default: the current
421
+ directory).
422
+ With
423
+ .Fl -mcp-install ,
424
+ it is written into the registered command as an absolute path.
425
+ .It Fl -scope Ar scope
426
+ Where
427
+ .Fl -mcp-install
428
+ writes:
429
+ .Sy user
430
+ (default; the harness's per-user configuration) or
431
+ .Sy project
432
+ (the configuration file in the current directory, for committing).
433
+ .It Fl -server Ar kind
434
+ What
435
+ .Fl -mcp-install
436
+ registers:
437
+ .Sy self
438
+ (default; this
439
+ .Nm
440
+ binary with
441
+ .Fl -mcp ,
442
+ so a Homebrew install needs no Node.js) or
443
+ .Sy npx
444
+ .Pq Ql npx -y @nowline/mcp ,
445
+ which follows npm independently of the CLI.
446
+ .El
340
447
  .Sh LOGGING OPTIONS
341
448
  The logging flags are mutually exclusive.
342
449
  .Bl -tag -width Fl
@@ -344,7 +451,9 @@ The logging flags are mutually exclusive.
344
451
  Print extra diagnostics to standard error (config path, pipeline
345
452
  timings, font resolution, fallback decisions).
346
453
  .It Fl q , -quiet
347
- Suppress non-error standard error.
454
+ Suppress non-error standard error: warnings, notices, and the warnings
455
+ in a failed run's diagnostic report.
456
+ Errors and JSON diagnostics still print, and the exit code is unchanged.
348
457
  .El
349
458
  .Sh STANDARD OPTIONS
350
459
  .Bl -tag -width Fl
@@ -394,24 +503,81 @@ for the resolution matrix.
394
503
  .It Pa .nowlinerc
395
504
  Optional JSON or YAML configuration file.
396
505
  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 .
506
+ Each recognized key is the default for one flag: the flag wins when
507
+ given, then the key, then the built-in default.
508
+ .Sy theme
509
+ .Pq Fl t ,
510
+ .Sy defaultFormat
511
+ .Pq Fl f ,
512
+ .Sy width
513
+ .Pq Fl w ,
514
+ .Sy pdfPageSize
515
+ .Pq Fl -page-size ,
516
+ .Sy pdfOrientation
517
+ .Pq Fl -orientation ,
518
+ .Sy pdfMargin
519
+ .Pq Fl -margin ,
520
+ .Sy fontSans
521
+ .Pq Fl -font-sans ,
522
+ .Sy fontMono
523
+ .Pq Fl -font-mono ,
524
+ .Sy headlessFonts
525
+ .Pq Fl -headless ,
526
+ .Sy useSystemFonts
527
+ .Pq Fl -use-system-fonts ,
528
+ .Sy assetRoot
529
+ .Pq Fl -asset-root ,
530
+ .Sy locale
531
+ .Pq Fl -locale .
532
+ .Sy defaultFormat
533
+ applies only when
534
+ .Fl o
535
+ has no recognized extension;
536
+ .Sy locale
537
+ ranks below the locale environment variables.
538
+ A relative
539
+ .Sy assetRoot
540
+ is resolved against the directory of the
541
+ .Pa .nowlinerc
542
+ that holds it, while a relative
543
+ .Fl -asset-root
544
+ is resolved against the working directory.
545
+ .Fl -serve
546
+ reads
547
+ .Sy theme ,
548
+ .Sy width ,
549
+ .Sy assetRoot
550
+ and
551
+ .Sy locale .
552
+ An invalid value is a usage error that names the key.
401
553
  Unknown keys are ignored.
554
+ There is no logging key:
555
+ .Sy quiet
556
+ is ignored, and
557
+ .Fl q
558
+ and
559
+ .Fl v
560
+ apply only on the command line.
402
561
  .El
403
562
  .Sh EXIT STATUS
404
563
  .Bl -tag -width Ds
405
564
  .It 0
406
565
  Success.
407
566
  .It 1
408
- Validation error (parse failure, invalid reference, etc.).
567
+ Validation error (parse failure, invalid reference, etc.), including
568
+ the wave rules checked across included files, such as
569
+ .Sy NL.E0202 .
570
+ Those are reported like validator diagnostics, at the file and line
571
+ they point into.
409
572
  .It 2
410
573
  Usage error (missing input, bad flags, mutually-exclusive flags,
411
574
  unsupported format, file not found, binary output to TTY, unreadable
412
575
  input).
413
576
  .It 3
414
- Output error (cannot write to destination, exporter pipeline failure).
577
+ Output error (cannot write to destination, exporter pipeline failure),
578
+ including an include that cannot be resolved (unreadable, circular or
579
+ duplicate include, mismatched
580
+ .Cm start: ) .
415
581
  .El
416
582
  .Sh EXAMPLES
417
583
  Render the default SVG to the current directory:
@@ -448,6 +614,13 @@ nowline --init
448
614
  nowline --init my-project
449
615
  .Ed
450
616
  .Pp
617
+ Serve the MCP tools, or register them with every agent found:
618
+ .Bd -literal -offset indent
619
+ nowline --mcp
620
+ nowline --mcp-install
621
+ nowline --mcp-install cursor --scope project -n
622
+ .Ed
623
+ .Pp
451
624
  PDF with explicit page geometry, byte-stable across machines:
452
625
  .Bd -literal -offset indent
453
626
  nowline roadmap.nowline -f pdf --page-size a4 \\