@dev_desh/flux-cap 0.3.0 → 0.5.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.
- package/README.md +132 -81
- package/dist/index.js +145 -67
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,11 +29,16 @@ 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
|
-
|
|
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
|
|
@@ -41,22 +46,27 @@ flux dump "idea: add dark mode toggle"
|
|
|
41
46
|
# Search with a query
|
|
42
47
|
flux search "auth"
|
|
43
48
|
|
|
49
|
+
# Search by tags (when implemented in search)
|
|
50
|
+
flux search "ideas"
|
|
51
|
+
flux search "tasks"
|
|
52
|
+
|
|
44
53
|
# List recent dumps (no query)
|
|
45
54
|
flux search
|
|
46
55
|
```
|
|
47
56
|
|
|
48
|
-
|
|
49
57
|
## Features
|
|
50
58
|
|
|
51
|
-
### Brain Dump System
|
|
59
|
+
### Brain Dump System with Smart Tags
|
|
52
60
|
- Instantly capture thoughts without breaking flow: `flux dump "fix auth validation bug"`
|
|
61
|
+
- **Tag system** for better organization: `-i` for ideas, `-n` for notes, `-t` for tasks
|
|
53
62
|
- Git-aware context tracking (branch, working directory, uncommitted changes)
|
|
54
63
|
- Monthly file organization for easy browsing
|
|
55
64
|
- Privacy-first design - you control what gets tracked
|
|
56
65
|
|
|
57
|
-
### Search
|
|
66
|
+
### Intelligent Search
|
|
58
67
|
- Fuzzy search across all your brain dumps: `flux search "auth"`
|
|
59
|
-
-
|
|
68
|
+
- **Tag-aware searching** for filtering by type
|
|
69
|
+
- Configurable search fields (message, branch, working directory, tags)
|
|
60
70
|
- Result ranking with relevance scores
|
|
61
71
|
- Multi-month search with automatic limits
|
|
62
72
|
|
|
@@ -78,89 +88,98 @@ flux search
|
|
|
78
88
|
- No need to initialize in every subfolder - works project-wide
|
|
79
89
|
- Seamlessly handles monorepos and complex project structures
|
|
80
90
|
|
|
81
|
-
|
|
82
91
|
## Commands
|
|
83
92
|
|
|
84
93
|
| Command | Description | Example |
|
|
85
94
|
|---------|-------------|---------|
|
|
86
95
|
| `flux init` | Initialize flux-cap with privacy setup | `flux init` |
|
|
87
96
|
| `flux dump <message...>` | Capture a brain dump | `flux dump "fix the bug in auth.ts"` |
|
|
97
|
+
| `flux dump -i <message...>` | Capture an idea | `flux dump -i "add keyboard shortcuts"` |
|
|
98
|
+
| `flux dump -n <message...>` | Capture a note | `flux dump -n "meeting notes from standup"` |
|
|
99
|
+
| `flux dump -t <message...>` | Capture a task | `flux dump -t "refactor user authentication"` |
|
|
100
|
+
| `flux dump -m` | Multiline input mode | `flux dump -m` |
|
|
88
101
|
| `flux search [query...]` | Search brain dumps or list recent ones | `flux search "authentication"` |
|
|
89
|
-
| `flux config
|
|
102
|
+
| `flux config [field] [value]` | View or update configuration | `flux config search.resultLimit 20` |
|
|
103
|
+
| `flux config --add-tag <tag>` | Add custom tags to configuration | `flux config --add-tag "bug"` |
|
|
104
|
+
| `flux config --remove-tag <tag>` | Remove tags from configuration | `flux config --remove-tag "old-tag"` |
|
|
90
105
|
| `flux reset` | Complete reset (deletes all data) | `flux reset` |
|
|
91
106
|
|
|
92
|
-
##
|
|
107
|
+
## Tag System
|
|
93
108
|
|
|
94
|
-
###
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
109
|
+
### Built-in Tags
|
|
110
|
+
flux-cap comes with three built-in tag shortcuts:
|
|
111
|
+
- **`-i, --ideas`** - For capturing ideas and inspiration
|
|
112
|
+
- **`-n, --notes`** - For general notes and reminders
|
|
113
|
+
- **`-t, --tasks`** - For tasks and todos
|
|
98
114
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Bug Tracking
|
|
115
|
+
### Custom Tags (via config)
|
|
116
|
+
Extend your tagging system by adding custom tags for brain dumps:
|
|
104
117
|
```bash
|
|
105
|
-
|
|
106
|
-
flux dump "
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
118
|
+
# Built-in shortcuts (current)
|
|
119
|
+
flux dump -i "idea message"
|
|
120
|
+
flux dump -n "note message"
|
|
121
|
+
flux dump -t "task message"
|
|
122
|
+
|
|
123
|
+
# Generic tag option (new)
|
|
124
|
+
flux dump --tag thought "my message"
|
|
125
|
+
flux dump --tag bug "found an issue"
|
|
126
|
+
flux dump --tag meeting "standup notes"
|
|
110
127
|
```
|
|
111
128
|
|
|
112
|
-
###
|
|
129
|
+
### Tag Examples
|
|
113
130
|
```bash
|
|
114
|
-
|
|
115
|
-
flux dump "
|
|
116
|
-
|
|
131
|
+
# Ideas for future features
|
|
132
|
+
flux dump -i "add real-time collaboration to the editor"
|
|
133
|
+
flux dump -i "implement auto-save every 30 seconds"
|
|
117
134
|
|
|
118
|
-
|
|
135
|
+
# Meeting notes and reminders
|
|
136
|
+
flux dump -n "team decided to use TypeScript for new components"
|
|
137
|
+
flux dump -n "remember to update documentation before release"
|
|
119
138
|
|
|
120
|
-
|
|
139
|
+
# Task tracking
|
|
140
|
+
flux dump -t "fix memory leak in image processor"
|
|
141
|
+
flux dump -t "write unit tests for authentication module"
|
|
121
142
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
|
143
|
+
# Combine with multiline for detailed entries
|
|
144
|
+
flux dump -t -m # Opens editor for detailed task description
|
|
145
|
+
```
|
|
131
146
|
|
|
132
|
-
|
|
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
|
|
147
|
+
## Use Cases
|
|
136
148
|
|
|
137
|
-
###
|
|
149
|
+
### Context Switching
|
|
138
150
|
```bash
|
|
139
|
-
#
|
|
140
|
-
|
|
151
|
+
# Before switching tasks
|
|
152
|
+
flux dump -t "was working on user auth, next: add validation to login form"
|
|
141
153
|
|
|
142
|
-
#
|
|
143
|
-
|
|
154
|
+
# After interruption
|
|
155
|
+
flux search "auth" # Quickly find where you left off
|
|
156
|
+
flux search "tasks" # Find your pending tasks
|
|
157
|
+
```
|
|
144
158
|
|
|
145
|
-
|
|
146
|
-
|
|
159
|
+
### Bug Tracking & Ideas
|
|
160
|
+
```bash
|
|
161
|
+
# Track bugs and investigations
|
|
162
|
+
flux dump -n "weird bug in payment flow - users can't checkout"
|
|
163
|
+
flux dump -n "bug seems related to session timeout - check Redis config"
|
|
147
164
|
|
|
148
|
-
|
|
165
|
+
# Capture ideas as they come
|
|
166
|
+
flux dump -i "add keyboard shortcuts to dashboard"
|
|
167
|
+
flux dump -i "maybe use React.memo for performance optimization"
|
|
149
168
|
|
|
150
|
-
|
|
169
|
+
# Later...
|
|
170
|
+
flux search "payment bug"
|
|
171
|
+
flux search "ideas"
|
|
172
|
+
```
|
|
151
173
|
|
|
174
|
+
### Meeting Notes & Task Management
|
|
152
175
|
```bash
|
|
153
|
-
#
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
bun install
|
|
157
|
-
|
|
158
|
-
# Run in development mode
|
|
159
|
-
bun run dev <command>
|
|
176
|
+
# Capture meeting outcomes
|
|
177
|
+
flux dump -n "team standup: focus on performance this sprint"
|
|
178
|
+
flux dump -t "implement caching layer for API responses"
|
|
160
179
|
|
|
161
|
-
#
|
|
162
|
-
|
|
163
|
-
|
|
180
|
+
# Track follow-up tasks
|
|
181
|
+
flux dump -t "review Sarah's PR for authentication changes"
|
|
182
|
+
flux dump -t "update deployment documentation"
|
|
164
183
|
```
|
|
165
184
|
|
|
166
185
|
## Configuration
|
|
@@ -182,7 +201,7 @@ flux-cap stores configuration in `.flux/config.json`. You can customize:
|
|
|
182
201
|
```json
|
|
183
202
|
{
|
|
184
203
|
"search": {
|
|
185
|
-
"searchFields": ["message", "branch", "workingDir"],
|
|
204
|
+
"searchFields": ["message", "branch", "workingDir", "tags"],
|
|
186
205
|
"resultLimit": 10,
|
|
187
206
|
"fuseOptions": {
|
|
188
207
|
"threshold": 0.3, // 0.0 = exact match, 1.0 = match anything
|
|
@@ -192,6 +211,13 @@ flux-cap stores configuration in `.flux/config.json`. You can customize:
|
|
|
192
211
|
}
|
|
193
212
|
```
|
|
194
213
|
|
|
214
|
+
### Tag Configuration
|
|
215
|
+
```json
|
|
216
|
+
{
|
|
217
|
+
"tags": ["bug", "meeting", "review", "urgent"] // Your custom tags
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
195
221
|
### Other Options
|
|
196
222
|
```json
|
|
197
223
|
{
|
|
@@ -219,40 +245,62 @@ flux-cap stores configuration in `.flux/config.json`. You can customize:
|
|
|
219
245
|
"id": "019c5419-671b-7000-9600-5d9b4c563579",
|
|
220
246
|
"timestamp": "2026-02-12T23:04:36.891Z",
|
|
221
247
|
"message": "fix auth validation bug",
|
|
248
|
+
"tags": ["tasks"],
|
|
222
249
|
"workingDir": "/Users/you/project",
|
|
223
|
-
"branch": "feature/auth-fix",
|
|
250
|
+
"branch": "feature/auth-fix",
|
|
224
251
|
"hasUncommittedChanges": true
|
|
225
252
|
}
|
|
226
253
|
```
|
|
227
254
|
|
|
228
|
-
##
|
|
255
|
+
## Automated Versioning
|
|
229
256
|
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
# Before switching tasks
|
|
233
|
-
flux dump "was working on user auth, next: add validation to login form"
|
|
257
|
+
flux-cap uses [Changesets](https://github.com/changesets/changesets) for automated semantic versioning:
|
|
234
258
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
259
|
+
### What happens when you merge a PR:
|
|
260
|
+
1. **Automatic Analysis**: GitHub Actions analyzes your PR changes
|
|
261
|
+
2. **Smart Version Bumping**: Determines appropriate version (major/minor/patch) based on:
|
|
262
|
+
- PR title and description
|
|
263
|
+
- Commit messages
|
|
264
|
+
- Files changed
|
|
265
|
+
3. **Changelog Generation**: Creates detailed changelog entries
|
|
266
|
+
4. **Version Updates**: Updates `package.json` automatically
|
|
267
|
+
5. **Git Integration**: Commits changes back to main branch
|
|
268
|
+
|
|
269
|
+
### Version Bump Rules:
|
|
270
|
+
- **Major** (`1.0.0 → 2.0.0`): Breaking changes, removed features, incompatible API changes
|
|
271
|
+
- **Minor** (`1.0.0 → 1.1.0`): New features, new commands, backwards-compatible enhancements
|
|
272
|
+
- **Patch** (`1.0.0 → 1.0.1`): Bug fixes, documentation updates, refactoring, performance improvements
|
|
238
273
|
|
|
239
|
-
###
|
|
274
|
+
### Manual Changesets:
|
|
240
275
|
```bash
|
|
241
|
-
|
|
242
|
-
|
|
276
|
+
# Add a changeset manually (if needed)
|
|
277
|
+
bun run changeset
|
|
243
278
|
|
|
244
|
-
#
|
|
245
|
-
|
|
246
|
-
```
|
|
279
|
+
# Check pending changesets
|
|
280
|
+
bun run changeset:status
|
|
247
281
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
flux dump "idea: add keyboard shortcuts to dashboard"
|
|
251
|
-
flux dump "maybe use React.memo for performance optimization"
|
|
282
|
+
# Apply version changes locally
|
|
283
|
+
bun run changeset:version
|
|
252
284
|
```
|
|
253
285
|
|
|
254
286
|
## Development
|
|
255
287
|
|
|
288
|
+
Want to contribute or run locally?
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Clone and setup
|
|
292
|
+
git clone https://github.com/yourusername/flux-cap
|
|
293
|
+
cd flux-cap
|
|
294
|
+
bun install
|
|
295
|
+
|
|
296
|
+
# Run in development mode
|
|
297
|
+
bun run dev <command>
|
|
298
|
+
|
|
299
|
+
# Build and test locally
|
|
300
|
+
bun run build
|
|
301
|
+
npm link
|
|
302
|
+
```
|
|
303
|
+
|
|
256
304
|
Built with:
|
|
257
305
|
- **Bun** - Fast JavaScript runtime
|
|
258
306
|
- **TypeScript** - Type safety
|
|
@@ -276,6 +324,7 @@ src/
|
|
|
276
324
|
## Roadmap
|
|
277
325
|
|
|
278
326
|
### Phase 2 (Coming Soon)
|
|
327
|
+
- [ ] Enhanced tag-based search filtering
|
|
279
328
|
- [ ] ASCII Pomodoro timer with themes
|
|
280
329
|
- [ ] Visual focus mode display
|
|
281
330
|
- [ ] Theme rotation system
|
|
@@ -284,11 +333,13 @@ src/
|
|
|
284
333
|
- [ ] Advanced git context switching
|
|
285
334
|
- [ ] Session restoration
|
|
286
335
|
- [ ] Time tracking per context
|
|
336
|
+
- [ ] Tag analytics and insights
|
|
287
337
|
|
|
288
338
|
### Phase 4 (Maybe)
|
|
289
339
|
- [ ] AI-powered brain dump analysis
|
|
290
340
|
- [ ] Team collaboration features
|
|
291
341
|
- [ ] Cross-machine sync
|
|
342
|
+
- [ ] Smart tag suggestions
|
|
292
343
|
|
|
293
344
|
## Contributing
|
|
294
345
|
|
package/dist/index.js
CHANGED
|
@@ -20626,6 +20626,58 @@ 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.5.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
|
+
};
|
|
20629
20681
|
|
|
20630
20682
|
// src/utils/constants.ts
|
|
20631
20683
|
var FLUX_FOLDER_PATH = ".flux/";
|
|
@@ -20633,7 +20685,7 @@ var FLUX_BRAIN_DUMP_PATH = `${FLUX_FOLDER_PATH}dumps/`;
|
|
|
20633
20685
|
var FLUX_SESSION_PATH = `${FLUX_FOLDER_PATH}sessions/`;
|
|
20634
20686
|
var FLUX_CONFIG_PATH = `${FLUX_FOLDER_PATH}config.json`;
|
|
20635
20687
|
var FLUX_DEFAULT_CONFIG = {
|
|
20636
|
-
fluxVersion:
|
|
20688
|
+
fluxVersion: package_default.version,
|
|
20637
20689
|
defaultFocusDuration: 1500,
|
|
20638
20690
|
todoKeywords: ["TODO", "FIXME", "BUG", "OPTIMIZE", "HACK"],
|
|
20639
20691
|
notifications: true,
|
|
@@ -20651,7 +20703,8 @@ var FLUX_DEFAULT_CONFIG = {
|
|
|
20651
20703
|
threshold: 0.3,
|
|
20652
20704
|
includeScore: true
|
|
20653
20705
|
}
|
|
20654
|
-
}
|
|
20706
|
+
},
|
|
20707
|
+
tags: ["notes", "ideas", "tasks"]
|
|
20655
20708
|
};
|
|
20656
20709
|
// src/utils/privacy.ts
|
|
20657
20710
|
import { execSync } from "child_process";
|
|
@@ -20680,6 +20733,23 @@ function getCurrentBranch(config) {
|
|
|
20680
20733
|
return "";
|
|
20681
20734
|
}
|
|
20682
20735
|
}
|
|
20736
|
+
function getTags(options, config) {
|
|
20737
|
+
let tags = [];
|
|
20738
|
+
if (options.tag) {
|
|
20739
|
+
tags.push(options.tag);
|
|
20740
|
+
}
|
|
20741
|
+
let optionTags = Object.keys(options).filter((key) => options[key] === true);
|
|
20742
|
+
if (!config.tags) {
|
|
20743
|
+
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");
|
|
20744
|
+
} else {
|
|
20745
|
+
for (const tag of optionTags) {
|
|
20746
|
+
if (config.tags && config.tags.includes(tag)) {
|
|
20747
|
+
tags.push(tag);
|
|
20748
|
+
}
|
|
20749
|
+
}
|
|
20750
|
+
}
|
|
20751
|
+
return tags;
|
|
20752
|
+
}
|
|
20683
20753
|
// src/utils/lib.ts
|
|
20684
20754
|
import fs from "fs";
|
|
20685
20755
|
import path from "path";
|
|
@@ -23872,7 +23942,7 @@ async function handleBrainDump(message, options) {
|
|
|
23872
23942
|
}
|
|
23873
23943
|
finalMessage = message.join(" ");
|
|
23874
23944
|
}
|
|
23875
|
-
await brainDumpAddCommand(finalMessage,
|
|
23945
|
+
await brainDumpAddCommand(finalMessage, options);
|
|
23876
23946
|
} catch (error) {
|
|
23877
23947
|
console.error("Error creating brain dump:", error instanceof Error ? error.message : "Unknown error");
|
|
23878
23948
|
process.exit(1);
|
|
@@ -23888,13 +23958,15 @@ async function brainDumpAddCommand(message, options = {}) {
|
|
|
23888
23958
|
const workingDir = await getWorkingDir(config);
|
|
23889
23959
|
const branch = getCurrentBranch(config);
|
|
23890
23960
|
const hasUncommittedChanges = getGitUncommittedChanges(config);
|
|
23961
|
+
const tags = getTags(options, config);
|
|
23891
23962
|
const newDump = {
|
|
23892
23963
|
id: randomUUID2(),
|
|
23893
23964
|
timestamp: new Date().toISOString(),
|
|
23894
23965
|
message,
|
|
23895
23966
|
workingDir,
|
|
23896
23967
|
branch,
|
|
23897
|
-
hasUncommittedChanges
|
|
23968
|
+
hasUncommittedChanges,
|
|
23969
|
+
tags
|
|
23898
23970
|
};
|
|
23899
23971
|
const data = JSON.parse(fs3.readFileSync(`${fluxPath}${FLUX_BRAIN_DUMP_PATH}/${monthString}.json`, "utf8"));
|
|
23900
23972
|
config.sorted ? data.dumps.unshift(newDump) : data.dumps.push(newDump);
|
|
@@ -25252,82 +25324,88 @@ async function searchBrainDumpCommand(query) {
|
|
|
25252
25324
|
}
|
|
25253
25325
|
|
|
25254
25326
|
// src/commands/config.command.ts
|
|
25255
|
-
async function configCommand(
|
|
25256
|
-
console.log(
|
|
25327
|
+
async function configCommand(data) {
|
|
25328
|
+
console.log(`Updating key: ${data[0]} to ${data[1]}`);
|
|
25329
|
+
const fluxPath = await getFluxPath();
|
|
25257
25330
|
const fs4 = await import("fs");
|
|
25258
|
-
const config = await getConfigFile();
|
|
25259
|
-
|
|
25260
|
-
|
|
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));
|
|
25331
|
+
const config = await getConfigFile(fluxPath);
|
|
25332
|
+
if (data.length < 2) {
|
|
25333
|
+
console.log("Please provide a key and value to update the config. Example: flux config --add-tags notes ideas tasks");
|
|
25265
25334
|
return;
|
|
25266
25335
|
}
|
|
25267
|
-
|
|
25268
|
-
|
|
25269
|
-
|
|
25270
|
-
|
|
25271
|
-
|
|
25272
|
-
|
|
25273
|
-
|
|
25274
|
-
|
|
25275
|
-
|
|
25276
|
-
|
|
25277
|
-
|
|
25278
|
-
|
|
25279
|
-
|
|
25280
|
-
|
|
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"
|
|
25336
|
+
const key = data[0];
|
|
25337
|
+
const value = data.slice(1).join(" ");
|
|
25338
|
+
const editableKeys = [
|
|
25339
|
+
"hideWorkingDir",
|
|
25340
|
+
"hideBranchName",
|
|
25341
|
+
"hideUncommittedChanges",
|
|
25342
|
+
"resultLimit",
|
|
25343
|
+
"threshold",
|
|
25344
|
+
"includeScore",
|
|
25345
|
+
"defaultFocusDuration"
|
|
25346
|
+
];
|
|
25347
|
+
if (!editableKeys.includes(key)) {
|
|
25348
|
+
console.log(`Invalid config key.
|
|
25349
|
+
Editable keys are: ${editableKeys.join(", ")}`);
|
|
25350
|
+
return;
|
|
25318
25351
|
}
|
|
25319
|
-
|
|
25352
|
+
if (key === "hideWorkingDir") {
|
|
25353
|
+
config.privacy.hideWorkingDir = value === "true";
|
|
25354
|
+
}
|
|
25355
|
+
if (key === "hideBranchName") {
|
|
25356
|
+
config.privacy.hideBranchName = value === "true";
|
|
25357
|
+
}
|
|
25358
|
+
if (key === "hideUncommittedChanges") {
|
|
25359
|
+
config.privacy.hideUncommittedChanges = value === "true";
|
|
25360
|
+
}
|
|
25361
|
+
if (key === "resultLimit") {
|
|
25362
|
+
const limit = parseInt(value, 10);
|
|
25363
|
+
if (!isNaN(limit)) {
|
|
25364
|
+
config.search.resultLimit = limit;
|
|
25365
|
+
} else {
|
|
25366
|
+
console.log("Invalid value for resultLimit. Please provide a number.");
|
|
25367
|
+
return;
|
|
25368
|
+
}
|
|
25369
|
+
}
|
|
25370
|
+
if (key === "threshold") {
|
|
25371
|
+
const threshold = parseFloat(value);
|
|
25372
|
+
if (!isNaN(threshold)) {
|
|
25373
|
+
if (config.search && config.search.fuseOptions) {
|
|
25374
|
+
config.search.fuseOptions.threshold = threshold;
|
|
25375
|
+
}
|
|
25376
|
+
} else {
|
|
25377
|
+
console.log("Invalid value for threshold. Please provide a number.");
|
|
25378
|
+
return;
|
|
25379
|
+
}
|
|
25380
|
+
}
|
|
25381
|
+
if (key === "includeScore") {
|
|
25382
|
+
if (config.search && config.search.fuseOptions) {
|
|
25383
|
+
config.search.fuseOptions.includeScore = value === "true";
|
|
25384
|
+
}
|
|
25385
|
+
}
|
|
25386
|
+
if (key === "defaultFocusDuration") {
|
|
25387
|
+
const duration = parseInt(value, 10);
|
|
25388
|
+
if (!isNaN(duration)) {
|
|
25389
|
+
config.defaultFocusDuration = duration;
|
|
25390
|
+
} else {
|
|
25391
|
+
console.log("Invalid value for defaultFocusDuration. Please provide a number.");
|
|
25392
|
+
return;
|
|
25393
|
+
}
|
|
25394
|
+
}
|
|
25395
|
+
fs4.writeFileSync(fluxPath + FLUX_CONFIG_PATH, JSON.stringify(config, null, 4));
|
|
25396
|
+
console.log("Config updated successfully.");
|
|
25397
|
+
}
|
|
25320
25398
|
|
|
25321
25399
|
// src/index.ts
|
|
25322
25400
|
var program2 = new Command;
|
|
25323
25401
|
program2.name(`flux`).description("Git-aware CLI context manager for ADHD developers").version(package_default.version);
|
|
25324
25402
|
program2.command("init").description("Initialize flux in the current repository").action(initFluxCommand);
|
|
25325
25403
|
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) => {
|
|
25404
|
+
program2.command("dump [message...]").option("-m, --multiline", "Enable multiline input mode").option("-n, --notes", "Jot down a note").option("-i, --ideas", "Jot down an idea").option("-t, --tasks", "Jot down a task").option("-b, --bugs", "Jot down a bug").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
25405
|
await handleBrainDump(message, options);
|
|
25328
25406
|
});
|
|
25329
25407
|
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
25408
|
searchBrainDumpCommand(query ? query : [""]);
|
|
25331
25409
|
});
|
|
25332
|
-
program2.command("config
|
|
25410
|
+
program2.command("config [data...]").description("Update configuration fields. Example: flux config search.limit 10").action(configCommand);
|
|
25333
25411
|
program2.parse(process.argv);
|