pointfree-docs 0.2.0 → 0.2.1

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 (2) hide show
  1. package/dist/cli.js +81 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -14,8 +14,21 @@ import { statsCommand } from "./commands/stats.js";
14
14
  const program = new Command();
15
15
  program
16
16
  .name("pf-docs")
17
- .description("CLI tool for searching Point-Free library documentation")
18
- .version("0.2.0");
17
+ .description(`CLI tool for searching Point-Free library documentation.
18
+
19
+ Indexes DocC articles, code examples, and episode samples from 12 Point-Free
20
+ open-source libraries (TCA, Dependencies, Navigation, Sharing, etc.).
21
+
22
+ Typical workflow:
23
+ 1. pf-docs init --libs tca dependencies # clone & index selected libs
24
+ 2. pf-docs search "testing reducer" # full-text search across docs
25
+ 3. pf-docs get tca/Articles/Testing # retrieve a specific article
26
+
27
+ Path format: <library>/<Articles|Tutorials|Extensions>/<Name>
28
+ e.g. tca/Articles/TestingTCA, sharing/Articles/SharingState
29
+
30
+ All commands support --json for machine-readable output.`)
31
+ .version("0.2.1");
19
32
  program
20
33
  .command("init")
21
34
  .description("Initialize and download documentation for specified libraries")
@@ -23,6 +36,20 @@ program
23
36
  .option("-a, --all", "Download all available libraries")
24
37
  .option("-e, --examples", "Download TCA examples (CaseStudies, SyncUps, etc.)")
25
38
  .option("-p, --episodes", "Download Point-Free episode code samples (350+)")
39
+ .addHelpText("after", `
40
+ Examples:
41
+ $ pf-docs init --libs tca dependencies # just TCA and Dependencies
42
+ $ pf-docs init --all # all 12 libraries
43
+ $ pf-docs init --libs tca --examples # TCA docs + example apps
44
+ $ pf-docs init --all --examples --episodes # everything
45
+
46
+ Available library short names:
47
+ tca, dependencies, navigation, perception, sharing,
48
+ identified-collections, case-paths, custom-dump,
49
+ concurrency-extras, clocks, snapshot-testing, issue-reporting
50
+
51
+ Uses sparse git checkout — only documentation folders are cloned.
52
+ Re-running init on already-cloned libraries is safe (skips existing).`)
26
53
  .action(initCommand);
27
54
  program
28
55
  .command("update")
@@ -30,6 +57,14 @@ program
30
57
  .option("-l, --libs <libs...>", "Specific libraries to update")
31
58
  .option("-e, --examples", "Update examples")
32
59
  .option("-p, --episodes", "Update episodes")
60
+ .addHelpText("after", `
61
+ Examples:
62
+ $ pf-docs update # update all cloned libraries
63
+ $ pf-docs update --libs tca # update only TCA
64
+ $ pf-docs update --examples --episodes # update examples and episodes
65
+
66
+ Runs git pull on cloned repos and rebuilds the search index.
67
+ Only updates libraries that were previously initialized.`)
33
68
  .action(updateCommand);
34
69
  program
35
70
  .command("search <query>")
@@ -38,6 +73,18 @@ program
38
73
  .option("-n, --limit <n>", "Max results to return", "10")
39
74
  .option("-s, --source <source>", "Source type: docs, examples, episodes, all (default: docs)")
40
75
  .option("-j, --json", "Output results as JSON")
76
+ .addHelpText("after", `
77
+ Examples:
78
+ $ pf-docs search "testing reducer" # search docs (default)
79
+ $ pf-docs search "testing" --lib tca # search within TCA only
80
+ $ pf-docs search "dependency" --limit 5 # top 5 results
81
+ $ pf-docs search "SyncUps" --source examples # search example apps
82
+ $ pf-docs search "parser" --source all # search everything
83
+ $ pf-docs search "testing" --json # JSON output
84
+
85
+ By default, searches docs only. Use --source all to include examples and episodes.
86
+ Results include path (usable with 'get'), title, snippet, and relevance score.
87
+ Uses SQLite FTS5 with BM25 ranking.`)
41
88
  .action(searchCommand);
42
89
  program
43
90
  .command("get <path>")
@@ -46,6 +93,20 @@ program
46
93
  .option("-r, --raw", "Output raw content without header")
47
94
  .option("-p, --preview", "Preview mode (first 50 lines for code files)")
48
95
  .option("--lines <n>", "Number of lines to show in preview mode", "50")
96
+ .addHelpText("after", `
97
+ Examples:
98
+ $ pf-docs get tca/Articles/Testing # full article as markdown
99
+ $ pf-docs get sharing/Articles/SharingState # article from Sharing lib
100
+ $ pf-docs get tca/Articles/Testing --raw # no header, just content
101
+ $ pf-docs get tca/Articles/Testing --json # JSON with metadata
102
+ $ pf-docs get examples/CaseStudies/01-Basics-BindingBasics --preview
103
+ $ pf-docs get episodes/0290-CrossPlatformPt1 --preview --lines 100
104
+
105
+ Path format for docs: <library>/Articles/<ArticleName>
106
+ Path format for examples: examples/<AppName>/<FilePath>
107
+ Path format for episodes: episodes/<EpisodeName>/<FilePath>
108
+ Use 'pf-docs list <lib>' or search results to discover valid paths.
109
+ Code files (Swift) default to preview mode; use --raw for full content.`)
49
110
  .action(getCommand);
50
111
  program
51
112
  .command("list [lib]")
@@ -54,10 +115,28 @@ program
54
115
  .option("-j, --json", "Output as JSON")
55
116
  .option("-a, --available", "Show all libraries available to download")
56
117
  .option("-s, --source <source>", "Filter by source: docs, examples, episodes, all")
118
+ .addHelpText("after", `
119
+ Examples:
120
+ $ pf-docs list # list all indexed docs
121
+ $ pf-docs list tca # list TCA articles only
122
+ $ pf-docs list tca --tree # tree view of TCA docs
123
+ $ pf-docs list --source examples # list example app files
124
+ $ pf-docs list --source all # list everything
125
+ $ pf-docs list --available # show all downloadable libraries
126
+ $ pf-docs list --json # JSON output
127
+
128
+ Without arguments, lists all indexed documentation articles.
129
+ Paths in the output can be passed directly to 'pf-docs get'.`)
57
130
  .action(listCommand);
58
131
  program
59
132
  .command("stats")
60
133
  .description("Show indexing statistics")
61
134
  .option("-j, --json", "Output as JSON")
135
+ .addHelpText("after", `
136
+ Examples:
137
+ $ pf-docs stats # summary table
138
+ $ pf-docs stats --json # JSON output
139
+
140
+ Shows per-library document counts, total indexed articles, and index size.`)
62
141
  .action(statsCommand);
63
142
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pointfree-docs",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "CLI tool for searching Point-Free library documentation",
5
5
  "type": "module",
6
6
  "bin": {