@nowline/cli 0.8.5 → 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 (102) hide show
  1. package/README.md +42 -12
  2. package/dist/cli/args.d.ts +21 -5
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +26 -1
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/cli/formats.d.ts.map +1 -1
  7. package/dist/cli/help.d.ts.map +1 -1
  8. package/dist/cli/help.js +35 -2
  9. package/dist/cli/help.js.map +1 -1
  10. package/dist/cli/options.d.ts +74 -0
  11. package/dist/cli/options.d.ts.map +1 -0
  12. package/dist/cli/options.js +209 -0
  13. package/dist/cli/options.js.map +1 -0
  14. package/dist/commands/init.d.ts.map +1 -1
  15. package/dist/commands/init.js +2 -3
  16. package/dist/commands/init.js.map +1 -1
  17. package/dist/commands/mcp-install.d.ts +18 -0
  18. package/dist/commands/mcp-install.d.ts.map +1 -0
  19. package/dist/commands/mcp-install.js +151 -0
  20. package/dist/commands/mcp-install.js.map +1 -0
  21. package/dist/commands/mcp.d.ts.map +1 -1
  22. package/dist/commands/mcp.js +6 -12
  23. package/dist/commands/mcp.js.map +1 -1
  24. package/dist/commands/render.d.ts +7 -0
  25. package/dist/commands/render.d.ts.map +1 -1
  26. package/dist/commands/render.js +176 -152
  27. package/dist/commands/render.js.map +1 -1
  28. package/dist/commands/serve.d.ts.map +1 -1
  29. package/dist/commands/serve.js +87 -60
  30. package/dist/commands/serve.js.map +1 -1
  31. package/dist/core/parse.js.map +1 -1
  32. package/dist/diagnostics/adapt.d.ts +12 -1
  33. package/dist/diagnostics/adapt.d.ts.map +1 -1
  34. package/dist/diagnostics/adapt.js +53 -1
  35. package/dist/diagnostics/adapt.js.map +1 -1
  36. package/dist/diagnostics/format.js.map +1 -1
  37. package/dist/diagnostics/model.d.ts +1 -1
  38. package/dist/diagnostics/text.js.map +1 -1
  39. package/dist/generated/version.d.ts +1 -1
  40. package/dist/generated/version.js +2 -2
  41. package/dist/i18n/locale.d.ts +1 -1
  42. package/dist/i18n/locale.d.ts.map +1 -1
  43. package/dist/i18n/locale.js +2 -5
  44. package/dist/i18n/locale.js.map +1 -1
  45. package/dist/index.js +4 -0
  46. package/dist/index.js.map +1 -1
  47. package/dist/io/config.d.ts +1 -1
  48. package/dist/io/config.d.ts.map +1 -1
  49. package/dist/io/config.js +1 -1
  50. package/dist/io/config.js.map +1 -1
  51. package/dist/io/exit-codes.d.ts.map +1 -1
  52. package/dist/io/exit-codes.js.map +1 -1
  53. package/dist/io/log.d.ts +17 -0
  54. package/dist/io/log.d.ts.map +1 -0
  55. package/dist/io/log.js +16 -0
  56. package/dist/io/log.js.map +1 -0
  57. package/dist/io/read.d.ts +3 -0
  58. package/dist/io/read.d.ts.map +1 -1
  59. package/dist/io/read.js +32 -5
  60. package/dist/io/read.js.map +1 -1
  61. package/dist/io/write.js.map +1 -1
  62. package/dist/mcp-install/clients.d.ts +58 -0
  63. package/dist/mcp-install/clients.d.ts.map +1 -0
  64. package/dist/mcp-install/clients.js +304 -0
  65. package/dist/mcp-install/clients.js.map +1 -0
  66. package/dist/mcp-install/host.d.ts +29 -0
  67. package/dist/mcp-install/host.d.ts.map +1 -0
  68. package/dist/mcp-install/host.js +72 -0
  69. package/dist/mcp-install/host.js.map +1 -0
  70. package/dist/mcp-install/json-config.d.ts +29 -0
  71. package/dist/mcp-install/json-config.d.ts.map +1 -0
  72. package/dist/mcp-install/json-config.js +139 -0
  73. package/dist/mcp-install/json-config.js.map +1 -0
  74. package/dist/mcp-install/server-command.d.ts +26 -0
  75. package/dist/mcp-install/server-command.d.ts.map +1 -0
  76. package/dist/mcp-install/server-command.js +52 -0
  77. package/dist/mcp-install/server-command.js.map +1 -0
  78. package/man/fr/nowline.1 +246 -19
  79. package/man/fr/nowline.5 +819 -45
  80. package/man/nowline.1 +191 -18
  81. package/man/nowline.5 +764 -36
  82. package/package.json +24 -24
  83. package/src/cli/args.ts +69 -8
  84. package/src/cli/help.ts +35 -2
  85. package/src/cli/options.ts +286 -0
  86. package/src/commands/init.ts +2 -3
  87. package/src/commands/mcp-install.ts +211 -0
  88. package/src/commands/mcp.ts +9 -14
  89. package/src/commands/render.ts +219 -186
  90. package/src/commands/serve.ts +102 -74
  91. package/src/diagnostics/adapt.ts +62 -0
  92. package/src/diagnostics/model.ts +1 -1
  93. package/src/generated/version.ts +2 -2
  94. package/src/i18n/locale.ts +2 -6
  95. package/src/index.ts +3 -0
  96. package/src/io/config.ts +0 -1
  97. package/src/io/log.ts +33 -0
  98. package/src/io/read.ts +39 -5
  99. package/src/mcp-install/clients.ts +443 -0
  100. package/src/mcp-install/host.ts +106 -0
  101. package/src/mcp-install/json-config.ts +179 -0
  102. package/src/mcp-install/server-command.ts +75 -0
