docdex 0.1.3 → 0.1.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.5
4
+ - Publish the MCP-enabled CLI wrapper (use `docdex mcp` for MCP clients) and align docs with the new stdio mode.
5
+ - Keep npm version in sync with the MCP release for binary downloads.
6
+
7
+ ## 0.1.4
8
+ - Version bump for republish (0.1.3 already exists on npm).
9
+
3
10
  ## 0.1.3
4
11
  - Fixed npm trusted publishing configuration (environment + registry) and aligned version bump.
5
12
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 bekir dağ
3
+ Copyright (c) 2025 bekir dağ
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,53 +1,198 @@
1
- # Docdex CLI (npm)
1
+ # Docdex
2
2
 
3
- Docdex is a lightweight, local docs indexer/searcher. It builds and serves a per-repo index of your Markdown/text files—no external services, no uploads.
3
+ Docdex is a lightweight, local documentation indexer/search daemon. It runs per-project, keeps an on-disk index of your markdown/text docs, and serves top-k snippets over HTTP or CLI for any coding assistant or tool—no external services or uploads required.
4
4
 
5
- ## Install
5
+ ## Install via npm
6
+ - Requires Node.js >= 18.
7
+ - Install: `npm i -g docdex` (or run `npx docdex --version` to verify).
8
+ - Commands: `docdex` (alias `docdexd`) downloads the right binary for your platform from the matching GitHub release.
9
+ - Supported targets: macOS (arm64, x64), Linux glibc (arm64, x64), Linux musl (arm64, x64), Windows (x64, arm64); installer fetches the matching platform release asset.
10
+ - If you publish from a fork, set `DOCDEX_DOWNLOAD_REPO=<owner/repo>` before installing so the downloader fetches your release assets.
11
+ - Distribution: binaries stay in GitHub Releases (small npm package); postinstall fetches `docdexd-<platform>.tar.gz` matching the npm version.
12
+ - Publishing uses npm Trusted Publishing (OIDC) — no NPM token needed; see `.github/workflows/release.yml`.
13
+
14
+ ## Features at a glance
15
+ - Per-repo, local indexing of Markdown/text files (tantivy-backed; no network calls).
16
+ - HTTP API (`/search`, `/snippet`, `/healthz`) and CLI (`query`, `ingest`, `self-check`) share the same index.
17
+ - Live file watching while serving for incremental updates.
18
+ - Security knobs: TLS (manual certs or Certbot), auth token required by default (disable with `--secure-mode=false`), loopback-only allowlist by default, default rate limiting, request-size limits, strict state-dir perms, audit log, chroot/privilege drop/unshare net (Unix).
19
+ - Output ready for coding assistants: summaries, snippets, and doc metadata.
20
+ - AI-friendly: `GET /ai-help` returns a JSON playbook (endpoints, CLI commands, limits, best practices) for agents.
21
+
22
+ ## What it does
23
+ - Indexes Markdown/text docs inside a repo and stores them locally (tantivy-based index under `<repo>/.docdex/index` by default).
24
+ - Serves the same index over HTTP (`/search`, `/snippet`, `/healthz`) and via CLI (`query`, `ingest`, `self-check`), so automation and interactive use share one dataset.
25
+ - Watches files while serving to incrementally ingest changes.
26
+ - Hardened defaults: loopback binding, TLS enforcement on non-loopback, auth token required by default (disable with `--secure-mode=false`), loopback-only allowlist and default rate limit (60 req/min) in secure mode, and strict state-dir perms.
27
+
28
+ ## How it works
29
+ 1) `docdexd index` builds the on-disk index for your repo (or reuses a legacy `.gpt-creator/docdex/index` if present).
30
+ 2) `docdexd serve` loads that index, starts a file watcher for incremental updates, and exposes the HTTP API.
31
+ 3) HTTP clients or the CLI (`docdexd query`) read from the same index; `ingest` can update a single file without full reindexing.
32
+ 4) Optional TLS/auth/rate-limit settings secure remote access; audit logging can record access actions.
33
+
34
+ ## Quick start
6
35
  ```bash
7
- # Global install
36
+ # install (npm)
8
37
  npm i -g docdex
9
-
10
- # One-off use
38
+ # or use once
11
39
  npx docdex --version
40
+
41
+ # full index for a repo/workspace
42
+ docdexd index --repo /path/to/repo
43
+
44
+ # serve HTTP API with live file watching (secure mode requires an auth token)
45
+ docdexd serve --repo /path/to/repo --host 127.0.0.1 --port 46137 --log info --auth-token <token>
46
+ # for local, token-free use, add --secure-mode=false
47
+ # docdexd serve --repo /path/to/repo --host 127.0.0.1 --port 46137 --log info --secure-mode=false
48
+
49
+ # ad-hoc search via CLI (JSON)
50
+ docdexd query --repo /path/to/repo --query "otp flow" --limit 5
12
51
  ```
