@dev_desh/flux-cap 0.3.0 → 0.6.0

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +139 -82
  3. package/dist/index.js +240 -151
  4. package/package.json +3 -2
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kaustubh Deshpande
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -29,34 +29,47 @@ flux init
29
29
  ```
30
30
  *Interactive setup will ask about your privacy preferences*
31
31
 
32
- ### 2. Start capturing thoughts
32
+ ### 2. Start capturing thoughts with tags
33
33
  ```bash
34
+ # Basic brain dumps
34
35
  flux dump "remember to add error handling to auth module"
35
36
  flux dump "bug in user validation - check line 42"
36
- flux dump "idea: add dark mode toggle"
37
+
38
+ # Tagged brain dumps for better organization
39
+ flux dump -i "add dark mode toggle" # Ideas
40
+ flux dump -n "team meeting at 3pm tomorrow" # Notes
41
+ flux dump -t "refactor payment processing logic" # Tasks
37
42
  ```
38
43
 
39
44
  ### 3. Search your brain dumps
45
+
46
+ ![https://github.com/kaustubh285/flux-cap/blob/main/images/v0.6-search-output.png](https://github.com/kaustubh285/flux-cap/blob/main/images/v0.6-search-output.png)
47
+
40
48
  ```bash
41
49
  # Search with a query
42
- flux search "auth"
50
+ flux search auth
51
+
52
+ # Search by tags (when implemented in search)
53
+ flux search ideas
54
+ flux search tasks
43
55
 
44
56
  # List recent dumps (no query)
45
57
  flux search
46
58
  ```
47
59
 
48
-
49
60
  ## Features
50
61
 
51
- ### Brain Dump System
62
+ ### Brain Dump System with Smart Tags
52
63
  - Instantly capture thoughts without breaking flow: `flux dump "fix auth validation bug"`
64
+ - **Tag system** for better organization: `-i` for ideas, `-n` for notes, `-t` for tasks
53
65
  - Git-aware context tracking (branch, working directory, uncommitted changes)
54
66
  - Monthly file organization for easy browsing
55
67
  - Privacy-first design - you control what gets tracked
56
68
 
57
- ### Search
69
+ ### Intelligent Search
58
70
  - Fuzzy search across all your brain dumps: `flux search "auth"`
59
- - Configurable search fields (message, branch, working directory)
71
+ - **Tag-aware searching** for filtering by type
72
+ - Configurable search fields (message, branch, working directory, tags)
60
73
  - Result ranking with relevance scores
61
74
  - Multi-month search with automatic limits
62
75
 
@@ -78,89 +91,101 @@ flux search
78
91
  - No need to initialize in every subfolder - works project-wide
79
92
  - Seamlessly handles monorepos and complex project structures
80
93
 
81
-
82
94
  ## Commands
83
95
 
84
96
  | Command | Description | Example |
85
97
  |---------|-------------|---------|
86
98
  | `flux init` | Initialize flux-cap with privacy setup | `flux init` |
87
99
  | `flux dump <message...>` | Capture a brain dump | `flux dump "fix the bug in auth.ts"` |
100
+ | `flux dump -i <message...>` | Capture important | `flux dump -i "add keyboard shortcuts"` |
101
+ | `flux dump -d <message...>` | Capture an idea | `flux dump -d "a new cli tool project"` |
102
+ | `flux dump -l <message...>` | Capture a link | `flux dump -l "https://github.com/kaustubh285/flux-cap"` |
103
+ | `flux dump -b <message...>` | Capture a bug | `flux dump -b "tsconfig mismatch"` |
104
+ | `flux dump -n <message...>` | Capture a note | `flux dump -n "meeting notes from standup"` |
105
+ | `flux dump -t <message...>` | Capture a task | `flux dump -t "refactor user authentication"` |
106
+ | `flux dump -m` | Multiline input mode | `flux dump -m` |
88
107
  | `flux search [query...]` | Search brain dumps or list recent ones | `flux search "authentication"` |
89
- | `flux config <fields...>` | View or update configuration | `flux config` |
108
+ | `flux config [field] [value]` | View or update configuration | `flux config search.resultLimit 20` |
109
+ | `flux config --add-tag <tag>` | Add custom tags to configuration | `flux config --add-tag "bug"` |
110
+ | `flux config --remove-tag <tag>` | Remove tags from configuration | `flux config --remove-tag "old-tag"` |
90
111
  | `flux reset` | Complete reset (deletes all data) | `flux reset` |
91
112
 
92
- ## Use Cases
113
+ ## Tag System
93
114
 
94
- ### Context Switching
95
- ```bash
96
- # Before switching tasks
97
- flux dump "was working on user auth, next: add validation to login form"
115
+ ### Built-in Tags
116
+ flux-cap comes with three built-in tag shortcuts:
117
+ - **`-i, --ideas`** - For capturing ideas and inspiration
118
+ - **`-n, --notes`** - For general notes and reminders
119
+ - **`-t, --tasks`** - For tasks and todos
98
120
 
99
- # After interruption
100
- flux search "auth" # Quickly find where you left off
101
- ```
102
-
103
- ### Bug Tracking
121
+ ### Custom Tags (via config)
122
+ Extend your tagging system by adding custom tags for brain dumps:
104
123
  ```bash