package/README.md CHANGED
@@ -52,6 +52,8 @@ nowline <input> [options] # render (default)
52
52
  nowline <input> --serve [-p <port>] # live HTTP preview
53
53
  nowline --init [<name>] # scaffold a starter file
54
54
  nowline <input> --dry-run # validate-only (no write)
55
+ nowline --mcp # MCP stdio server for AI agents
56
+ nowline --mcp-install [<client>] # register that server with your agents
55
57
  nowline --help # print help
56
58
  nowline --version # print version
57
59
  nowline # no args → print help
@@ -99,18 +101,22 @@ nowline roadmap.nowline --headless # bundled DejaVu fonts (determi
99
101
  | `--serve` | Live HTTP preview. Opt-in `-o <path>` writes on each rebuild. |
100
102
  | `--init [<name>]` | Scaffold a starter `.nowline` in cwd. Auto-appends `.nowline`. |
101
103
  | `-n, --dry-run` | Run pipeline; skip the write. Replaces the old `validate` verb. |
104
+ | `--mcp` | MCP stdio server (`--port <n>` for local HTTP), same as `npx @nowline/mcp`. |
105
+ | `--mcp-install [<client>]` | Register the MCP server with an agent; omit the client for every agent found. `-n` previews. |
106
+ | `--mcp-uninstall [<client>]` | Remove it again. |
102
107
 
103
108
  ### Render options
104
109
 
105
110
  | Flag | Default | Notes |
106
111
  |-----------------------|--------------|---------------------------------------------|
107
- | `-t, --theme <name>` | `light` | `light` \| `dark`. |
108
- | `--now YYYY-MM-DD` | today (UTC) | Override the now-line anchor date. Use `--now -` to suppress it. |
112
+ | `-t, --theme <name>` | `light` | `light` \| `dark` \| `grayscale`. |
113
+ | `--now YYYY-MM-DD` | today (local) | Override the now-line anchor date. Use `--now -` to suppress it. Without `--now`, today is the local civil date, or the date in `--timezone` when set. |
109
114
  | `--no-links` | (off) | Omit link icons from items. |
110
115
  | `-s, --scale <n>` | `1` | Raster scale (PNG only). |
111
116
  | `--strict` | (off) | Promote asset / sanitizer warnings to errors. |