13
52
 
14
- ## Requirements
15
- - Node.js >= 18
16
- - Platforms: macOS (arm64, x64), Linux glibc (arm64, x64), Linux musl/Alpine (x64), Windows (x64). ARM64 Windows and Linux musl ARM64 can be added when artifacts are published.
53
+ ## Usage cheat sheet
54
+ - Build index: `docdexd index --repo <path>` (add `--exclude-*` to skip paths).
55
+ - Serve with watcher: `docdexd serve --repo <path> --host 127.0.0.1 --port 46137 --log warn --auth-token <token>` (secure mode also allowlists loopback and rate-limits by default; add `--allow-ip`/`--secure-mode=false`/`--rate-limit-per-min` as needed for remote use).
56
+ - Secure serving: add `--auth-token <token>` (required by default); use TLS with `--tls-cert/--tls-key` or `--certbot-domain <domain>`.
57
+ - Single-file ingest: `docdexd ingest --repo <path> --file docs/new.md` (honors excludes).
58
+ - Query via CLI: `docdexd query --repo <path> --query "term" --limit 4`.
59
+ - Health check: `curl http://127.0.0.1:46137/healthz`.
60
+ - Summary-only search responses: `curl "http://127.0.0.1:46137/search?q=foo&snippets=false"`; fetch snippets only for top hits.
61
+ - Token budgets: `curl "http://127.0.0.1:46137/search?q=foo&max_tokens=800"` to drop hits that would exceed your prompt budget; pair with `snippets=false` then fetch 1–2 snippets you keep.
62
+ - Text-only snippets: append `text_only=true` to `/snippet/:doc_id` or start `serve` with `--strip-snippet-html` (or `--disable-snippet-text` to return metadata only).
63
+ - Keep requests compact: defaults enforce `max_query_bytes=4096` and `max_request_bytes=16384`; keep queries short and leave `--max-limit` low (default 8) to avoid oversized responses.
64
+ - Prompt hygiene: in agent prompts, normalize whitespace and include only `rel_path`, `summary`, and trimmed `snippet` (omit `score`/`token_estimate`/`doc_id`).
65
+ - Trim noise early: use `--exclude-dir` and `--exclude-prefix` to keep vendor/build/cache/secrets out of the index so snippets stay relevant and short.
66
+ - Quiet logging for agents: run `docdexd serve --log warn --access-log=false` if you marshal responses elsewhere to cut log overhead.
67
+ - Cache hits client-side: store `doc_id` ↔ `rel_path` ↔ `summary` to avoid repeat snippet calls; fetch snippets only for new doc_ids.
68
+ - Agent help: `curl http://127.0.0.1:46137/ai-help` (requires auth if configured; include `Authorization: Bearer <token>` when you’ve set `--auth-token`).
17
69
 
18
- ## What this package does
19
- - Provides a tiny JS launcher (`docdex`/`docdexd`).
20
- - On install, downloads the prebuilt `docdexd` binary for your platform from the GitHub release that matches the npm package version, storing it under `dist/<platform>/docdexd`.
70
+ ## Versioning
71
+ - Semantic versioning with tagged releases (`vX.Y.Z`). The Rust crate and npm package share the same version.
72
+ - Conventional Commits drive release notes via Release Please; it opens release PRs that bump `Cargo.toml` and `npm/package.json`, update changelogs, and creates the tag/release on merge.
73
+ - Pin to a released version when integrating (e.g., in scripts or Dockerfiles) so upgrades are explicit and reversible.
74
+ - If you build from source, the version comes from `Cargo.toml` in this repo; the npm wrapper uses the matching version to fetch binaries.
21
75
 
