@flowe-ai/cli 0.1.8 → 0.2.2

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 (36) hide show
  1. package/README.md +86 -7
  2. package/assets/menubar-icon.png +0 -0
  3. package/assets/notification-icon.png +0 -0
  4. package/audio/body_scan_60.ellie.cues.json +21 -21
  5. package/audio/body_scan_60.ellie.mp3 +0 -0
  6. package/audio/box_breath_45.ellie.cues.json +25 -25
  7. package/audio/box_breath_45.ellie.mp3 +0 -0
  8. package/audio/box_breath_60.ellie.cues.json +33 -33
  9. package/audio/box_breath_60.ellie.mp3 +0 -0
  10. package/audio/extended_box_90.ellie.cues.json +49 -49
  11. package/audio/extended_box_90.ellie.mp3 +0 -0
  12. package/audio/eye_rotation_30.ellie.cues.json +11 -11
  13. package/audio/eye_rotation_30.ellie.mp3 +0 -0
  14. package/audio/full_sensory_90.ellie.cues.json +17 -17
  15. package/audio/full_sensory_90.ellie.mp3 +0 -0
  16. package/audio/grounded_feet_45.ellie.cues.json +11 -11
  17. package/audio/grounded_feet_45.ellie.mp3 +0 -0
  18. package/audio/neck_rotation_45.ellie.cues.json +15 -15
  19. package/audio/neck_rotation_45.ellie.mp3 +0 -0
  20. package/audio/palming_60.ellie.cues.json +17 -17
  21. package/audio/palming_60.ellie.mp3 +0 -0
  22. package/audio/physiological_sigh_30.ellie.cues.json +13 -13
  23. package/audio/physiological_sigh_30.ellie.mp3 +0 -0
  24. package/audio/progressive_palming_90.ellie.cues.json +19 -19
  25. package/audio/progressive_palming_90.ellie.mp3 +0 -0
  26. package/audio/quick_palming_30.ellie.cues.json +11 -11
  27. package/audio/quick_palming_30.ellie.mp3 +0 -0
  28. package/bin/flowe.js +0 -0
  29. package/bin/menubar/flowe.1s.sh +96 -0
  30. package/dist/ambient-SIMIQWQM.js +1 -0
  31. package/dist/chunk-AX3TLBEV.js +2 -0
  32. package/dist/{chunk-CGFAXS4S.js → chunk-C6NO4B4N.js} +2 -2
  33. package/dist/cli.js +62 -23
  34. package/dist/mcp-server.js +1 -1
  35. package/package.json +6 -2
  36. package/skills/flowe/SKILL.md +69 -6
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Neural resets for engineers using AI coding assistants.
4
4
 
5
- Built by certified hypnotherapists and engineers. `flowe` runs short, breath-led resets in your terminal during Claude / Cursor / Aider thinking pauses. Local audio. No network round-trip. Instant start.
5
+ Built by certified hypnotherapists and engineers. `flowe` runs short, breath-led resets in your terminal during Claude / Cursor / Aider thinking pauses. Reset audio is local and instant. Focus sessions add longer work/break cycles with cached ambience.
6
6
 