112
- | `-w, --width <px>` | `1280` | Canvas width. |
113
- | `--asset-root <dir>` | input dir | Root for `logo:` / image refs. |
117
+ | `-w, --width <px>` | fit content | Maximum canvas width. The timeline shrinks to fit (down to 1 px/day); spilled captions can still overflow. |
118
+ | `--non-working <mode>` | (file key, else `hide`) | `hide` \| `show`. How a business calendar's non-working days appear: collapsed, or drawn as shaded bands. Overrides the file's `default roadmap non-working:` key; omit it to let the key apply. Also accepted by `--serve`. |
119
+ | `--asset-root <dir>` | `.nowlinerc` `assetRoot`, else input dir | Root for `logo:` / image refs. |
114
120
 
115
121
  ### Format-specific options
116
122
 
@@ -122,7 +128,7 @@ nowline roadmap.nowline --headless # bundled DejaVu fonts (determi
122
128
  | `--font-sans <path\|alias>` | platform-resolved | png, pdf | TTF/OTF path, or alias `sf`, `helvetica`, `dejavu`, etc. |
123
129
  | `--font-mono <path\|alias>` | platform-resolved | png, pdf | TTF/OTF path or alias for monospace. |
124
130
  | `--headless` | (off) | png, pdf | Skip platform font probe; use bundled DejaVu pair. Byte-stable across machines. |
125
- | `--start YYYY-MM-DD` | `today` | msproj | Anchor date for relative-only roadmaps. |
131
+ | `--start YYYY-MM-DD` | `start:`, else today | msproj | Project start date. Defaults to the roadmap's `start:`, else the `--now` date. |
126
132
 
127
133
  ### Serve options
128
134
 
@@ -131,6 +137,19 @@ nowline roadmap.nowline --headless # bundled DejaVu fonts (determi
131
137
  | `-p, --port <n>` | `4318` |
132
138
  | `--host <host>` | `127.0.0.1` |
133
139
  | `--open` | (off) |
140
+ | `-w, --width <px>` | `.nowlinerc` `width`, else fit content |
141
+ | `--no-links` | (off) |
142
+ | `--strict` | (off) |
143
+
144
+ ### MCP options
145
+
146
+ `nowline --mcp-install` edits each agent's own config: `claude-code`, `claude-desktop`, `cursor`, `vscode`, `codex`, `gemini`, `antigravity`, `muse` (Meta Muse Code), `opencode`, `copilot` (GitHub Copilot CLI), `windsurf`, `zed`, `amp`, `goose`. Re-running is safe, and comments in JSON configs survive. Details: [`specs/cli.md` § `--mcp-install`](../../specs/cli.md).
147
+
148
+ | Flag | Default | Meaning |
149
+ |----------------------|---------|---------|
150
+ | `--root <dir>` | cwd | Folder the MCP file tools may use; with `--mcp-install`, written into the registered command. |
151
+ | `--scope <s>` | `user` | `user` (every project) or `project` (config files in cwd, for committing). |
152
+ | `--server <s>` | `self` | `self` registers this `nowline` binary, so a Homebrew install needs no Node; `npx` registers `npx -y @nowline/mcp`. |
134
153
 
135
154
  ### Logging (mutually exclusive)
136
155
 
@@ -195,13 +214,13 @@ Mutual exclusivity rules (all exit 2 with a message):
195
214
  | Code | Meaning |
196
215
  |------|---------|
197
216
  | 0 | Success |
198
- | 1 | Validation error |
199
- | 2 | Usage error (missing input, bad flags, unsupported format, file not found, binary→TTY refusal) |
200
- | 3 | Output error (cannot write to destination, exporter failure, page too small for margin) |
217
+ | 1 | Validation error (including a wave rule across included files, e.g. `NL.E0202`) |
218
+ | 2 | Usage error (missing input, bad flags, unsupported format, file not found, empty stdin, invalid `--diagnostic-format`, binary→TTY refusal) |
219
+ | 3 | Output error (cannot write to destination, exporter failure, page too small for margin, unresolvable include) |
201
220
 
202
221
  ## Configuration: `.nowlinerc`
203
222
 