22
- ## What Docdex does
23
- - Indexes Markdown/text files in your repo (tantivy-based) and stores the index locally.
24
- - Serves search/snippet APIs over HTTP (`/search`, `/snippet`, `/healthz`) and via CLI commands.
25
- - Watches files while serving to keep the index fresh.
26
- - Hardened defaults: loopback bind, optional TLS/auth token, rate limits, strict state-dir perms.
76
+ ## Paths and defaults
77
+ - State/index directory: `<repo>/.docdex/index` (if missing but legacy `<repo>/.gpt-creator/docdex/index` exists, Docdex will reuse it and warn). The directory is created with `0700` permissions by default.
78
+ - HTTP API: defaults to `127.0.0.1:46137` when serving.
79
+ - Docdex data and logs stay inside the repo; no external services.
27
80
 
28
- ## Quick usage
29
- ```bash
30
- # Check version
31
- docdex --version
81
+ ## Configuration knobs
82
+ - `--repo <path>`: workspace root to index (defaults to `.`).
83
+ - `--state-dir <path>` / `DOCDEX_STATE_DIR`: override index storage path (relative paths are resolved under `repo`).
84
+ - `--exclude-prefix a,b,c` / `DOCDEX_EXCLUDE_PREFIXES`: extra relative prefixes to skip.
85
+ - `--exclude-dir a,b,c` / `DOCDEX_EXCLUDE_DIRS`: extra directory names to skip anywhere in the tree.
86
+ - `--auth-token <token>` / `DOCDEX_AUTH_TOKEN`: bearer token required in secure mode (default); omit only when starting with `--secure-mode=false`.
87
+ - `--secure-mode <true|false>` / `DOCDEX_SECURE_MODE`: default `true`; when enabled, requires an auth token, loopback allowlist by default, and default rate limiting (60 req/min).
88
+ - `--allow-ip a,b,c` / `DOCDEX_ALLOW_IPS`: optional comma-separated IPs/CIDRs allowed to reach the HTTP API (default: loopback-only in secure mode; allow all when secure mode is disabled).
89
+ - `--tls-cert` / `DOCDEX_TLS_CERT` and `--tls-key` / `DOCDEX_TLS_KEY`: serve HTTPS with the provided cert/key. With TLS enforcement on, non-loopback binds must use HTTPS unless you explicitly opt out.
90
+ - `--certbot-domain <domain>` / `DOCDEX_CERTBOT_DOMAIN`: point TLS at `/etc/letsencrypt/live/<domain>/{fullchain.pem,privkey.pem}` (Certbot). Conflicts with manual `--tls-*`.
91
+ - `--certbot-live-dir <path>` / `DOCDEX_CERTBOT_LIVE_DIR`: use a specific Certbot live dir containing `fullchain.pem` and `privkey.pem`.
92
+ - `--require-tls <true|false>` / `DOCDEX_REQUIRE_TLS`: default `true`. Enforce TLS for non-loopback binds; set to `false` when TLS is already terminated by a trusted proxy.
93
+ - `--insecure` / `DOCDEX_INSECURE_HTTP=true`: allow plain HTTP on non-loopback binds even when TLS is enforced (only use behind a trusted proxy).
94
+ - `--max-limit <n>` / `DOCDEX_MAX_LIMIT`: clamp HTTP `limit` to at most `n` (default: 8).
95
+ - `--max-query-bytes <n>` / `DOCDEX_MAX_QUERY_BYTES`: reject requests whose query string exceeds `n` bytes (default: 4096).
96
+ - `--max-request-bytes <n>` / `DOCDEX_MAX_REQUEST_BYTES`: reject requests whose Content-Length or size hint exceeds `n` bytes (default: 16384).
97
+ - `--rate-limit-per-min <n>` / `DOCDEX_RATE_LIMIT_PER_MIN`: per-IP request budget per minute (default 60 in secure mode when unset/0; 0 disables when secure mode is off).
98
+ - `--rate-limit-burst <n>` / `DOCDEX_RATE_LIMIT_BURST`: optional burst capacity for the rate limiter (defaults to per-minute limit when 0).
99
+ - `--audit-log-path <path>` / `DOCDEX_AUDIT_LOG_PATH`: write audit log JSONL to this path (default: `<state-dir>/audit.log`).
100
+ - `--audit-max-bytes <n>` / `DOCDEX_AUDIT_MAX_BYTES`: rotate audit log after this many bytes (default: 5_000_000).
101
+ - `--audit-max-files <n>` / `DOCDEX_AUDIT_MAX_FILES`: keep at most this many rotated audit files (default: 5).
102
+ - `--audit-disable` / `DOCDEX_AUDIT_DISABLE=true`: disable audit logging entirely.
103
+ - `--strip-snippet-html` / `DOCDEX_STRIP_SNIPPET_HTML=true`: omit `snippet.html` in responses to force text-only snippets (HTML is sanitized by default when present).
104
+ - `--disable-snippet-text` / `DOCDEX_DISABLE_SNIPPET_TEXT=true`: omit snippet text/html in responses entirely (only doc metadata is returned).
105
+ - `--access-log <true|false>` / `DOCDEX_ACCESS_LOG`: emit minimal structured access logs with query values redacted (default: true).
106
+ - `--run-as-uid` / `DOCDEX_RUN_AS_UID`, `--run-as-gid` / `DOCDEX_RUN_AS_GID`: (Unix) drop privileges to the provided UID/GID after startup prep.
107
+ - `--chroot <path>` / `DOCDEX_CHROOT`: (Unix) chroot into `path` before serving; repo/state paths must exist inside that jail.
108
+ - `--unshare-net` / `DOCDEX_UNSHARE_NET=true`: (Linux only) unshare the network namespace before serving (requires CAP_SYS_ADMIN/root); no-op on other platforms.
109
+ - Logging: `--log <level>` on `serve` (defaults to `info`), or `RUST_LOG=docdexd=debug` style filters.
110
+ - Secure mode defaults: when `--secure-mode=true` (default), docdex requires an auth token, allows only loopback IPs unless overridden, and applies a 60 req/min rate limit. Set `--secure-mode=false` to opt out for local dev and adjust `--allow-ip`/rate limits as needed.
32
111
 
33
- # Build an index
34
- docdexd index --repo /path/to/repo
112
+ ## Indexing rules (see `index/mod.rs`)
113
+ - File types: `.md`, `.markdown`, `.mdx`, `.txt` (extend `DEFAULT_EXTENSIONS` to add more).
114
+ - Skipped directories: broad VCS/build/cache/vendor folders across ecosystems (e.g., `.git`, `.hg`, `.svn`, `node_modules`, `.pnpm-store`, `.yarn*`, `.nx`, `.rollup-cache`, `.webpack-cache`, `.tsbuildinfo`, `.next`, `.nuxt`, `.svelte-kit`, `.mypy_cache`, `.ruff_cache`, `.venv`, `target`, `go-build`, `.gradle`, `.mvn`, `pods`, `.dart_tool`, `.android`, `.serverless`, `.vercel`, `.netlify`, `_build`, `_opam`, `.stack-work`, `elm-stuff`, `library`, `intermediate`, `.godot`, etc.; see `DEFAULT_EXCLUDED_DIR_NAMES` for the full list).
115
+ - Skipped relative prefixes: `logs/`, `.docdex/`, `.docdex/logs/`, `.docdex/tmp/`, `.gpt-creator/logs/`, `.gpt-creator/tmp/`, `.mastercoda/logs/`, `.mastercoda/tmp/`, `docker/.data/`, `docker-data/`, `.docker/`.
116
+ - Snippet sizing: summaries ~360 chars (up to 4 segments); snippets ~420 chars.
35
117
 
36
- # Serve HTTP API with live watching
37
- docdexd serve --repo /path/to/repo --host 127.0.0.1 --port 46137 --log info
118
+ ## HTTP API
119
+ - `GET /healthz` returns `ok`; this endpoint is unauthenticated and not rate-limited (IP allowlist still applies).
120
+ - `GET /search?q=<text>&limit=<n>&snippets=<bool>&max_tokens=<u64>` — returns `{ hits: [...] }` with doc id, rel path, summary, snippet, score, token estimate. Set `snippets=false` for summary-only responses; set `max_tokens` to drop hits above your budget.
121
+ - `GET /snippet/:doc_id?window=<lines>&q=<query>&text_only=<bool>&max_tokens=<u64>` — returns `{ doc, snippet }` with optional highlighted snippet; falls back to preview when query highlighting is empty (default window: 40 lines). Set `text_only=true` to drop HTML and shrink payloads; set `max_tokens` to omit the snippet if the doc exceeds your budget.
122
+ - `GET /ai-help` — returns a JSON quickstart for agents (endpoints, CLI commands, limits, best practices).
123
+ - `GET /metrics` — returns Prometheus-style counters for rate-limit/auth/error metrics.
124
+ - If `--auth-token` is set, include `Authorization: Bearer <token>` on HTTP calls (including `/ai-help`).
38
125
 
39
- # Ad-hoc search via CLI (JSON)
40
- docdexd query --repo /path/to/repo --query "otp flow" --limit 5
126
+ ## CLI commands
127
+ - `serve --repo <path> [--host 127.0.0.1] [--port 46137] [--log info]` — start HTTP API with file watching for incremental updates.
128
+ - `index --repo <path>` — rebuild the entire index.
129
+ - `ingest --repo <path> --file <file>` — reindex a single file.
130
+ - `query --repo <path> --query "<text>" [--limit 8]` — run a search and print JSON hits.
131
+ - `self-check --repo <path> --terms "foo,bar" [--limit 5]` — scan the index for sensitive terms before enabling access (fails with non-zero exit if any are found; reports sample hits and if more exist). Includes built-in token/password patterns by default; disable with `--include-default-patterns=false` if you only want your provided terms.
132
+
133
+ ## Help and command discovery
134
+ - List all commands/flags: `docdexd --help`.
135
+ - Dump help for every subcommand: `docdexd help-all`.
136
+ - See `serve` options (TLS, auth, rate limits, watcher): `docdexd serve --help`.
137
+ - Indexing options: `docdexd index --help` (exclude paths, custom state dir).
138
+ - Ad-hoc queries: `docdexd query --help`.
139
+ - Self-check scanner options: `docdexd self-check --help`.
140
+ - Agent help endpoint: `curl http://127.0.0.1:46137/ai-help` (include `Authorization: Bearer <token>` if `--auth-token` is set) for a JSON listing of endpoints, limits, and best practices.
141
+ - Environment variables mirror the flags (e.g., `DOCDEX_AUTH_TOKEN`, `DOCDEX_TLS_CERT`, `DOCDEX_MAX_LIMIT`).
142
+ - Command overview (same as `docdexd --help`):
143
+ - `serve` — run HTTP API with watcher and security knobs.
144
+ - `index` — build or rebuild the whole index.
145
+ - `ingest` — reindex a single file.
146
+ - `query` — run an ad-hoc search, JSON to stdout.
147
+ - `self-check` — scan index for sensitive terms with report.
148
+ - `help-all` — print help for every command/flag in one output.
149
+
150
+ ## Troubleshooting
151
+ - Stale index: re-run `docdexd index --repo <path>`.
152
+ - Port conflicts: change `--host/--port`.
153
+
154
+ ## Security considerations
155
+ - Default bind is `127.0.0.1`; keep it unless you are behind a trusted reverse proxy/firewall. Avoid `--host 0.0.0.0` on untrusted networks.
156
+ - By default, non-loopback binds require TLS; opt out only with `--require-tls=false` or `--insecure` when traffic is already terminating at a trusted proxy.
157
+ - If exposing externally, place a reverse proxy in front, terminate TLS, and require auth (basic/OAuth/mTLS) plus IP/VPN allowlisting. Example (nginx):
158
+ ```
159
+ server {
160
+ listen 443 ssl;
161
+ server_name docdex.example.com;
162
+ ssl_certificate /path/fullchain.pem;
163
+ ssl_certificate_key /path/privkey.pem;
164
+ auth_basic "Protected";
165
+ auth_basic_user_file /etc/nginx/.htpasswd; # or hook OAuth/mTLS instead
166
+ allow 10.0.0.0/8;
167
+ allow 192.168.0.0/16;
168
+ deny all;
169
+ location / {
170
+ proxy_pass http://127.0.0.1:46137;
171
+ proxy_set_header Host $host;
172
+ }
173
+ }
174
+ ```
175
+ - Trim the corpus: prefer a curated staging directory, or use `--exclude-dir` / `--exclude-prefix` to keep secrets/private paths out before indexing; the watcher will ingest any in-scope file change under `repo`.
176
+ - Mind logs: avoid verbose logging in production if snippets/paths are sensitive; reverse-proxy access logs can also capture query terms and paths.
177
+ - Least privilege: run docdex under a low-privilege user/container and keep the state dir on a path with restricted permissions.
178
+ - Validate before publish: run `docdexd query` for sensitive keywords to confirm no hits; store indexes on encrypted disks if required.
179
+ - Optional hardening: require an auth token on the HTTP API (or proxy); enforce TLS when not on localhost (default) or explicitly opt out with `--require-tls=false`/`--insecure` only behind a trusted proxy; enable rate limiting (`--rate-limit-per-min`) and clamp `limit`/request sizes (`--max-limit`, `--max-query-bytes`, `--max-request-bytes`); escape/sanitize snippet HTML if embedding or disable snippets entirely with `--disable-snippet-text`; state dir is created `0700` by default—keep it under an unprivileged user, optionally `--run-as-uid/--run-as-gid`, `--chroot`, or containerize; keep access logging minimal/redacted (`--access-log`), and run `self-check` for sensitive terms before exposing the service; for at-rest confidentiality, place the state dir on encrypted storage or use host-level disk encryption.
180
+
181
+ ## Integrating with LLM tools
182
+ Docdex is tool-agnostic. Drop-in recipe for agents/codegen tools:
183
+ - Start once per repo: `docdexd index --repo <repo>` then `docdexd serve --repo <repo> --host 127.0.0.1 --port 46137 --log warn` (or use the CLI directly without serving).
184
+ - Configure via env: `DOCDEX_STATE_DIR` (index location), `DOCDEX_EXCLUDE_PREFIXES`, `DOCDEX_EXCLUDE_DIRS`, `RUST_LOG=docdexd=debug` (optional verbose logs).
185
+ - Query over HTTP: `GET /search?q=<text>&limit=<n>` returns `{"hits":[{"doc_id","rel_path","score","summary","snippet","token_estimate"}...]}`; `GET /snippet/:doc_id` fetches a focused snippet plus doc metadata.
186
+ - Or query via CLI: `docdexd query --repo <repo> --query "<text>" --limit 8` (JSON to stdout).
187
+ - Health check: `GET /healthz` should return `ok` before issuing search requests.
188
+ - Inject snippets into prompts:
189
+ ```
190
+ "You are building features for this repo. Use the following documentation snippets for context. If a snippet cites a path, keep that path in your response. Snippets:\n<insert docdex snippets here>\nQuestion: <your question>"
41
191
  ```
