@dccxx/auggiegw 1.0.21 → 1.0.22

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 (3) hide show
  1. package/CLAUDE.md +6 -7
  2. package/dist/cli.js +10 -35
  3. package/package.json +1 -1
package/CLAUDE.md CHANGED
@@ -95,10 +95,13 @@ When `--refresh-commands` is provided:
95
95
  3. Saves the fetched prompts to `~/.augment/commands/`
96
96
 
97
97
  When `--refresh-commands` is NOT provided (default):
98
- - Skips prompt fetching entirely for faster operation
99
- - Only performs authentication
98
+ 1. Fetches all prompts from the API using `getAllPrompts()`
99
+ 2. Saves/overwrites prompts to `~/.augment/commands/` (existing files are overwritten)
100
+ 3. Does NOT delete local commands that aren't on the server
100
101
 
101
- The `--auth-only` flag takes precedence over `--refresh-commands` (if both are provided, prompts are skipped).
102
+ The key difference: `--refresh-commands` does a full clean sync (deletes all local first), while the default only syncs server prompts to local without removing extra local files.
103
+
104
+ The `--auth-only` flag takes precedence and skips all prompt operations.
102
105
 
103
106
  ### Account Switching Logic (lines 714-770)
104
107
 
@@ -121,10 +124,6 @@ type: "manual"
121
124
  {prompt.content}
122
125
  ```
123
126
 
124
- ### Auto-Fix Commands on Fetch
125
-
126
- When running `fetch` (without `--auth-only`), the CLI automatically fixes existing command files by adding `type: "manual"` if missing. This happens after authentication and before the success message.
127
-
128
127
  ### Authentication Token Resolution (lines 197-205)
129
128
 
130
129
  `getAuthToken()` checks environment variable `AUGGIEGW_AUTH_TOKEN` first, then falls back to reading from `~/.auggiegw/auth.json`.
package/dist/cli.js CHANGED
@@ -2348,35 +2348,6 @@ async function deleteAllCommandFiles() {
2348
2348
  }
2349
2349
  return mdFiles.length;
2350
2350
  }
2351
- async function fixCommandFiles() {
2352
- try {
2353
- await fs.access(AUGMENT_COMMANDS_DIR);
2354
- } catch {
2355
- return 0;
2356
- }
2357
- const files = await fs.readdir(AUGMENT_COMMANDS_DIR);
2358
- const mdFiles = files.filter((file) => file.endsWith(".md"));
2359
- let updatedCount = 0;
2360
- for (const file of mdFiles) {
2361
- const filePath = path.join(AUGMENT_COMMANDS_DIR, file);
2362
- const content = await fs.readFile(filePath, "utf-8");
2363
- if (content.startsWith("---")) {
2364
- const endOfFrontmatter = content.indexOf("---", 3);
2365
- if (endOfFrontmatter !== -1) {
2366
- const frontmatter = content.substring(0, endOfFrontmatter + 3);
2367
- const body = content.substring(endOfFrontmatter + 3);
2368
- if (!frontmatter.includes("type:")) {
2369
- const updatedFrontmatter = frontmatter.replace(/^(---\n(?:.*\n)*?)(description:[^\n]*\n)/m, `$1$2type: "manual"
2370
- `);
2371
- const updatedContent = updatedFrontmatter + body;
2372
- await fs.writeFile(filePath, updatedContent, "utf-8");
2373
- updatedCount++;
2374
- }
2375
- }
2376
- }
2377
- }
2378
- return updatedCount;
2379
- }
2380
2351
  async function promptInput(question, hidden = false) {
2381
2352
  const rl = readline.createInterface({
2382
2353
  input: process.stdin,
@@ -2623,12 +2594,16 @@ async function handleFetch(options) {
2623
2594
  spinner.warn(`Deleted ${deletedCount} commands, no new prompts found`);
2624
2595
  }
2625
2596
  } else {
2626
- spinner.text = "Fixing existing command files...";
2627
- const fixedCount = await fixCommandFiles();
2628
- if (fixedCount > 0) {
2629
- spinner.succeed(`Authentication successful, fixed ${fixedCount} command file(s) with type: "manual"`);
2597
+ spinner.text = "Fetching prompts from server...";
2598
+ const allPrompts = await getAllPrompts(token, config.apiUrl, spinner);
2599
+ if (allPrompts.length > 0) {
2600
+ spinner.text = `Saving ${allPrompts.length} prompts...`;
2601
+ for (const prompt of allPrompts) {
2602
+ await savePromptToFile(prompt);
2603
+ }
2604
+ spinner.succeed(`Successfully synced ${allPrompts.length} prompts from server`);
2630
2605
  } else {
2631
- spinner.succeed("Authentication successful (use --refresh-commands to update prompts)");
2606
+ spinner.succeed("Authentication successful (no prompts found on server)");
2632
2607
  }
2633
2608
  }
2634
2609
  }
@@ -2729,4 +2704,4 @@ program2.command("exec <command> [args...]").description("Execute any custom com
2729
2704
  program2.command("switch-account").description("Switch to a newer account from the purchased account list").action(handleSwitchAccount);
2730
2705
  program2.parse();
2731
2706
 
2732
- //# debugId=64FF217361AEBDF264756E2164756E21
2707
+ //# debugId=31D9A45346BDA22864756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dccxx/auggiegw",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "A Node.js TypeScript package",
5
5
  "main": "./dist/cli.js",
6
6
  "types": "./dist/cli.d.ts",