105
- flux dump "weird bug in payment flow - users can't checkout"
106
- flux dump "bug seems related to session timeout"
107
-
108
- # Later...
109
- flux search "payment bug"
124
+ # Built-in shortcuts (current)
125
+ flux dump -i "idea message"
126
+ flux dump -n "note message"
127
+ flux dump -t "task message"
128
+
129
+ # Generic tag option (new)
130
+ flux dump --tag thought "my message"
131
+ flux dump --tag bug "found an issue"
132
+ flux dump --tag meeting "standup notes"
110
133
  ```
111
134
 
112
- ### Idea Capture
135
+ ### Tag Examples
113
136
  ```bash
114
- flux dump "idea: add keyboard shortcuts to dashboard"
115
- flux dump "maybe use React.memo for performance optimization"
116
- ```
137
+ # Ideas for future features
138
+ flux dump -i "add real-time collaboration to the editor"
139
+ flux dump -i "implement auto-save every 30 seconds"
117
140
 
118
- ## Automated Versioning
141
+ # Meeting notes and reminders
142
+ flux dump -n "team decided to use TypeScript for new components"
143
+ flux dump -n "remember to update documentation before release"
119
144
 
120
- flux-cap uses [Changesets](https://github.com/changesets/changesets) for automated semantic versioning:
145
+ # Task tracking
146
+ flux dump -t "fix memory leak in image processor"
147
+ flux dump -t "write unit tests for authentication module"
121
148
 
122
- ### What happens when you merge a PR:
123
- 1. **Automatic Analysis**: GitHub Actions analyzes your PR changes
124
- 2. **Smart Version Bumping**: Determines appropriate version (major/minor/patch) based on:
125
- - PR title and description
126
- - Commit messages
127
- - Files changed
128
- 3. **Changelog Generation**: Creates detailed changelog entries
129
- 4. **Version Updates**: Updates `package.json` automatically
130
- 5. **Git Integration**: Commits changes back to main branch
149
+ # Combine with multiline for detailed entries
150
+ flux dump -t -m # Opens editor for detailed task description
151
+ ```
131
152
 
132
- ### Version Bump Rules:
133
- - **Major** (`1.0.0 → 2.0.0`): Breaking changes, removed features, incompatible API changes
134
- - **Minor** (`1.0.0 → 1.1.0`): New features, new commands, backwards-compatible enhancements
135
- - **Patch** (`1.0.0 → 1.0.1`): Bug fixes, documentation updates, refactoring, performance improvements
153
+ ## Use Cases
136
154
 
137
- ### Manual Changesets:
155
+ ### Context Switching
138
156
  ```bash
139
- # Add a changeset manually (if needed)
140
- bun run changeset
157
+ # Before switching tasks
158
+ flux dump -t "was working on user auth, next: add validation to login form"
141
159
 
142
- # Check pending changesets
143
- bun run changeset:status
160
+ # After interruption
161
+ flux search "auth" # Quickly find where you left off
162
+ flux search "tasks" # Find your pending tasks
163
+ ```
144
164
 
145
- # Apply version changes locally
146
- bun run changeset:version
165
+ ### Bug Tracking & Ideas
166
+ ```bash
167
+ # Track bugs and investigations
168
+ flux dump -n "weird bug in payment flow - users can't checkout"
169
+ flux dump -n "bug seems related to session timeout - check Redis config"
147
170
 
148
- ## Development
171
+ # Capture ideas as they come
172
+ flux dump -i "add keyboard shortcuts to dashboard"
173
+ flux dump -i "maybe use React.memo for performance optimization"
149
174
 
150
- Want to contribute or run locally?
175
+ # Later...
176
+ flux search "payment bug"
177
+ flux search "ideas"
178
+ ```
151
179
 
180
+ ### Meeting Notes & Task Management
152
181
  ```bash
153
- # Clone and setup
154
- git clone https://github.com/yourusername/flux-cap
155
- cd flux-cap
156
- bun install
157
-
158
- # Run in development mode
159
- bun run dev <command>
182
+ # Capture meeting outcomes
183
+ flux dump -n "team standup: focus on performance this sprint"
184
+ flux dump -t "implement caching layer for API responses"
160
185
 
161
- # Build and test locally
162
- bun run build
163
- npm link
186
+ # Track follow-up tasks
187
+ flux dump -t "review Sarah's PR for authentication changes"
188
+ flux dump -t "update deployment documentation"
164
189
  ```
165
190
 
166
191
  ## Configuration
@@ -182,7 +207,7 @@ flux-cap stores configuration in `.flux/config.json`. You can customize:
182
207
  ```json
183
208
  {
184
209
  "search": {
185
- "searchFields": ["message", "branch", "workingDir"],
210
+ "searchFields": ["message", "branch", "workingDir", "tags"],
186
211
  "resultLimit": 10,
187
212
  "fuseOptions": {
188
213
  "threshold": 0.3, // 0.0 = exact match, 1.0 = match anything
@@ -192,6 +217,13 @@ flux-cap stores configuration in `.flux/config.json`. You can customize:
192
217
  }
193
218
  ```