204
- On any operation that takes an `<input>` file, `nowline` walks up from the input file's directory looking for a `.nowlinerc` (JSON or YAML). The nearest one wins. CLI flags override config values. Environment variables are not consulted.
223
+ On any operation that takes an `<input>` file, `nowline` walks up from the input file's directory looking for a `.nowlinerc` (JSON or YAML). The nearest one wins. Each key is the default for its flag: a flag on the command line wins, then the key, then the built-in default. An invalid value is a usage error that names the key. `--serve` reads `theme`, `width`, `locale` and `assetRoot`. Environment variables are not consulted, except the locale variables, which rank above the `locale` key.
205
224
 
206
225
  ```yaml
207
226
  # .nowlinerc (YAML)
@@ -216,6 +235,8 @@ pdfMargin: 0.5in # --margin
216
235
  fontSans: sf # --font-sans (alias or path)
217
236
  fontMono: sf-mono # --font-mono
218
237
  headlessFonts: false # --headless
238
+ useSystemFonts: false # --use-system-fonts
239
+ assetRoot: assets # --asset-root (relative to this file)
219
240
  ```
220
241
 
221
242
  ```json
@@ -228,7 +249,9 @@ headlessFonts: false # --headless
228
249
  "pdfMargin": "0.5in",
229
250
  "fontSans": "sf",
230
251
  "fontMono": "sf-mono",
231
- "headlessFonts": false
252
+ "headlessFonts": false,
253
+ "useSystemFonts": false,
254
+ "assetRoot": "assets"
232
255
  }
233
256
  ```
234
257
 
@@ -240,6 +263,7 @@ Unknown keys are ignored.
240
263
  nowline roadmap.nowline --dry-run
241
264
  nowline roadmap.nowline -n # short alias
242
265
  nowline roadmap.nowline -n --diagnostic-format json
266
+ nowline - -n --format=json < roadmap.nowline # json is the default here
243
267
  ```
244
268
 
245
269
  Each diagnostic is rendered in a biome/oxc-style frame via `@babel/code-frame`:
@@ -253,7 +277,12 @@ roadmap.nowline:7:34 error: Unknown reference 'auth-refactro' in after — did y
253
277
  8 | item audit-log "Audit log v2" size:xl before:code-freeze
254
278
  ```
255
279
 
256
- `--diagnostic-format json` emits the stable diagnostic schema:
280
+ `--diagnostic-format text|json` picks the stderr format; any other value is exit 2. With `--dry-run --format=json` it defaults to `json`, otherwise `text`; an explicit `--diagnostic-format text` wins. JSON mode writes one document per run to stderr whenever any diagnostic exists, warnings included (a clean source prints nothing), using the stable schema, version `1`:
281
+
282
+ ```json
283
+ { "$nowlineDiagnostics": "1", "diagnostics": [ /* Diagnostic[] */ ] }
284
+ ```
285
+
257
286
 
258
287
  ```ts
259
288
  type Diagnostic = {
@@ -264,10 +293,11 @@ type Diagnostic = {
264
293
  code: string;
265
294
  message: string;
266
295
  suggestion?: string;
296
+ span?: { start: { line: number; column: number }; end: { line: number; column: number } };
267
297
  };
268
298
  ```
269
299
 
270
- Exit 0 if no errors; exit 1 if any errors. Warnings never change the exit code.
300
+ Exit 0 if no errors; exit 1 if any errors. Warnings never change the exit code, in either format, so a warnings-only source exits 0 (with the JSON document on stderr in `json` mode).
271
301
 
272
302
  ## JSON AST round-trip
273
303
 