7
7
  ![flowe reset 30](https://vhs.charm.sh/vhs-5236yNEd5wVqAEYTZTxJat.gif)
8
8
 
@@ -23,6 +23,11 @@ flowe reset # interactive picker — choose duration + protocol
23
23
  flowe reset 60 # 60-second reset, random protocol
24
24
  flowe reset 60 --protocol box_breath # deterministic — box-breathing only
25
25
  flowe reset --quick # skip the picker, use defaults
26
+
27
+ flowe focus # interactive focus picker — preset + ambient sound
28
+ flowe focus pomodoro --ambient nature_spring_birds
29
+ flowe focus dev --detach --ambient rain_window_soft
30
+ flowe focus status
26
31
  ```
27
32
 
28
33
  Press `q` or `Ctrl+C` to abandon a session. The TUI returns you to a clean prompt.
@@ -31,7 +36,9 @@ Press `q` or `Ctrl+C` to abandon a session. The TUI returns you to a clean promp
31
36
 
32
37
  When your agent is thinking for 30–120 seconds, your nervous system has two real options. Tab to reels and your working memory drains, dopamine spikes, focus fragments. Or run a science-backed neural reset that restores focus and steadies your nervous system. `flowe reset` is the second option, sized for the agent wait window.
33
38
 
34
- Twelve protocols ship with v1:
39
+ When you are settling into longer work, `flowe focus` gives you a visible work/break cadence with optional ambient sound. It can run in the foreground TUI, detach into the background, or show live controls in the macOS menu bar.
40
+
41
+ Eleven protocol families ship with the CLI:
35
42
 
36
43
  | Family | Durations | What it is |
37
44
  |---|---|---|
@@ -49,6 +56,68 @@ Twelve protocols ship with v1:
49
56
 
50
57
  Run `flowe protocols` to see the full list.
51
58
 
59
+ ## Focus cycles
60
+
61
+ ```bash
62
+ flowe focus # pick preset + ambience interactively
63
+ flowe focus pomodoro # 25/5, 4 focus blocks
64
+ flowe focus dev # 50/10, 3 focus blocks
65
+ flowe focus ultradian # 90/15, 2 focus blocks
66
+ flowe focus pomodoro --ambient none # silence
67
+ ```
68
+
69
+ The foreground focus TUI uses the same calm particle-orb visual language as `flowe reset`, with the literal countdown shown above it. Space pauses and resumes, `s` skips to the next phase, `q` quits, and `?` shows help.
70
+
71
+ For long-running work, detach the session so your shell is free:
72
+
73
+ ```bash
74
+ flowe focus pomodoro --detach --ambient nature_spring_birds
75
+ flowe focus status
76
+ flowe focus pause
77
+ flowe focus resume
78
+ flowe focus skip
79
+ flowe focus quit
80
+ flowe focus --attach
81
+ ```
82
+
83
+ Detached focus sessions keep their state on disk so another terminal, the attach TUI, or the menu bar plugin can control the same cycle.
84
+
85
+ ## Ambient sound
86
+
87
+ Hosted ambient sounds are fetched from the flowe manifest at startup, downloaded once, and cached under `~/.config/flowe/cache/ambient/`. If the manifest or download fails, focus falls back to silence instead of failing the session.
88
+
89
+ Useful built-in ambient ids include:
90
+
91
+ | Ambient id | Feel |
92
+ |---|---|
93
+ | `nature_spring_birds` | Light spring morning birds |
94
+ | `rain_window_soft` | Soft rain against a window |
95
+ | `tones_deep_brown_noise` | Deep masking noise for focus |
96
+ | `seaside_la_sunrise` | Peaceful Los Angeles sunrise beach |
97
+ | `interiors_quiet_cafe` | Quiet cafe ambience |
98
+ | `none` | No ambient sound |
99
+
100
+ You can also generate custom ambience from a prompt. This requires `flowe login` and paid access.
101
+
102
+ ```bash
103
+ flowe ambient create "quiet library, soft page turns, distant rain" --name "library rain"
104
+ flowe ambient list
105
+ flowe focus pomodoro --ambient custom_abc123def456
106
+ ```
107
+
108
+ Custom sounds are saved locally and appear in the focus ambience picker under `custom`.
109
+
110
+ ## Menu bar
111
+
112
+ On macOS, `flowe` can install a SwiftBar plugin that shows the current focus cycle in your menu bar and gives you pause/resume/skip/quit controls.
113
+
114
+ ```bash
115
+ flowe install-menubar
116
+ flowe uninstall-menubar
117
+ ```
118
+
119
+ The installer writes a small SwiftBar script with absolute `node` and `flowe` paths, then launches or restarts SwiftBar so it discovers the plugin. When no focus session is active, the menu gives quick-start actions for Pomodoro, dev, and ultradian sessions.
120
+
52
121
  ## Voices
53
122
 
54
123
  ```bash
@@ -56,12 +125,14 @@ flowe voice # show current + available voices
56
125
  flowe voice sage # set voice
57
126
  ```
58
127
 
59
- Three voices ship with v1: **`ada`**, **`ellie`**, **`sage`**. Pick the one you want to hear at 3pm. Default is `ellie`. Hear samples at [cli.flowe.ai/#voices](https://cli.flowe.ai/#voices).
128
+ Three voices ship with the CLI: **`ada`**, **`ellie`**, **`sage`**. Pick the one you want to hear at 3pm. Default is `ellie`. Hear samples at [cli.flowe.ai/#voices](https://cli.flowe.ai/#voices).
60
129
 
61
130
  ## Use with Claude Code
62
131
 
63
132
  `flowe` ships a Claude Code skill that fires resets for you automatically during long thinking pauses. Claude picks the protocol based on what it's observed about your recent state (eye strain, frustration, cognitive overload, postural tightness, wind-down).
64
133
 
134
+ The skill also knows about focus cycles. At the start of a workday or a substantial task, Claude can ask whether you want Pomodoro, dev, or ultradian focus, offer ambience options `1-5` plus `0` for none, and then start the session detached with the selected ambient sound.
135
+
65
136
  ```bash
66
137
  flowe install-skill
67
138
  ```
@@ -84,6 +155,8 @@ flowe login
84
155
 
85
156
  Pairs your CLI with a flowe.ai account so resets feed your retention dashboard. Anonymous use works fine — events still flow with a stable anonymous ID. Telemetry can be turned off entirely with `FLOWE_OPT_OUT=1` in your shell environment.
86
157
 
158
+ Login is required for custom ambient generation.
159
+
87
160
  ## Status
88
161
 
89
162
  ```bash
@@ -93,7 +166,7 @@ flowe whoami # current auth status
93
166
 
94
167
  ## Configuration
95
168
 
96
- Config lives at `~/.config/flowe/config.json`. Voice preference, telemetry mode, and the anonymous ID. Login tokens go in the OS keychain via `keytar`, never on disk.
169
+ Config lives at `~/.config/flowe/config.json`. Voice preference, telemetry mode, and the anonymous ID live there. Ambient MP3s are cached under `~/.config/flowe/cache/ambient/`. Login tokens go in the OS keychain via `keytar`, never on disk.
97
170
 
98
171
  ## Privacy
99
172
 
@@ -109,6 +182,12 @@ Config lives at `~/.config/flowe/config.json`. Voice preference, telemetry mode,
109
182
 
110
183
  **Session won't start, "agent_busy".** A previous reset is still running. Wait for it to finish or run `flowe status` to see what's open.
111
184
 
185
+ **Focus session says one is already running.** Run `flowe focus status` to inspect it, `flowe focus --attach` to watch it, or `flowe focus quit` to stop it.
186
+
187
+ **Ambient sound does not appear.** Run `flowe focus` interactively so the CLI can refresh the hosted manifest. Network failures degrade to silence; custom ambience also requires `flowe login`.
188
+
189
+ **Menu bar stays idle during a focus session.** Reinstall or restart the plugin with `flowe install-menubar`. SwiftBar sometimes needs a restart to re-scan newly written plugin files.
190
+
112
191
  **Login redirects but never completes.** The device-grant flow waits up to 5 minutes. If the browser closes early, run `flowe login` again.
113
192
 
114
193
  ## Exit codes
@@ -117,9 +196,9 @@ Config lives at `~/.config/flowe/config.json`. Voice preference, telemetry mode,
117
196
  |---|---|
118
197
  | `0` | Success |
119
198
  | `1` | User error (bad flag, unknown protocol family) |
120
- | `2` | Network error (telemetry, login, macro session) |
121
- | `3` | Auth required or expired |
122
- | `4` | Audio device unavailable |
199
+ | `2` | Auth required or expired |
200
+ | `3` | Session already running |
201
+ | `4` | Network/offline/audio failure |
123
202
 
124
203
  ## License
125
204
 
Binary file
Binary file
@@ -1,67 +1,67 @@
1
1
  {
2
2
  "protocol_id": "body_scan_60",
3
3
  "voice": "ellie",
4
- "duration_ms": 24080,
4
+ "duration_ms": 26120,
5
5
  "cues": [
6
6
  {
7
7
  "label": "head",
8
8
  "mode": "grounding",
9
- "start_ms": 1620,
10
- "end_ms": 2520
9
+ "start_ms": 1900,
10
+ "end_ms": 2880
11
11
  },
12
12
  {
13
13
  "label": "jaw",
14
14
  "mode": "grounding",
15
- "start_ms": 2520,
16
- "end_ms": 4200
15
+ "start_ms": 2880,
16
+ "end_ms": 4760
17
17
  },
18
18
  {
19
19
  "label": "shoulders",
20
20
  "mode": "grounding",
21
- "start_ms": 4200,
22
- "end_ms": 5500
21
+ "start_ms": 4760,
22
+ "end_ms": 6180
23
23
  },
24
24
  {
25
25
  "label": "chest",
26
26
  "mode": "grounding",
27
- "start_ms": 5500,
28
- "end_ms": 7400
27
+ "start_ms": 6180,
28
+ "end_ms": 8180
29
29
  },
30
30
  {
31
31
  "label": "hands",
32
32
  "mode": "grounding",
33
- "start_ms": 7400,
34
- "end_ms": 9300
33
+ "start_ms": 8180,
34
+ "end_ms": 9720
35
35
  },
36
36
  {
37
37
  "label": "stomach",
38
38
  "mode": "grounding",
39
- "start_ms": 9300,
40
- "end_ms": 10740
39
+ "start_ms": 9720,
40
+ "end_ms": 11260
41
41
  },
42
42
  {
43
43
  "label": "hips",
44
44
  "mode": "grounding",
45
- "start_ms": 10740,
46
- "end_ms": 11220
45
+ "start_ms": 11260,
46
+ "end_ms": 11920
47
47
  },
48
48
  {
49
49
  "label": "legs",
50
50
  "mode": "grounding",
51
- "start_ms": 11220,
52
- "end_ms": 12540
51
+ "start_ms": 11920,
52
+ "end_ms": 13600
53
53
  },
54
54
  {
55
55
  "label": "feet",
56
56
  "mode": "grounding",
57
- "start_ms": 12540,
58
- "end_ms": 20440
57
+ "start_ms": 13600,
58
+ "end_ms": 22140
59
59
  },
60
60
  {
61
61
  "label": "whole body",
62
62
  "mode": "grounding",
63
- "start_ms": 20440,
64
- "end_ms": 23500
63
+ "start_ms": 22140,
64
+ "end_ms": 25620
65
65
  }
66
66
  ]
67
67
  }
Binary file
@@ -1,101 +1,101 @@
1
1
  {
2
2
  "protocol_id": "box_breath_45",
3
3
  "voice": "ellie",
4
- "duration_ms": 24360,
4
+ "duration_ms": 24580,
5
5
  "cues": [
6
6
  {
7
7
  "label": "inhale 4",
8
8
  "mode": "breath",
9
- "start_ms": 2800,
10
- "end_ms": 5180,
9
+ "start_ms": 2980,
10
+ "end_ms": 4680,
11
11
  "phase": "inhale",
12
12
  "round": 1
13
13
  },
14
14
  {
15
15
  "label": "hold 4",
16
16
  "mode": "breath",
17
- "start_ms": 5180,
18
- "end_ms": 6340,
17
+ "start_ms": 4680,
18
+ "end_ms": 6080,
19
19
  "phase": "hold_in",
20
20
  "round": 1
21
21
  },
22
22
  {
23
23
  "label": "exhale 4",
24
24
  "mode": "breath",
25
- "start_ms": 6340,
26
- "end_ms": 8260,
25
+ "start_ms": 6080,
26
+ "end_ms": 7700,
27
27
  "phase": "exhale",
28
28
  "round": 1
29
29
  },
30
30
  {
31
31
  "label": "hold 4",
32
32
  "mode": "breath",
33
- "start_ms": 8260,
34
- "end_ms": 10440,
33
+ "start_ms": 7700,
34
+ "end_ms": 9360,
35
35
  "phase": "hold_out",
36
36
  "round": 1
37
37
  },
38
38
  {
39
39
  "label": "inhale 4",
40
40
  "mode": "breath",
41
- "start_ms": 10440,
42
- "end_ms": 12240,
41
+ "start_ms": 9360,
42
+ "end_ms": 11440,
43
43
  "phase": "inhale",
44
44
  "round": 2
45
45
  },
46
46
  {
47
47
  "label": "hold 4",
48
48
  "mode": "breath",
49
- "start_ms": 12240,
50
- "end_ms": 13920,
49
+ "start_ms": 11440,
50
+ "end_ms": 13200,
51
51
  "phase": "hold_in",
52
52
  "round": 2
53
53
  },
54
54
  {
55
55
  "label": "exhale 4",
56
56
  "mode": "breath",
57
- "start_ms": 13920,
58
- "end_ms": 15820,
57
+ "start_ms": 13200,
58
+ "end_ms": 15080,
59
59
  "phase": "exhale",
60
60
  "round": 2
61
61
  },
62
62
  {
63
63
  "label": "hold 4",
64
64
  "mode": "breath",
65
- "start_ms": 15820,
66
- "end_ms": 18360,
65
+ "start_ms": 15080,
66
+ "end_ms": 17540,
67
67
  "phase": "hold_out",
68
68
  "round": 2
69
69
  },
70
70
  {
71
71
  "label": "inhale 4",
72
72
  "mode": "breath",
73
- "start_ms": 18360,
74
- "end_ms": 19800,
73
+ "start_ms": 17540,
74
+ "end_ms": 19640,
75
75
  "phase": "inhale",
76
76
  "round": 3
77
77
  },
78
78
  {
79
79
  "label": "hold 4",
80
80
  "mode": "breath",
81
- "start_ms": 19800,
82
- "end_ms": 21500,
81
+ "start_ms": 19640,
82
+ "end_ms": 21540,
83
83
  "phase": "hold_in",
84
84
  "round": 3
85
85
  },
86
86
  {
87
87
  "label": "exhale 4",
88
88
  "mode": "breath",
89
- "start_ms": 21500,
90
- "end_ms": 23180,
89
+ "start_ms": 21540,
90
+ "end_ms": 23520,
91
91
  "phase": "exhale",
92
92
  "round": 3
93
93
  },
94
94
  {
95
95
  "label": "hold 4",
96
96
  "mode": "breath",
97
- "start_ms": 23180,
98
- "end_ms": 23560,
97
+ "start_ms": 23520,
98
+ "end_ms": 23860,
99
99
  "phase": "hold_out",
100
100
  "round": 3
101
101
  }
Binary file
@@ -1,133 +1,133 @@
1
1
  {
2
2
  "protocol_id": "box_breath_60",
3
3
  "voice": "ellie",
4
- "duration_ms": 36800,
4
+ "duration_ms": 35220,
5
5
  "cues": [
6
6
  {
7
7
  "label": "inhale 4",
8
8
  "mode": "breath",
9
- "start_ms": 4200,
10
- "end_ms": 6760,
9
+ "start_ms": 3900,
10
+ "end_ms": 5840,
11
11
  "phase": "inhale",
12
12
  "round": 1
13
13
  },
14
14
  {
15
15
  "label": "hold 4",
16
16
  "mode": "breath",
17
- "start_ms": 6760,
18
- "end_ms": 8640,
17
+ "start_ms": 5840,
18
+ "end_ms": 7360,
19
19
  "phase": "hold_in",
20
20
  "round": 1
21
21
  },
22
22
  {
23
23
  "label": "exhale 4",
24
24
  "mode": "breath",
25
- "start_ms": 8640,
26
- "end_ms": 11460,
25
+ "start_ms": 7360,
26
+ "end_ms": 10280,
27
27
  "phase": "exhale",
28
28
  "round": 1
29
29
  },
30
30
  {
31
31
  "label": "hold 4",
32
32
  "mode": "breath",
33
- "start_ms": 11460,
34
- "end_ms": 13840,
33
+ "start_ms": 10280,
34
+ "end_ms": 12160,
35
35
  "phase": "hold_out",
36
36
  "round": 1
37
37
  },
38
38
  {
39
39
  "label": "inhale 4",
40
40
  "mode": "breath",
41
- "start_ms": 13840,
42
- "end_ms": 15280,
41
+ "start_ms": 12160,
42
+ "end_ms": 13760,
43
43
  "phase": "inhale",
44
44
  "round": 2
45
45
  },
46
46
  {
47
47
  "label": "hold 4",
48
48
  "mode": "breath",
49
- "start_ms": 15280,
50
- "end_ms": 17100,
49
+ "start_ms": 13760,
50
+ "end_ms": 15480,
51
51
  "phase": "hold_in",
52
52
  "round": 2
53
53
  },
54
54
  {
55
55
  "label": "exhale 4",
56
56
  "mode": "breath",
57
- "start_ms": 17100,
58
- "end_ms": 19140,
57
+ "start_ms": 15480,
58
+ "end_ms": 17400,
59
59
  "phase": "exhale",
60
60
  "round": 2
61
61
  },
62
62
  {
63
63
  "label": "hold 4",
64
64
  "mode": "breath",
65
- "start_ms": 19140,
66
- "end_ms": 21620,
65
+ "start_ms": 17400,
66
+ "end_ms": 19160,
67
67
  "phase": "hold_out",
68
68
  "round": 2
69
69
  },
70
70
  {
71
71
  "label": "inhale 4",
72
72
  "mode": "breath",
73
- "start_ms": 21620,
74
- "end_ms": 23600,
73
+ "start_ms": 19160,
74
+ "end_ms": 21000,
75
75
  "phase": "inhale",
76
76
  "round": 3
77
77
  },
78
78
  {
79
79
  "label": "hold 4",
80
80
  "mode": "breath",
81
- "start_ms": 23600,
82
- "end_ms": 25120,
81
+ "start_ms": 21000,
82
+ "end_ms": 22840,
83
83
  "phase": "hold_in",
84
84
  "round": 3
85
85
  },
86
86
  {
87
87
  "label": "exhale 4",
88
88
  "mode": "breath",
89
- "start_ms": 25120,
90
- "end_ms": 27020,
89
+ "start_ms": 22840,
90
+ "end_ms": 24320,
91
91
  "phase": "exhale",
92
92
  "round": 3
93
93
  },
94
94
  {
95
95
  "label": "hold 4",
96
96
  "mode": "breath",
97
- "start_ms": 27020,
98
- "end_ms": 29280,
97
+ "start_ms": 24320,
98
+ "end_ms": 26860,
99
99
  "phase": "hold_out",
100
100
  "round": 3
101
101
  },
102
102
  {
103
103
  "label": "inhale 4",
104
104
  "mode": "breath",
105
- "start_ms": 29280,
106
- "end_ms": 31460,
105
+ "start_ms": 26860,
106
+ "end_ms": 29360,
107
107
  "phase": "inhale",
108
108
  "round": 4
109
109
  },
110
110
  {
111
111
  "label": "hold 4",
112
112
  "mode": "breath",
113
- "start_ms": 31460,
114
- "end_ms": 33000,
113
+ "start_ms": 29360,
114
+ "end_ms": 31580,
115
115
  "phase": "hold_in",
116
116
  "round": 4
117
117
  },
118
118
  {
119
119
  "label": "exhale 4",
120
120
  "mode": "breath",
121
- "start_ms": 33000,
122
- "end_ms": 34460,
121
+ "start_ms": 31580,
122
+ "end_ms": 33160,
123
123
  "phase": "exhale",
124
124
  "round": 4
125
125
  },
126
126
  {
127
127
  "label": "hold 4",
128
128
  "mode": "breath",
129
- "start_ms": 34460,
130
- "end_ms": 34820,
129
+ "start_ms": 33160,
130
+ "end_ms": 33560,
131
131
  "phase": "hold_out",
132
132
  "round": 4
133
133
  }
Binary file