194
219
 
220
+ ### Tag Configuration
221
+ ```json
222
+ {
223
+ "tags": ["bug", "meeting", "review", "urgent"] // Your custom tags
224
+ }
225
+ ```
226
+
195
227
  ### Other Options
196
228
  ```json
197
229
  {
@@ -219,40 +251,62 @@ flux-cap stores configuration in `.flux/config.json`. You can customize:
219
251
  "id": "019c5419-671b-7000-9600-5d9b4c563579",
220
252
  "timestamp": "2026-02-12T23:04:36.891Z",
221
253
  "message": "fix auth validation bug",
254
+ "tags": ["tasks"],
222
255
  "workingDir": "/Users/you/project",
223
- "branch": "feature/auth-fix",
256
+ "branch": "feature/auth-fix",
224
257
  "hasUncommittedChanges": true
225
258
  }
226
259
  ```
227
260
 
228
- ## Use Cases
261
+ ## Automated Versioning
229
262
 
230
- ### Context Switching
231
- ```bash
232
- # Before switching tasks
233
- flux dump "was working on user auth, next: add validation to login form"
263
+ flux-cap uses [Changesets](https://github.com/changesets/changesets) for automated semantic versioning:
234
264
 
235
- # After interruption
236
- flux search "auth" # Quickly find where you left off
237
- ```
265
+ ### What happens when you merge a PR:
266
+ 1. **Automatic Analysis**: GitHub Actions analyzes your PR changes
267
+ 2. **Smart Version Bumping**: Determines appropriate version (major/minor/patch) based on:
268
+ - PR title and description
269
+ - Commit messages
270
+ - Files changed
271
+ 3. **Changelog Generation**: Creates detailed changelog entries
272
+ 4. **Version Updates**: Updates `package.json` automatically
273
+ 5. **Git Integration**: Commits changes back to main branch
238
274
 
239
- ### Bug Tracking
275
+ ### Version Bump Rules:
276
+ - **Major** (`1.0.0 → 2.0.0`): Breaking changes, removed features, incompatible API changes
277
+ - **Minor** (`1.0.0 → 1.1.0`): New features, new commands, backwards-compatible enhancements
278
+ - **Patch** (`1.0.0 → 1.0.1`): Bug fixes, documentation updates, refactoring, performance improvements
279
+
280
+ ### Manual Changesets:
240
281
  ```bash
241
- flux dump "weird bug in payment flow - users can't checkout"
242
- flux dump "bug seems related to session timeout"
282
+ # Add a changeset manually (if needed)
283
+ bun run changeset
243
284
 
244
- # Later...
245
- flux search "payment bug"
246
- ```
285
+ # Check pending changesets
286
+ bun run changeset:status
247
287
 
248
- ### Idea Capture
249
- ```bash
250
- flux dump "idea: add keyboard shortcuts to dashboard"
251
- flux dump "maybe use React.memo for performance optimization"
288
+ # Apply version changes locally
289
+ bun run changeset:version
252
290
  ```
253
291
 
254
292
  ## Development
255
293
 
294
+ Want to contribute or run locally?
295
+
296
+ ```bash
297
+ # Clone and setup
298
+ git clone https://github.com/yourusername/flux-cap
299
+ cd flux-cap
300
+ bun install
301
+
302
+ # Run in development mode
303
+ bun run dev <command>
304
+
305
+ # Build and test locally
306
+ bun run build
307
+ npm link
308
+ ```
309
+
256
310
  Built with:
257
311
  - **Bun** - Fast JavaScript runtime
258
312
  - **TypeScript** - Type safety
@@ -276,6 +330,7 @@ src/
276
330
  ## Roadmap
277
331
 
278
332
  ### Phase 2 (Coming Soon)
333
+ - [ ] Enhanced tag-based search filtering
279
334
  - [ ] ASCII Pomodoro timer with themes
280
335
  - [ ] Visual focus mode display
281
336
  - [ ] Theme rotation system
@@ -284,11 +339,13 @@ src/
284
339
  - [ ] Advanced git context switching
285
340
  - [ ] Session restoration
286
341
  - [ ] Time tracking per context
342
+ - [ ] Tag analytics and insights
287
343
 
288
344
  ### Phase 4 (Maybe)
289
345
  - [ ] AI-powered brain dump analysis
290
346
  - [ ] Team collaboration features
291
347
  - [ ] Cross-machine sync
348
+ - [ ] Smart tag suggestions
292
349
 
293
350
  ## Contributing
294
351
 