@@ -1,13 +1,19 @@
1
- export type ModeKind = 'render' | 'serve' | 'init' | 'mcp' | 'help' | 'version';
1
+ import type { LogLevel } from '../io/log.js';
2
+ export type ModeKind = 'render' | 'serve' | 'init' | 'mcp' | 'mcp-install' | 'mcp-uninstall' | 'help' | 'version';
3
+ export type McpScope = 'user' | 'project';
4
+ export type McpServerKind = 'self' | 'npx';
2
5
  export interface ParsedArgs {
3
6
  /** Resolved mode after dispatch (mutual-exclusivity already checked). */
4
7
  mode: ModeKind;
5
- /** Positional argument, or undefined. Render = input path. Init = project name. Serve = input path. */
8
+ /**
9
+ * Positional argument, or undefined. Render = input path. Init = project name. Serve = input path.
10
+ * MCP install / uninstall = client id.
11
+ */
6
12
  positional?: string;
7
- /** True if `--dry-run` / `-n` was passed (only valid for render mode). */
13
+ /** True if `--dry-run` / `-n` was passed (render and MCP install / uninstall). */
8
14
  dryRun: boolean;
9
15
  /** Logging level. Verbose and quiet are mutually exclusive. */
10
- logLevel: 'verbose' | 'quiet' | 'normal';
16
+ logLevel: LogLevel;
11
17
  output?: string;
12
18
  format?: string;
13
19
  inputFormat?: string;
@@ -29,6 +35,12 @@ export interface ParsedArgs {
29
35
  scale?: string;
30
36
  strict: boolean;
31
37
  width?: string;
38
+ /**
39
+ * Raw `--non-working` value (`hide` or `show`). Undefined means unset, so
40
+ * the file's `default roadmap non-working:` key still applies. Validated
41
+ * by the render and serve commands, like `--width`.
42
+ */
43
+ nonWorking?: string;
32
44
  assetRoot?: string;
33
45
  pageSize?: string;
34
46
  orientation?: string;
@@ -53,9 +65,13 @@ export interface ParsedArgs {
53
65
  port?: string;
54
66
  host?: string;
55
67
  open: boolean;
56
- diagnosticFormat?: string;
68
+ diagnosticFormat?: 'text' | 'json';
57
69
  template?: string;
58
70
  root?: string;
71
+ /** `--scope` for --mcp-install / --mcp-uninstall; validated in parseArgv. */
72
+ scope?: McpScope;
73
+ /** `--server` for --mcp-install; validated in parseArgv. */
74
+ server?: McpServerKind;
59
75
  }
60
76
  /**
61
77
  * Pure argument parser. Walks `argv` once, identifies mode flags, applies
@@ -1 +1 @@
1
- {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhF,MAAM,WAAW,UAAU;IACvB,yEAAyE;IACzE,IAAI,EAAE,QAAQ,CAAC;IACf,uGAAuG;IACvG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,QAAQ,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IAGzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;kFAI8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,C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AE,GAAG,UAAU,CAsN7D"}
package/dist/cli/args.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { parseArgs } from 'node:util';
2
+ import { isDiagnosticFormat } from '../diagnostics/format.js';
2
3
  import { CliError, ExitCode } from '../io/exit-codes.js';
3
4
  /**
4
5
  * Pure argument parser. Walks `argv` once, identifies mode flags, applies
@@ -35,6 +36,8 @@ export function parseArgv(argv) {
35
36
  serve: { type: 'boolean' },
36
37
  init: { type: 'boolean' },
37
38
  mcp: { type: 'boolean' },
39
+ 'mcp-install': { type: 'boolean' },
40
+ 'mcp-uninstall': { type: 'boolean' },
38
41
  'dry-run': { type: 'boolean', short: 'n' },
39
42
  theme: { type: 'string', short: 't' },
40
43
  // `--now <date>` overrides the now-line position; without it, the
@@ -49,6 +52,7 @@ export function parseArgv(argv) {
49
52
  scale: { type: 'string', short: 's' },
50
53
  strict: { type: 'boolean' },
51
54
  width: { type: 'string', short: 'w' },
55
+ 'non-working': { type: 'string' },
52
56
  'asset-root': { type: 'string' },
53
57
  port: { type: 'string', short: 'p' },
54
58
  host: { type: 'string' },
@@ -57,6 +61,8 @@ export function parseArgv(argv) {
57
61
  template: { type: 'string' },
58
62
  // MCP
59
63
  root: { type: 'string' },
64
+ scope: { type: 'string' },
65
+ server: { type: 'string' },
60
66
  // Format-specific (m2c)
61
67
  'page-size': { type: 'string' },
62
68
  orientation: { type: 'string' },
@@ -114,6 +120,10 @@ export function parseArgv(argv) {
114
120
  modes.push('init');
115
121
  if (values.mcp === true)
116
122
  modes.push('mcp');
123
+ if (values['mcp-install'] === true)
124
+ modes.push('mcp-install');
125
+ if (values['mcp-uninstall'] === true)
126
+ modes.push('mcp-uninstall');
117
127
  if (modes.length > 1) {
118
128
  throw new CliError(ExitCode.InputError, `nowline: --${modes[0]} and --${modes[1]} are mutually exclusive.`);
119
129
  }
@@ -129,6 +139,18 @@ export function parseArgv(argv) {
129
139
  .join(' ');
130
140
  throw new CliError(ExitCode.InputError, `nowline: unexpected extra arguments: ${extras}.`);
131
141
  }
142
+ const scope = stringOrUndefined(values.scope);
143
+ if (scope !== undefined && scope !== 'user' && scope !== 'project') {
144
+ throw new CliError(ExitCode.InputError, `nowline: invalid --scope "${scope}". Expected user or project.`);
145
+ }
146
+ const server = stringOrUndefined(values.server);
147
+ if (server !== undefined && server !== 'self' && server !== 'npx') {
148
+ throw new CliError(ExitCode.InputError, `nowline: invalid --server "${server}". Expected self or npx.`);
149
+ }
150
+ const rawDiagnosticFormat = stringOrUndefined(values['diagnostic-format']);
151
+ if (rawDiagnosticFormat !== undefined && !isDiagnosticFormat(rawDiagnosticFormat)) {
152
+ throw new CliError(ExitCode.InputError, `nowline: invalid --diagnostic-format "${rawDiagnosticFormat}". Expected text or json. Try --help for usage.`);
153
+ }
132
154
  const logLevel = values.verbose === true ? 'verbose' : values.quiet === true ? 'quiet' : 'normal';
133
155
  return {
134
156
  mode,
@@ -145,11 +167,12 @@ export function parseArgv(argv) {
145
167
  scale: stringOrUndefined(values.scale),
146
168
  strict: values.strict === true,
147
169
  width: stringOrUndefined(values.width),
170
+ nonWorking: stringOrUndefined(values['non-working']),
148
171
  assetRoot: stringOrUndefined(values['asset-root']),
149
172
  port: stringOrUndefined(values.port),
150
173
  host: stringOrUndefined(values.host),
151
174
  open: values.open === true,
152
- diagnosticFormat: stringOrUndefined(values['diagnostic-format']),
175
+ diagnosticFormat: rawDiagnosticFormat,
153
176
  template: stringOrUndefined(values.template),
154
177
  pageSize: stringOrUndefined(values['page-size']),
155
178
  orientation: stringOrUndefined(values.orientation),
@@ -161,6 +184,8 @@ export function parseArgv(argv) {
161
184
  start: stringOrUndefined(values.start),
162
185
  locale: stringOrUndefined(values.locale),
163
186
  root: stringOrUndefined(values.root),
187
+ scope,
188
+ server,
164
189
  };
165
190
  }
166
191
  function stringOrUndefined(value) {
@@ -1 +1 @@
1
- {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,SAAS,E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,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,YAAY,CAAC;IACrB,+DAA+D;IAC/D,MAAM,EAAE,MAAM,GAAG,kBAAkB,GAAG,QAAQ,GAAG,UAAU,CAAC;CAC/D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,sBAAsB,GAAG,gBAAgB,CAqC9E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAMjF;AAED,qBAAa,qBAAsB,SAAQ,KAAK;IAC5C,YAAY,OAAO,EAAE,MAAM,EAG1B;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AA6HA,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AA8JA,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
package/dist/cli/help.js CHANGED
@@ -8,6 +8,7 @@ USAGE
8
8
  nowline <input> [options]
9
9
  nowline --serve <input> [options]
10
10
  nowline --init [<name>]
11
+ nowline --mcp-install [<client>] [options]
11
12
  nowline --version
12
13
  nowline --help
13
14
 
@@ -34,9 +35,22 @@ MODE FLAGS (mutually exclusive)
34
35
  exposing validate, render, export, and file tools.
35
36
  Shares the same @nowline/mcp server code as
36
37
  \`npx @nowline/mcp\`.
38
+ --mcp-install [<client>]
39
+ Register the MCP server with an agent: claude-code,
40
+ claude-desktop, cursor, vscode, codex, gemini,
41
+ antigravity, muse, opencode, copilot, windsurf, zed,
42
+ amp, goose, or all. Omitted: every agent found on this machine.
43
+ Re-running is safe; -n previews the change.
44
+ --mcp-uninstall [<client>]
45
+ Remove the server from the same configs.
37
46
  -n, --dry-run Run the full pipeline (parse + validate + layout +
38
47
  format) but skip the write step. Subsumes the old
39
48
  'validate' verb. Exit 0 on success, 1 on errors.
49
+ --diagnostic-format <f>
50
+ Diagnostics on stderr: text | json. json prints one
51
+ { "$nowlineDiagnostics": "1", ... } document per run
52
+ (warnings included). Default: json with --dry-run
53
+ --format=json, else text.
40
54
 
41
55
  RENDER OPTIONS
42
56
  -t, --theme <name> light | dark | grayscale (greyscale alias)
@@ -60,8 +74,18 @@ RENDER OPTIONS
60
74
  --no-links Omit link icons from rendered items.
61
75
  -s, --scale <n> Raster scale factor (PNG only; default 1).
62
76
  --strict Promote asset / sanitizer warnings to errors.
63
- -w, --width <px> Canvas width in pixels (default: 1280).
64
- --asset-root <dir> Root for logo / image assets (default: input dir).
77
+ -w, --width <px> Maximum canvas width in pixels. Default: fit the
78
+ content. A wider roadmap shrinks its timeline to
79
+ fit; long captions can still overflow it.
80
+ --non-working <hide|show>
81
+ How a business calendar's non-working days appear:
82
+ hide collapses them (the default), show draws them
83
+ as shaded bands. Overrides the file's
84
+ 'default roadmap non-working:' key; omit it to let
85
+ the key apply. Mermaid, MS Project, and XLSX output
86
+ is the same in both views.
87
+ --asset-root <dir> Root for logo / image assets (default: the
88
+ .nowlinerc assetRoot key, then the input dir).
65
89
  --locale <bcp47> BCP-47 locale (e.g. fr, fr-CA) for CLI message
66
90
  output (validator diagnostics, --help, errors).
67
91
  Used as a fallback for the rendered drawing only
@@ -93,6 +117,13 @@ SERVE OPTIONS
93
117
  MCP OPTIONS
94
118
  --root <dir> Allowed-root directory for file tools (default: cwd).
95
119
  File paths are resolved and restricted to this root.
120
+ With --mcp-install, written into the registered
121
+ command.
122
+ --scope <s> --mcp-install target: user (default, every
123
+ project) or project (config files in cwd).
124
+ --server <s> What --mcp-install registers: self (default, this
125
+ nowline binary; needs no Node) or npx
126
+ (npx -y @nowline/mcp, tracks npm).
96
127
 
97
128
  LOGGING (mutually exclusive)
98
129
  -v, --verbose Print extra diagnostics to stderr.
@@ -114,6 +145,8 @@ EXAMPLES
114
145
  nowline --init my-project # scaffold ./my-project.nowline
115
146
  nowline --mcp # start MCP stdio server in cwd
116
147
  nowline --mcp --root ./roadmaps # MCP server with custom root
148
+ nowline --mcp-install # register with every agent found
149
+ nowline --mcp-install cursor --scope project -n # preview .cursor/mcp.json
117
150
 
118
151
  EXIT CODES
119
152
  0 Success
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,sEAAsE;AACtE,oEAAoE;AACpE,2DAA2D;AAC3D,MAAM,SAAS,GAAG,WAAW,iBAAiB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsH/C,CAAC;AAEF,MAAM,UAAU,UAAU;IACtB,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,aAAa;IACzB,OAAO,GAAG,iBAAiB,EAAE,IAAI,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,sEAAsE;AACtE,oEAAoE;AACpE,2DAA2D;AAC3D,MAAM,SAAS,GAAG,WAAW,iBAAiB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuJ/C,CAAC;AAEF,MAAM,UAAU,UAAU;IACtB,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,aAAa;IACzB,OAAO,GAAG,iBAAiB,EAAE,IAAI,CAAC;AACtC,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { type NowlineRc, type OptionError, type OptionSpec, type SurfaceOptions } from '@nowline/config';
2
+ import type { ParsedArgs } from './args.js';
3
+ export type PdfOrientation = 'portrait' | 'landscape' | 'auto';
4
+ /** Every option the CLI resolves over its flag and rc layers: the shared five, then its own. */
5
+ export declare const CLI_OPTION_SPECS: Readonly<{
6
+ theme: OptionSpec<import("@nowline/layout").ThemeName>;
7
+ width: OptionSpec<number>;
8
+ now: OptionSpec<Date | null>;
9
+ pageSize: OptionSpec<import("@nowline/export-core").PdfPageSize>;
10
+ nonWorking: OptionSpec<import("@nowline/layout").NonWorkingDisplay>;
11
+ orientation: OptionSpec<PdfOrientation>;
12
+ margin: OptionSpec<number>;
13
+ defaultFormat: OptionSpec<string>;
14
+ fontSans: OptionSpec<string>;
15
+ fontMono: OptionSpec<string>;
16
+ headless: OptionSpec<boolean>;
17
+ useSystemFonts: OptionSpec<boolean>;
18
+ locale: OptionSpec<string>;
19
+ assetRoot: OptionSpec<string>;
20
+ }>;
21
+ type CliSpecs = typeof CLI_OPTION_SPECS;
22
+ export type CliOptionKey = Extract<keyof CliSpecs, string>;
23
+ export interface CliOptions {
24
+ /** Theme, width, now-line date and non-working display; page size when set. */
25
+ surface: SurfaceOptions;
26
+ orientation?: PdfOrientation;
27
+ /** Page margin in points. */
28
+ margin?: number;
29
+ /** The rc `defaultFormat`; the `--format` flag is resolved by `resolveFormat`. */
30
+ defaultFormat?: string;
31
+ fontSans?: string;
32
+ fontMono?: string;
33
+ headless: boolean;
34
+ useSystemFonts: boolean;
35
+ /**
36
+ * Where `logo:` assets are read from, as an absolute path: `--asset-root`,
37
+ * else the rc `assetRoot`. Unset means the input file's directory.
38
+ */
39
+ assetRoot?: string;
40
+ /** The rc `locale`; the flag and `NOWLINE_LOCALE` rank above it (`resolveLocaleOverride`). */
41
+ rcLocale?: string;
42
+ /**
43
+ * Throw the first invalid option as a usage error, in the order the CLI
44
+ * has always reported them: theme, timezone, now, width, non-working.
45
+ */
46
+ assertValid(): void;
47
+ /**
48
+ * Throw the first invalid PDF setting (page size, orientation, margin).
49
+ * Run after validation, so these errors follow any diagnostics.
50
+ */
51
+ assertPdfSettingsValid(): void;
52
+ }
53
+ /**
54
+ * Resolve the CLI's options over the flag layer, then the `.nowlinerc` layer.
55
+ * `render` and `--serve` both call this, so they read the same keys the same
56
+ * way. `cwd` is what a relative `--asset-root` resolves against (default: the
57
+ * process's). Nothing throws here: a caller reads `defaultFormat` early and reports bad
58
+ * values at the point it always did, through `assertValid`.
59
+ */
60
+ export declare function resolveCliOptions(args: ParsedArgs, config: NowlineRc | null, context?: {
61
+ rcPath?: string;
62
+ cwd?: string;
63
+ clock?: () => Date;
64
+ }): CliOptions;
65
+ /**
66
+ * An {@link OptionError} in the CLI's wording, naming the flag or `.nowlinerc`
67
+ * key the value came from: `nowline: invalid --width "abc". Must be an integer
68
+ * ≥ 320.` The templates are the ones the CLI used before the schema, so
69
+ * scripts that match them keep working.
70
+ */
71
+ export declare function formatOptionError(error: OptionError<string>): string;
72
+ export declare function formatChoices(names: readonly string[]): string;
73
+ export {};
74
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/cli/options.ts"],"names":[],"mappings":"AAQA,OAAO,EAEH,KAAK,SAAS,EACd,KAAK,WAAW,EAGhB,KAAK,UAAU,EAKf,KAAK,cAAc,EACtB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAI5C,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,CAAC;AAqC/D,gGAAgG;AAChG,eAAO,MAAM,gBAAgB;;;;;;iBAE4C,UAAU,CAAC,cAAc,CAAC;YACzC,UA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