42
192
 
43
- ## Environment overrides (optional)
44
- - `DOCDEX_DOWNLOAD_REPO` `owner/repo` slug hosting release assets (defaults to the linked GitHub repo).
45
- - `DOCDEX_DOWNLOAD_BASE` custom base URL for release downloads (defaults to `https://github.com/<repo>/releases/download`).
46
- - `DOCDEX_VERSION` override version/tag to download (for testing).
47
- - `DOCDEX_LIBC` force `gnu` or `musl` on Linux if auto-detection is wrong.
48
- - `DOCDEX_GITHUB_TOKEN` token for authenticated GitHub downloads (avoids rate limits/private releases).
49
-
50
- ## Notes
51
- - Release assets are expected to be named `docdexd-<platform>.tar.gz` with a matching `.sha256`.
52
- - License: MIT (see `LICENSE`).
53
- - Changelog: see `CHANGELOG.md`.
193
+ ## HTTPS and Certbot
194
+ - TLS accepts PKCS8, PKCS1/RSA, and SEC1/EC private keys (compatible with Certbot output).
195
+ - Manual cert/key: `docdexd serve --repo <repo> --tls-cert /path/fullchain.pem --tls-key /path/privkey.pem`.
196
+ - Certbot helper: `docdexd serve --repo <repo> --host 0.0.0.0 --port 46137 --certbot-domain docs.example.com` (uses `/etc/letsencrypt/live/docs.example.com/{fullchain.pem,privkey.pem}`), or pass `--certbot-live-dir /custom/live/dir`.
197
+ - When using Certbot, set a deploy hook to restart/reload docdex after renewals (e.g., `certbot renew --deploy-hook "systemctl restart docdexd.service"` or kill -HUP your process supervisor).
198
+ - If binding to 443 directly, you need privileges; otherwise, keep docdex on 127.0.0.1 and let a reverse proxy terminate TLS.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docdex",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Docdex CLI as an npm-installable binary wrapper.",
5
5
  "bin": {
6
6
  "docdex": "bin/docdex.js",
@@ -21,7 +21,8 @@
21
21
  },
22
22
  "os": [
23
23
  "darwin",
24
- "linux"
24
+ "linux",
25
+ "win32"
25
26
  ],
26
27
  "cpu": [
27
28
  "arm64",