Skip to content
This repository was archived by the owner on Feb 14, 2026. It is now read-only.

Commit db388c4

Browse files
v0.9.1: Remove global config feature
Global ~/.refdocs/ config was invisible to LLM agents working in local projects, making it dead weight. All -g/--global flags, global config functions, and global tests removed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 283456c commit db388c4

7 files changed

Lines changed: 41 additions & 340 deletions

File tree

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@ The manifest (`.refdocs/manifest.json`) gives your agent a ~500 token map of all
4141
```bash
4242
# Setup
4343
refdocs init # create .refdocs/config.json with defaults
44-
refdocs init -g # create global config at ~/.refdocs/
4544

4645
# Add sources
4746
refdocs add ./docs # local directory
4847
refdocs add https://github.com/org/repo # GitHub repo (downloads markdown files)
49-
refdocs add <source> -g # add to global ~/.refdocs/ store
5048

5149
# Catalog
5250
refdocs manifest # generate the manifest
@@ -98,15 +96,6 @@ refdocs remove docs/laravel # remove a path from config
9896

9997
GitHub sources are tracked in `.refdocs/config.json` and can be re-pulled with `refdocs update`.
10098

101-
## Global docs
102-
103-
Use `-g` / `--global` to store docs in `~/.refdocs/` — useful for references you want across all projects.
104-
105-
```bash
106-
refdocs init -g
107-
refdocs add https://github.com/org/docs -g
108-
```
109-
11099
## Configuration
111100

112101
`.refdocs/config.json` at project root:

docs/cli-reference.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CLI Reference
22

3-
## Global options
3+
## Options
44

55
```
66
refdocs --help Show help
@@ -15,18 +15,11 @@ Create a `.refdocs/config.json` config file with default settings.
1515

1616
```bash
1717
refdocs init
18-
refdocs init -g
1918
```
2019

21-
**Options:**
22-
23-
| Flag | Description |
24-
|------|-------------|
25-
| `-g, --global` | Create global config at `~/.refdocs/` |
26-
2720
**Behavior:**
2821

29-
- Creates `.refdocs/config.json` in the current directory (or `~/.refdocs/config.json` with `-g`)
22+
- Creates `.refdocs/config.json` in the current directory
3023
- Includes all default values: `paths`, `manifest`
3124
- If `.refdocs/config.json` already exists, exits with an error
3225

@@ -40,15 +33,8 @@ Generate the documentation manifest from all markdown files in configured paths.
4033

4134
```bash
4235
refdocs manifest
43-
refdocs manifest -g
4436
```
4537

46-
**Options:**
47-
48-
| Flag | Description |
49-
|------|-------------|
50-
| `-g, --global` | Generate manifest for global config |
51-
5238
**Output:**
5339

5440
```
@@ -71,15 +57,8 @@ List all documented files and their heading counts.
7157

7258
```bash
7359
refdocs list
74-
refdocs list -g
7560
```
7661

77-
**Options:**
78-
79-
| Flag | Description |
80-
|------|-------------|
81-
| `-g, --global` | List global documented files |
82-
8362
**Output:**
8463

8564
```
@@ -110,9 +89,6 @@ refdocs add ./my-docs --no-manifest
11089
refdocs add https://github.com/laravel/docs --branch 11.x
11190
refdocs add https://github.com/statamic/docs/tree/6.x/content
11291
refdocs add https://github.com/owner/repo --path docs/custom --no-manifest
113-
114-
# Global
115-
refdocs add https://github.com/org/docs -g
11692
```
11793

11894
**Arguments:**
@@ -128,7 +104,6 @@ refdocs add https://github.com/org/docs -g
128104
| `--path <dir>` | `docs/{owner}/{repo}` | Override local storage directory (GitHub URLs only) |
129105
| `--branch <branch>` | from URL or `HEAD` | Override branch detection (GitHub URLs only) |
130106
| `--no-manifest` | `false` | Skip auto manifest generation after adding |
131-
| `-g, --global` | `false` | Store docs in global `~/.refdocs/` directory |
132107

133108
**Local paths:**
134109

@@ -174,7 +149,6 @@ Remove a path from the configuration.
174149
```bash
175150
refdocs remove docs/laravel
176151
refdocs remove ./my-docs --no-manifest
177-
refdocs remove docs/laravel -g
178152
```
179153

180154
**Arguments:**
@@ -188,7 +162,6 @@ refdocs remove docs/laravel -g
188162
| Flag | Default | Description |
189163
|------|---------|-------------|
190164
| `--no-manifest` | `false` | Skip auto manifest generation after removal |
191-
| `-g, --global` | `false` | Remove from global config |
192165

193166
**Behavior:**
194167

@@ -210,15 +183,13 @@ Re-pull all tracked sources from GitHub and regenerate the manifest.
210183
```bash
211184
refdocs update
212185
refdocs update --no-manifest
213-
refdocs update -g
214186
```
215187

216188
**Options:**
217189

218190
| Flag | Default | Description |
219191
|------|---------|-------------|
220192
| `--no-manifest` | `false` | Skip auto manifest generation after update |
221-
| `-g, --global` | `false` | Update global sources |
222193

223194
**Output:**
224195

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dynamik-dev/refdocs",
3-
"version": "0.9.0",
3+
"version": "0.9.1",
44
"type": "module",
55
"description": "Local CLI tool that fetches, organizes, and catalogs markdown documentation for LLM-assisted development",
66
"main": "dist/index.js",

src/config.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "node:fs";
22
import { join, dirname, resolve } from "node:path";
3-
import { homedir } from "node:os";
43
import type { RefdocsConfig } from "./types.js";
54

65
export const CONFIG_DIR_NAME = ".refdocs";
@@ -108,32 +107,3 @@ export function saveConfig(config: Partial<RefdocsConfig>, configDir: string): v
108107
const merged = { ...existing, ...config };
109108
writeFileSync(configPath, JSON.stringify(merged, null, 2) + "\n", "utf-8");
110109
}
111-
112-
export function getGlobalConfigDir(globalDir?: string): string {
113-
return globalDir ?? join(homedir(), ".refdocs");
114-
}
115-
116-
export function initGlobalConfig(globalDir?: string): void {
117-
const dir = getGlobalConfigDir(globalDir);
118-
mkdirSync(dir, { recursive: true });
119-
const configPath = join(dir, CONFIG_FILENAME);
120-
if (existsSync(configPath)) return;
121-
writeFileSync(configPath, JSON.stringify(DEFAULT_CONFIG, null, 2) + "\n", "utf-8");
122-
}
123-
124-
export function loadGlobalConfig(globalDir?: string): ConfigResult | null {
125-
const dir = getGlobalConfigDir(globalDir);
126-
const configPath = join(dir, CONFIG_FILENAME);
127-
if (!existsSync(configPath)) return null;
128-
try {
129-
const raw = JSON.parse(readFileSync(configPath, "utf-8"));
130-
const errors = validateConfig(raw);
131-
if (errors.length > 0) return null;
132-
return {
133-
config: mergeWithDefaults(raw),
134-
configDir: dir,
135-
};
136-
} catch {
137-
return null;
138-
}
139-
}

0 commit comments

Comments
 (0)