package/dist/index.js CHANGED
@@ -20626,6 +20626,59 @@ var {
20626
20626
 
20627
20627
  // src/commands/init.command.ts
20628
20628
  import fs2 from "fs";
20629
+ // package.json
20630
+ var package_default = {
20631
+ name: "@dev_desh/flux-cap",
20632
+ type: "module",
20633
+ version: "0.6.0",
20634
+ description: "Git-aware CLI context manager for ADHD developers",
20635
+ bin: {
20636
+ flux: "./dist/index.js"
20637
+ },
20638
+ files: [
20639
+ "dist/**/*",
20640
+ "README.md",
20641
+ "LICENSE"
20642
+ ],
20643
+ scripts: {
20644
+ build: "bun build src/index.ts --outdir dist --target node --format esm",
20645
+ dev: "bun run src/index.ts",
20646
+ prepublishOnly: "bun run build",
20647
+ publish: "npm publish --access=public",
20648
+ "local-install": "bun run build && npm link",
20649
+ "local-uninstall": "npm unlink -g flux-cap",
20650
+ "local-reinstall": "bun run local-uninstall && bun run local-install",
20651
+ changeset: "changeset",
20652
+ "changeset:add": "changeset add",
20653
+ "changeset:status": "changeset status",
20654
+ "changeset:version": "changeset version",
20655
+ "changeset:publish": "changeset publish"
20656
+ },
20657
+ engines: {
20658
+ node: ">=18.0.0"
20659
+ },
20660
+ keywords: [
20661
+ "cli",
20662
+ "productivity",
20663
+ "adhd",
20664
+ "git",
20665
+ "context-switching",
20666
+ "brain-dump",
20667
+ "developer-tools"
20668
+ ],
20669
+ dependencies: {
20670
+ inquirer: "^13.2.5"
20671
+ },
20672
+ devDependencies: {
20673
+ "@changesets/cli": "^2.29.8",
20674
+ "@types/inquirer": "^9.0.9"
20675
+ },
20676
+ repository: {
20677
+ type: "git",
20678
+ url: "https://github.com/kaustubh285/flux-cap"
20679
+ },
20680
+ license: "MIT"
20681
+ };
20629
20682
 
20630
20683
  // src/utils/constants.ts
20631
20684
  var FLUX_FOLDER_PATH = ".flux/";
@@ -20633,7 +20686,7 @@ var FLUX_BRAIN_DUMP_PATH = `${FLUX_FOLDER_PATH}dumps/`;
20633
20686
  var FLUX_SESSION_PATH = `${FLUX_FOLDER_PATH}sessions/`;
20634
20687
  var FLUX_CONFIG_PATH = `${FLUX_FOLDER_PATH}config.json`;
20635
20688
  var FLUX_DEFAULT_CONFIG = {
20636
- fluxVersion: "0.0.1",
20689
+ fluxVersion: package_default.version,
20637
20690
  defaultFocusDuration: 1500,
20638
20691
  todoKeywords: ["TODO", "FIXME", "BUG", "OPTIMIZE", "HACK"],
20639
20692
  notifications: true,
@@ -20651,7 +20704,8 @@ var FLUX_DEFAULT_CONFIG = {
20651
20704
  threshold: 0.3,
20652
20705
  includeScore: true
20653
20706
  }
20654
- }
20707
+ },
20708
+ tags: ["notes", "ideas", "tasks", "bugs", "links", "imporatant"]
20655
20709
  };
20656
20710
  // src/utils/privacy.ts
20657
20711
  import { execSync } from "child_process";
@@ -20680,6 +20734,23 @@ function getCurrentBranch(config) {
20680
20734
  return "";
20681
20735
  }
20682
20736
  }
20737
+ function getTags(options, config) {
20738
+ let tags = [];
20739
+ if (options.tag) {
20740
+ tags.push(options.tag);
20741
+ }
20742
+ let optionTags = Object.keys(options).filter((key) => options[key] === true);
20743
+ if (!config.tags) {
20744
+ console.log("You do not have any tags configured. You can add tags to your config to use this feature. or run `flux config --add-tags notes ideas tasks` to add default tags. or update the config file");
20745
+ } else {
20746
+ for (const tag of optionTags) {
20747
+ if (config.tags && config.tags.includes(tag)) {
20748
+ tags.push(tag);
20749
+ }
20750
+ }
20751
+ }
20752
+ return tags;
20753
+ }
20683
20754
  // src/utils/lib.ts
20684
20755
  import fs from "fs";
20685
20756
  import path from "path";
