dotmd-cli 0.9.4 → 0.9.6

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/bin/dotmd.mjs CHANGED
@@ -34,40 +34,50 @@ const pkg = JSON.parse(readFileSync(path.join(__dirname, '..', 'package.json'),
34
34
  const HELP = {
35
35
  _main: `dotmd v${pkg.version} — frontmatter markdown document manager
36
36
 
37
- Commands:
38
- list [--verbose|--json] List docs grouped by status (default)
39
- json Full index as JSON
40
- check [flags] Validate frontmatter and references
41
- coverage [--json] Metadata coverage report
42
- stats [--json] Doc health dashboard
43
- graph [--dot|--json] Visualize document relationships
44
- deps [file] Dependency tree or overview
45
- context Compact briefing (LLM-oriented)
46
- focus [status] Detailed view for one status group
47
- query [filters] Filtered search
48
- index [--write] Generate/update docs.md index block
49
- status <file> <status> Transition document status
50
- archive <file> Archive (status + move + update refs)
51
- touch <file> Bump updated date
52
- doctor Auto-fix everything: refs, lint, dates, index
53
- fix-refs Auto-fix broken reference paths
54
- lint [--fix] Check and auto-fix frontmatter issues
55
- rename <old> <new> Rename doc and update references
56
- migrate <f> <old> <new> Batch update a frontmatter field
57
- watch [command] Re-run a command on file changes
58
- notion <sub> [db-id] Notion import/export/sync
59
- export [file] Export docs as md, html, or json
60
- summary <file> AI summary of a document
61
- diff [file] Show changes since last updated date
62
- new <name> Create a new document from template
63
- init Create starter config + docs directory
64
- completions <shell> Output shell completion script (bash, zsh)
65
-
66
- Options:
37
+ View & Query:
38
+ list [--verbose] [--json] List docs grouped by status (default command)
39
+ json Full index as JSON
40
+ context [--summarize] [--json] Compact briefing (LLM-oriented)
41
+ focus [status] [--json] Detailed view for one status group
42
+ query [filters] [--json] Filtered search (--status, --keyword, --stale, etc.)
43
+ coverage [--json] Metadata coverage report
44
+ stats [--json] Doc health dashboard
45
+ graph [--dot] [--json] Visualize document relationships
46
+ deps [file] [--json] Dependency tree or overview
47
+ diff [file] [--summarize] Show changes since last updated date
48
+ summary <file> [--json] AI summary of a document
49
+
50
+ Validate & Fix:
51
+ check [--fix] [--errors-only] [--json] Validate frontmatter and references
52
+ doctor [--dry-run] Auto-fix everything: refs, lint, dates, index
53
+ lint [--fix] Check and auto-fix frontmatter issues
54
+ fix-refs [--dry-run] Auto-fix broken reference paths + body links
55
+
56
+ Lifecycle:
57
+ status <file> <status> Transition document status
58
+ archive <file> Archive (status + move + update refs)
59
+ touch <file> Bump updated date
60
+ touch --git Bulk-sync dates from git history
61
+ rename <old> <new> Rename doc and update all references
62
+ migrate <field> <old> <new> Batch update a frontmatter field value
63
+
64
+ Create & Export:
65
+ new <name> [--template <t>] Create doc from template (plan, adr, rfc, audit, design)
66
+ index [--write] Generate/update docs.md index block
67
+ export [--format md|html|json] Export docs as markdown, HTML, or JSON
68
+ notion import|export|sync [db-id] Notion database integration
69
+
70
+ Setup:
71
+ init Create starter config + docs directory
72
+ watch [command] Re-run a command on file changes
73
+ completions <shell> Shell completion script (bash, zsh)
74
+
75
+ Global Options:
67
76
  --config <path> Explicit config file path
77
+ --root <name> Filter to a specific docs root
68
78
  --dry-run, -n Preview changes without writing anything
69
79
  --verbose Show config details and doc count
70
- --help, -h Show help
80
+ --help, -h Show help (per-command: dotmd <cmd> --help)
71
81
  --version, -v Show version`,
72
82
 
73
83
  list: `dotmd list — list docs grouped by status
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dotmd-cli",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "description": "CLI for managing markdown documents with YAML frontmatter — index, query, validate, graph, export, Notion sync, AI summaries.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/ai.mjs CHANGED
@@ -34,18 +34,19 @@ export function runMLX(prompt, opts = {}) {
34
34
  const output = result.stdout.trim();
35
35
  const lines = output.split('\n')
36
36
  .filter(l => !l.includes('Fetching') && !l.includes('Warning:') && !l.includes('=========='));
37
- return lines.join(' ').trim() || null;
37
+ const text = lines.join(' ').trim();
38
+ return text ? text.replace(/\*\*/g, '').replace(/^#+\s*/gm, '').trim() : null;
38
39
  }
39
40
 
40
41
  export function summarizeDocBody(bodyText, meta, opts = {}) {
41
42
  if (!bodyText?.trim()) return null;
42
- const prompt = `Summarize this markdown document in 2-3 sentences. Focus on what the document is about, its current state, and any key next actions or open questions.
43
+ const prompt = `<|begin_of_text|><|start_header_id|>system<|end_header_id|>
44
+ You write brief, direct summaries. No preamble. No filler. Start with the subject immediately.<|eot_id|><|start_header_id|>user<|end_header_id|>
45
+ Write a 2-3 sentence plain text summary of this document. State what it covers, its current state (${meta.status}), and what remains to be done. No markdown formatting. No bold, headers, or bullets. Do not start with "This document" or "Here is".
43
46
 
44
47
  Title: ${meta.title}
45
- Status: ${meta.status}
46
- File: ${meta.path}
47
-
48
- ${bodyText.slice(0, 6000)}`;
48
+ ${bodyText.slice(0, 6000)}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
49
+ `;
49
50
  return runMLX(prompt, { maxTokens: 200, ...opts });
50
51
  }
51
52