@@ -20765,61 +20836,59 @@ function getMonthString() {
20765
20836
  function displaySearchResults(results, query) {
20766
20837
  if (results.length === 0) {
20767
20838
  if (query) {
20768
- console.log(`No brain dumps found matching "${query}"`);
20839
+ console.log(`
20840
+ No brain dumps found matching "${query}"
20841
+ `);
20769
20842
  } else {
20770
- console.log("No brain dumps found. Try 'flux dump' to create your first one!");
20843
+ console.log(`
20844
+ No brain dumps found. Try 'flux dump' to create your first one!
20845
+ `);
20771
20846
  }
20772
20847
  return;
20773
20848
  }
20774
- const queryText = query ? ` for "${query}"` : "";
20849
+ const queryText = query ? ` matching "${query}"` : "";
20775
20850
  console.log(`
20776
- Found ${results.length} brain dump${results.length === 1 ? "" : "s"}${queryText}:
20851
+ Found ${results.length} brain dump${results.length === 1 ? "" : "s"}${queryText}
20777
20852
  `);
20778
- const terminalWidth = process.stdout.columns || 80;
20779
- const maxIndexWidth = results.length.toString().length;
20853
+ const terminalWidth = process.stdout.columns || 100;
20854
+ const indexWidth = results.length.toString().length + 2;
20855
+ const idWidth = 10;
20856
+ const scoreWidth = 8;
20857
+ const timeWidth = 12;
20858
+ const header = `${"#".padEnd(indexWidth)}${"ID".padEnd(idWidth)}${"SCORE".padEnd(scoreWidth)}${"TIME".padEnd(timeWidth)}MESSAGE`;
20859
+ console.log(`\x1B[90m${header}\x1B[0m`);
20860
+ console.log(`\x1B[36m${"─".repeat(Math.min(terminalWidth - 5, header.length))}\x1B[0m`);
20780
20861
  results.forEach((result, index) => {
20781
20862
  const dump = result.item;
20782
20863
  const score = result.score?.toFixed(2) || "0.00";
20783
20864
  const shortId = dump.id.substring(0, 8);
20784
- const indexStr = `${(index + 1).toString().padStart(maxIndexWidth)}`;
20785
- const scoreStr = `[${score}]`;
20786
- const idStr = `${shortId}`;
20787
- const headerLine = `${indexStr} ${idStr} ${scoreStr}`;
20788
- console.log(headerLine);
20789
- const messageIndent = " ".repeat(maxIndexWidth + 1);
20865
+ const timeAgo = getTimeAgo(new Date(dump.timestamp));
20866
+ const indexStr = `${index + 1}.`.padEnd(indexWidth);
20867
+ const idStr = `\x1B[33m#${shortId}\x1B[0m`.padEnd(idWidth + 9);
20868
+ const scoreStr = `\x1B[90m[${score}]\x1B[0m`.padEnd(scoreWidth + 9);
20869
+ const timeStr = `\x1B[90m${timeAgo}\x1B[0m`.padEnd(timeWidth + 9);
20790
20870
  const lines = dump.message.split(`
20791
20871
  `).map((l) => l.trim()).filter((l) => l.length > 0);
20792
- const availableWidth = terminalWidth - messageIndent.length - 2;
20793
- if (lines.length === 0) {
20794
- console.log(`${messageIndent}(empty message)`);
20795
- } else {
20796
- lines.forEach((line, lineIndex) => {
20797
- if (lineIndex < 3) {
20798
- const truncatedLine = line.length > availableWidth ? line.substring(0, availableWidth - 3) + "..." : line;
20799
- console.log(`${messageIndent}${truncatedLine}`);
20800
- }
20872
+ const firstLine = lines[0] || "(empty)";
20873
+ console.log(`
20874
+ ${indexStr}${idStr}${scoreStr}${timeStr}${firstLine}`);
20875
+ const messageIndent = " ".repeat(indexWidth + idWidth + scoreWidth + timeWidth);
20876
+ if (lines.length > 1) {
20877
+ lines.slice(1).forEach((line) => {
20878
+ console.log(`${messageIndent}${line}`);
20801
20879
  });
20802
- if (lines.length > 3) {
20803
- console.log(`${messageIndent}... (+${lines.length - 3} more line${lines.length - 3 === 1 ? "" : "s"})`);
20804
- }
20805
20880
  }
20806
- const contextInfo = [];
20807
- const date = new Date(dump.timestamp);
20808
- const timeAgo = getTimeAgo(date);
20809
- contextInfo.push("----------------");
20810
- contextInfo.push(`${timeAgo}`);
20811
- contextInfo.push("----------------");
20812
- contextInfo.push(`
20813
- `);
20814
- if (dump.branch && dump.branch !== "main") {
20815
- contextInfo.push(`${dump.branch}${dump.hasUncommittedChanges ? " (uncommitted)" : ""}`);
20881
+ if (dump?.tags?.length) {
20882
+ const tagsLine = `[${dump.tags.join(", ")}]`;
20883
+ console.log(`${messageIndent}\x1B[36m${tagsLine}\x1B[0m`);
20816
20884
  }
20817
- if (contextInfo.length > 0) {
20818
- console.log(`${messageIndent}${contextInfo.join(" ")}`);
20885
+ if (dump.branch && dump.branch !== "main") {
20886
+ const gitInfo = `${dump.branch}${dump.hasUncommittedChanges ? " (uncommitted)" : ""}`;
20887
+ console.log(`${messageIndent}\x1B[33m${gitInfo}\x1B[0m`);
20819
20888
  }
20820
- console.log("");
20821
20889
  });
20822
- console.log(`!! Use the 8-character ID (like ${results[0]?.item.id.substring(0, 8)}) to reference specific dumps
20890
+ console.log(`
20891
+ \x1B[90m Tip: Use the 8-character ID to reference dumps (e.g., flux edit ${results[0]?.item.id.substring(0, 8)})\x1B[0m
20823
20892
  `);
20824
20893
  }
20825
20894
  function getTimeAgo(date) {
@@ -23758,33 +23827,43 @@ var inquirer = {
23758
23827
  var dist_default14 = inquirer;
23759
23828
 
23760
23829
  // src/commands/init.command.ts
23761
- async function initFluxCommand() {
23830
+ async function initFluxCommand(options) {
23762
23831
  console.log("Initializing Flux Capacitor...");
23763
23832
  try {
23764
23833
  await createIfNotExists(FLUX_FOLDER_PATH, "directory");
23765
23834
  await createIfNotExists(FLUX_BRAIN_DUMP_PATH, "directory");
23766
23835
  await createIfNotExists(FLUX_SESSION_PATH, "directory");
23767
23836
  const config = FLUX_DEFAULT_CONFIG;
23768
- const answers = await dist_default14.prompt([
23769
- {
23770
- type: "confirm",
23771
- name: "includeWorkingDir",
23772
- message: "Include your current working directory in logs?",
23773
- default: true
23774
- },
23775
- {
23776
- type: "confirm",
23777
- name: "includeBranch",
23778
- message: "Include your git branch name in logs?",
23779
- default: true
23780
- },
23781
- {
23782
- type: "confirm",
23783
- name: "includeUncommitted",
23784
- message: "Include uncommitted git changes in logs?",
23785
- default: true
23786
- }
23787
- ]);
23837
+ let answers;
23838
+ if (options.yes) {
23839
+ console.log("Accepting all default options for initialization...");
23840
+ answers = {
23841
+ includeWorkingDir: true,
23842
+ includeBranch: true,
23843
+ includeUncommitted: true
23844
+ };
23845
+ } else {
23846
+ answers = await dist_default14.prompt([
23847
+ {
23848
+ type: "confirm",
23849
+ name: "includeWorkingDir",
23850
+ message: "Include your current working directory in logs?",
23851
+ default: true
23852
+ },
23853
+ {
23854
+ type: "confirm",
23855
+ name: "includeBranch",
23856
+ message: "Include your git branch name in logs?",
23857
+ default: true
23858
+ },
23859
+ {
23860
+ type: "confirm",
23861
+ name: "includeUncommitted",
23862
+ message: "Include uncommitted git changes in logs?",
23863
+ default: true
23864
+ }
23865
+ ]);
23866
+ }
23788
23867
  config.privacy.hideWorkingDir = !answers.includeWorkingDir;
23789
23868
  config.privacy.hideBranchName = !answers.includeBranch;
23790
23869
  config.privacy.hideUncommittedChanges = !answers.includeUncommitted;
@@ -23872,7 +23951,7 @@ async function handleBrainDump(message, options) {
23872
23951
  }
23873
23952
  finalMessage = message.join(" ");
23874
23953
  }
23875
- await brainDumpAddCommand(finalMessage, { multiline: options.multiline });
23954
+ await brainDumpAddCommand(finalMessage, options);
23876
23955
  } catch (error) {
23877
23956
  console.error("Error creating brain dump:", error instanceof Error ? error.message : "Unknown error");
23878
23957
  process.exit(1);
@@ -23888,13 +23967,15 @@ async function brainDumpAddCommand(message, options = {}) {
23888
23967
  const workingDir = await getWorkingDir(config);
23889
23968
  const branch = getCurrentBranch(config);
23890
23969
  const hasUncommittedChanges = getGitUncommittedChanges(config);
23970
+ const tags = getTags(options, config);
23891
23971
  const newDump = {
23892
23972
  id: randomUUID2(),
23893
23973
  timestamp: new Date().toISOString(),
23894
23974
  message,
23895
23975
  workingDir,
23896
23976
  branch,
23897
- hasUncommittedChanges
23977
+ hasUncommittedChanges,
23978
+ tags
23898
23979
  };
23899
23980
  const data = JSON.parse(fs3.readFileSync(`${fluxPath}${FLUX_BRAIN_DUMP_PATH}/${monthString}.json`, "utf8"));
23900
23981
  config.sorted ? data.dumps.unshift(newDump) : data.dumps.push(newDump);
@@ -25205,7 +25286,7 @@ function createFuseInstance(data, config) {
25205
25286
  return new Fuse(data, {
25206
25287
  keys: config.search.searchFields,
25207
25288
  includeScore: config.search.fuseOptions?.includeScore || true,
25208
- threshold: config.search.fuseOptions?.threshold || 0.3
25289
+ threshold: config.search.fuseOptions?.threshold || 0.5
25209
25290
  });
25210
25291
  }
25211
25292
 
@@ -25215,119 +25296,127 @@ async function searchBrainDumpCommand(query) {
25215
25296
  console.log("Searching all brain dumps...");
25216
25297
  const fluxPath = await getFluxPath();
25217
25298
  const config = await getConfigFile(fluxPath);
25218
- const searchQuery = query.join(" ").trim();
25299
+ const combinedQuery = query.join(" ").trim();
25219
25300
  let searchResults = [];
25220
25301
  const allFilePaths = await getAllBrainDumpFilePaths(fluxPath);
25221
- for await (const filePath of allFilePaths) {
25222
- const fileData = JSON.parse(fs3.readFileSync(filePath, "utf8"));
25302
+ for (const searchQuery of query) {
25303
+ for await (const filePath of allFilePaths) {
25304
+ const fileData = JSON.parse(fs3.readFileSync(filePath, "utf8"));
25305
+ if (searchQuery) {
25306
+ const fuse = createFuseInstance(fileData.dumps, config);
25307
+ const results = fuse.search(searchQuery);
25308
+ searchResults.push(...results);
25309
+ } else {
25310
+ const recentDumps = fileData.dumps.filter((dump) => dump && dump.message && dump.message.trim() !== "").map((dump) => ({
25311
+ item: dump,
25312
+ score: 0,
25313
+ timestamp: new Date(dump.timestamp).getTime()
25314
+ }));
25315
+ searchResults.push(...recentDumps);
25316
+ }
25317
+ }
25223
25318
  if (searchQuery) {
25224
- const fuse = createFuseInstance(fileData.dumps, config);
25225
- const results = fuse.search(searchQuery);
25226
- searchResults.push(...results);
25319
+ searchResults.sort((a, b) => (a.score || 0) - (b.score || 0));
25227
25320
  } else {
25228
- const recentDumps = fileData.dumps.filter((dump) => dump && dump.message && dump.message.trim() !== "").map((dump) => ({
25229
- item: dump,
25230
- score: 0,
25231
- timestamp: new Date(dump.timestamp).getTime()
25232
- }));
25233
- searchResults.push(...recentDumps);
25321
+ searchResults.sort((a, b) => {
25322
+ const timeA = new Date(a.item.timestamp).getTime();
25323
+ const timeB = new Date(b.item.timestamp).getTime();
25324
+ return timeB - timeA;
25325
+ });
25234
25326
  }
25235
25327
  }
25236
- if (searchQuery) {
25237
- searchResults.sort((a, b) => (a.score || 0) - (b.score || 0));
25238
- } else {
25239
- searchResults.sort((a, b) => {
25240
- const timeA = new Date(a.item.timestamp).getTime();
25241
- const timeB = new Date(b.item.timestamp).getTime();
25242
- return timeB - timeA;
25243
- });
25244
- }
25245
- const resultLimit = config?.search?.resultLimit || (searchQuery ? 10 : 5);
25328
+ const resultLimit = config?.search?.resultLimit || (combinedQuery ? 10 : 5);
25246
25329
  const limitedResults = searchResults.slice(0, resultLimit);
25247
25330
  if (searchResults.length > limitedResults.length) {
25248
25331
  console.log(`
25249
25332
  (Showing ${limitedResults.length} of ${searchResults.length} results)`);
25250
25333
  }
25251
- displaySearchResults(limitedResults, searchQuery || undefined);
25334
+ displaySearchResults(limitedResults, combinedQuery || undefined);
25252
25335
  }
25253
25336
 
25254
25337
  // src/commands/config.command.ts
25255
- async function configCommand(fields) {
25256
- console.log("This command is still to be implemented");
25338
+ async function configCommand(data) {
25339
+ console.log(`Updating key: ${data[0]} to ${data[1]}`);
25340
+ const fluxPath = await getFluxPath();
25257
25341
  const fs4 = await import("fs");
25258
- const config = await getConfigFile();
25259
- const value = fields[fields.length - 1];
25260
- const keys = fields.slice(0, -1)[0]?.split(".").map((k) => k.trim()) || [];
25261
- console.log(`want to update config field: ${JSON.stringify(keys)} with value: ${value}`);
25262
- if (keys.length === 0 || value === undefined) {
25263
- console.log("Current Flux Capacitor configuration:");
25264
- console.log(JSON.stringify(config, null, 4));
25342
+ const config = await getConfigFile(fluxPath);
25343
+ if (data.length < 2) {
25344
+ console.log("Please provide a key and value to update the config. Example: flux config --add-tags notes ideas tasks");
25265
25345
  return;
25266
25346
  }
25267
- }
25268
- // package.json
25269
- var package_default = {
25270
- name: "@dev_desh/flux-cap",
25271
- type: "module",
25272
- version: "0.3.0",
25273
- description: "Git-aware CLI context manager for ADHD developers",
25274
- bin: {
25275
- flux: "./dist/index.js"
25276
- },
25277
- files: [
25278
- "dist/**/*",
25279
- "README.md",
25280
- "LICENSE"
25281
- ],
25282
- scripts: {
25283
- build: "bun build src/index.ts --outdir dist --target node --format esm",
25284
- dev: "bun run src/index.ts",
25285
- prepublishOnly: "bun run build",
25286
- publish: "npm publish --access=public",
25287
- "local-install": "bun run build && npm link",
25288
- "local-uninstall": "npm unlink -g flux-cap",
25289
- "local-reinstall": "bun run local-uninstall && bun run local-install",
25290
- changeset: "changeset",
25291
- "changeset:add": "changeset add",
25292
- "changeset:status": "changeset status",
25293
- "changeset:version": "changeset version",
25294
- "changeset:publish": "changeset publish"
25295
- },
25296
- engines: {
25297
- node: ">=18.0.0"
25298
- },
25299
- keywords: [
25300
- "cli",
25301
- "productivity",
25302
- "adhd",
25303
- "git",
25304
- "context-switching",
25305
- "brain-dump",
25306
- "developer-tools"
25307
- ],
25308
- dependencies: {
25309
- inquirer: "^13.2.5"
25310
- },
25311
- devDependencies: {
25312
- "@changesets/cli": "^2.29.8",
25313
- "@types/inquirer": "^9.0.9"
25314
- },
25315
- repository: {
25316
- type: "git",
25317
- url: "https://github.com/kaustubh285/flux-cap"
25347
+ const key = data[0];
25348
+ const value = data.slice(1).join(" ");
25349
+ const editableKeys = [
25350
+ "hideWorkingDir",
25351
+ "hideBranchName",
25352
+ "hideUncommittedChanges",
25353
+ "resultLimit",
25354
+ "threshold",
25355
+ "includeScore",
25356
+ "defaultFocusDuration"
25357
+ ];
25358
+ if (!editableKeys.includes(key)) {
25359
+ console.log(`Invalid config key.
25360
+ Editable keys are: ${editableKeys.join(", ")}`);
25361
+ return;
25318
25362
  }
25319
- };
25363
+ if (key === "hideWorkingDir") {
25364
+ config.privacy.hideWorkingDir = value === "true";
25365
+ }
25366
+ if (key === "hideBranchName") {
25367
+ config.privacy.hideBranchName = value === "true";
25368
+ }
25369
+ if (key === "hideUncommittedChanges") {
25370
+ config.privacy.hideUncommittedChanges = value === "true";
25371
+ }
25372
+ if (key === "resultLimit") {
25373
+ const limit = parseInt(value, 10);
25374
+ if (!isNaN(limit)) {
25375
+ config.search.resultLimit = limit;
25376
+ } else {
25377
+ console.log("Invalid value for resultLimit. Please provide a number.");
25378
+ return;
25379
+ }
25380
+ }
25381
+ if (key === "threshold") {
25382
+ const threshold = parseFloat(value);
25383
+ if (!isNaN(threshold)) {
25384
+ if (config.search && config.search.fuseOptions) {
25385
+ config.search.fuseOptions.threshold = threshold;
25386
+ }
25387
+ } else {
25388
+ console.log("Invalid value for threshold. Please provide a number.");
25389
+ return;
25390
+ }
25391
+ }
25392
+ if (key === "includeScore") {
25393
+ if (config.search && config.search.fuseOptions) {
25394
+ config.search.fuseOptions.includeScore = value === "true";
25395
+ }
25396
+ }
25397
+ if (key === "defaultFocusDuration") {
25398
+ const duration = parseInt(value, 10);
25399
+ if (!isNaN(duration)) {
25400
+ config.defaultFocusDuration = duration;
25401
+ } else {
25402
+ console.log("Invalid value for defaultFocusDuration. Please provide a number.");
25403
+ return;
25404
+ }
25405
+ }
25406
+ fs4.writeFileSync(fluxPath + FLUX_CONFIG_PATH, JSON.stringify(config, null, 4));
25407
+ console.log("Config updated successfully.");
25408
+ }
25320
25409
 
25321
25410
  // src/index.ts
25322
25411
  var program2 = new Command;
25323
25412
  program2.name(`flux`).description("Git-aware CLI context manager for ADHD developers").version(package_default.version);
25324
- program2.command("init").description("Initialize flux in the current repository").action(initFluxCommand);
25413
+ program2.command("init").option("-y, --yes", "Accept all default options for initialization").description("Initialize flux in the current repository").action(initFluxCommand);
25325
25414
  program2.command("reset").description("Resets flux in the current repository").action(resetFluxCommand);
25326
- program2.command("dump [message...]").option("-m, --multiline", "Enable multiline input mode").description("Add a brain dump with a message. Use --multiline for multi-line input.").action(async (message, options) => {
25415
+ program2.command("dump [message...]").option("-m, --multiline", "Enable multiline input mode").option("-n, --notes", "Jot down a note").option("-i, --important", "Jot down a link").option("-d, --ideas", "Jot down an idea").option("-t, --tasks", "Jot down a task").option("-b, --bugs", "Jot down a bug").option("-l, --links", "Jot down a link").option("--tag [custom]", "Jot down a custom tagged").description("Add a brain dump with a message. Use --multiline for multi-line input.").action(async (message, options) => {
25327
25416
  await handleBrainDump(message, options);
25328
25417
  });
25329
25418
  program2.command("search [query...]").description("Search brain dumps with a query. If no query is provided, lists all brain dumps for the current month.").action((query) => {
25330
25419
  searchBrainDumpCommand(query ? query : [""]);
25331
25420
  });
25332
- program2.command("config <fields...>").description("Update configuration fields. Example: flux config search.limit 10").action(configCommand);
25421
+ program2.command("config [data...]").description("Update configuration fields. Example: flux config search.limit 10").action(configCommand);
25333
25422
  program2.parse(process.argv);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dev_desh/flux-cap",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.6.0",
5
5
  "description": "Git-aware CLI context manager for ADHD developers",
6
6
  "bin": {
7
7
  "flux": "./dist/index.js"
@@ -47,5 +47,6 @@
47
47
  "repository": {
48
48
  "type": "git",
49
49
  "url": "https://github.com/kaustubh285/flux-cap"
50
- }
50
+ },
51
+ "license": "MIT"
51
52
  }