floq 0.0.1 → 0.2.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 (55) hide show
  1. package/README.ja.md +157 -29
  2. package/README.md +157 -29
  3. package/dist/changelog.d.ts +13 -0
  4. package/dist/changelog.js +95 -0
  5. package/dist/cli.js +70 -1
  6. package/dist/commands/add.js +5 -6
  7. package/dist/commands/comment.d.ts +2 -0
  8. package/dist/commands/comment.js +67 -0
  9. package/dist/commands/config.d.ts +7 -0
  10. package/dist/commands/config.js +163 -14
  11. package/dist/commands/done.js +4 -6
  12. package/dist/commands/list.js +9 -13
  13. package/dist/commands/move.js +4 -6
  14. package/dist/commands/project.js +18 -26
  15. package/dist/commands/setup.d.ts +1 -0
  16. package/dist/commands/setup.js +13 -0
  17. package/dist/config.d.ts +15 -1
  18. package/dist/config.js +53 -2
  19. package/dist/db/index.d.ts +5 -4
  20. package/dist/db/index.js +127 -32
  21. package/dist/db/schema.d.ts +83 -0
  22. package/dist/db/schema.js +6 -0
  23. package/dist/i18n/en.d.ts +258 -0
  24. package/dist/i18n/en.js +138 -3
  25. package/dist/i18n/ja.js +138 -3
  26. package/dist/index.js +33 -1
  27. package/dist/paths.d.ts +4 -0
  28. package/dist/paths.js +63 -5
  29. package/dist/ui/App.js +384 -136
  30. package/dist/ui/ModeSelector.d.ts +7 -0
  31. package/dist/ui/ModeSelector.js +37 -0
  32. package/dist/ui/SetupWizard.d.ts +6 -0
  33. package/dist/ui/SetupWizard.js +321 -0
  34. package/dist/ui/ThemeSelector.d.ts +1 -1
  35. package/dist/ui/ThemeSelector.js +23 -10
  36. package/dist/ui/components/FunctionKeyBar.d.ts +5 -4
  37. package/dist/ui/components/FunctionKeyBar.js +19 -15
  38. package/dist/ui/components/HelpModal.d.ts +2 -1
  39. package/dist/ui/components/HelpModal.js +118 -4
  40. package/dist/ui/components/KanbanBoard.d.ts +6 -0
  41. package/dist/ui/components/KanbanBoard.js +508 -0
  42. package/dist/ui/components/KanbanColumn.d.ts +12 -0
  43. package/dist/ui/components/KanbanColumn.js +11 -0
  44. package/dist/ui/components/ProgressBar.d.ts +7 -0
  45. package/dist/ui/components/ProgressBar.js +13 -0
  46. package/dist/ui/components/SearchBar.d.ts +8 -0
  47. package/dist/ui/components/SearchBar.js +11 -0
  48. package/dist/ui/components/SearchResults.d.ts +9 -0
  49. package/dist/ui/components/SearchResults.js +18 -0
  50. package/dist/ui/components/TaskItem.d.ts +6 -1
  51. package/dist/ui/components/TaskItem.js +3 -2
  52. package/dist/ui/theme/themes.d.ts +12 -0
  53. package/dist/ui/theme/themes.js +495 -3
  54. package/dist/ui/theme/types.d.ts +1 -1
  55. package/package.json +2 -1
package/README.ja.md CHANGED
@@ -7,15 +7,28 @@ MS-DOSスタイルのテーマを備えたターミナルベースのGTD(Getti
7
7
  ## 特徴
8
8
 
9
9
  - **TUIインターフェース**: Ink(CLI用React)で構築されたインタラクティブなターミナルUI
10
- - **GTDワークフロー**: Inbox、Next Actions、Waiting For、Someday/Maybe
11
- - **プロジェクト**: タスクをプロジェクトに整理
10
+ - **GTDワークフロー**: Inbox、Next Actions、Waiting For、Someday/Maybe、Done
11
+ - **カンバンモード**: 3カラムのカンバンボード表示(TODO、Doing、Done)
12
+ - **プロジェクト**: タスクをプロジェクトに整理(進捗バー表示付き)
13
+ - **タスク検索**: `/` キーで全タスクを素早く検索
14
+ - **コメント**: タスクにメモやコメントを追加
15
+ - **クラウド同期**: [Turso](https://turso.tech/)のembedded replicasによるオプションの同期機能
12
16
  - **テーマ**: MS-DOSノスタルジックスタイルを含む複数テーマ
13
17
  - **多言語対応**: 英語・日本語サポート
14
18
  - **Vimスタイルナビゲーション**: hjklまたは矢印キーで操作
19
+ - **セットアップウィザード**: 初回起動時の簡単設定
15
20
 
16
21
  ## インストール
17
22
 
18
23
  ```bash
24
+ npm install -g floq
25
+ ```
26
+
27
+ ### ソースからインストール
28
+
29
+ ```bash
30
+ git clone https://github.com/polidog/gtd-cli.git
31
+ cd gtd-cli
19
32
  npm install
20
33
  npm run build
21
34
  npm link
@@ -29,11 +42,11 @@ npm link
29
42
  floq
30
43
  ```
31
44
 
32
- ### キーボードショートカット
45
+ ### キーボードショートカット(GTDモード)
33
46
 
34
47
  | キー | アクション |
35
48
  |------|-----------|
36
- | `1-5` | タブ切り替え |
49
+ | `1-6` | タブ切り替え(Inbox/Next/Waiting/Someday/Projects/Done) |
37
50
  | `h/l` または `←/→` | 前/次のタブ |
38
51
  | `j/k` または `↑/↓` | タスク選択 |
39
52
  | `a` | タスク追加 |
@@ -41,14 +54,75 @@ floq
41
54
  | `n` | Next Actionsに移動 |
42
55
  | `s` | Someday/Maybeに移動 |
43
56
  | `i` | Inboxに移動 |
57
+ | `w` | Waiting Forに移動(担当者入力) |
44
58
  | `p` | プロジェクトに変換 |
45
59
  | `P` | プロジェクトに紐付け |
46
- | `Enter` | プロジェクトを開く(Projectsタブ) |
47
- | `Esc/b` | プロジェクトから戻る |
60
+ | `Enter` | タスク詳細を開く / プロジェクトを開く |
61
+ | `Esc/b` | 戻る |
62
+ | `/` | タスク検索 |
63
+ | `r` | 更新 |
64
+ | `?` | ヘルプ |
65
+ | `q` | 終了 |
66
+
67
+ #### プロジェクト詳細画面
68
+
69
+ | キー | アクション |
70
+ |------|-----------|
71
+ | `j/k` | タスク選択 |
72
+ | `a` | プロジェクトにタスク追加 |
73
+ | `d` | タスクを完了にする |
74
+ | `Enter` | タスク詳細を開く |
75
+ | `Esc/b` | プロジェクト一覧に戻る |
76
+
77
+ #### タスク詳細画面
78
+
79
+ | キー | アクション |
80
+ |------|-----------|
81
+ | `i` | コメント追加 |
82
+ | `d` | 選択中のコメントを削除 |
83
+ | `P` | プロジェクトに紐付け |
84
+ | `j/k` | コメント選択 |
85
+ | `Esc/b` | 一覧 / プロジェクトに戻る |
86
+
87
+ ### キーボードショートカット(カンバンモード)
88
+
89
+ | キー | アクション |
90
+ |------|-----------|
91
+ | `1-3` | カラム切り替え(TODO/Doing/Done) |
92
+ | `h/l` または `←/→` | 前/次のカラム |
93
+ | `j/k` または `↑/↓` | タスク選択 |
94
+ | `a` | タスク追加 |
95
+ | `d` | 完了にする |
96
+ | `m` | タスクを右に移動(→) |
97
+ | `Backspace` | タスクを左に移動(←) |
98
+ | `Enter` | タスク詳細を開く |
99
+ | `/` | タスク検索 |
48
100
  | `r` | 更新 |
49
101
  | `?` | ヘルプ |
50
102
  | `q` | 終了 |
51
103
 
104
+ #### タスク詳細画面(カンバン)
105
+
106
+ | キー | アクション |
107
+ |------|-----------|
108
+ | `i` | コメント追加 |
109
+ | `d` | 選択中のコメントを削除 |
110
+ | `j/k` | コメント選択 |
111
+ | `Esc/b` | ボードに戻る |
112
+
113
+ ### セットアップウィザード
114
+
115
+ 初回起動時、Floqはインタラクティブなセットアップウィザードを起動します:
116
+ - 言語(英語/日本語)
117
+ - テーマ選択
118
+ - 表示モード(GTD/カンバン)
119
+
120
+ 手動でウィザードを起動することもできます:
121
+
122
+ ```bash
123
+ floq setup
124
+ ```
125
+
52
126
  ### CLIコマンド
53
127
 
54
128
  ```bash
@@ -77,6 +151,10 @@ floq project add "プロジェクト名"
77
151
  floq project list
78
152
  floq project show <id>
79
153
  floq project complete <id>
154
+
155
+ # コメント
156
+ floq comment <id> "コメント内容" # コメント追加
157
+ floq comment <id> # コメント一覧
80
158
  ```
81
159
 
82
160
  ## 設定
@@ -89,44 +167,94 @@ floq config show
89
167
  floq config lang en # 英語
90
168
  floq config lang ja # 日本語
91
169
 
92
- # テーマ設定
170
+ # テーマ設定(j/kで選択するインタラクティブセレクター)
171
+ floq config theme
172
+
173
+ # または直接指定
93
174
  floq config theme modern # デフォルト
94
- floq config theme norton-commander # MS-DOSスタイル
95
- floq config theme dos-prompt # 緑テキスト
96
- floq config theme turbo-pascal # IDEスタイル
175
+ floq config theme synthwave # ネオン80sスタイル
176
+
177
+ # 表示モード設定(インタラクティブセレクター)
178
+ floq config mode
179
+
180
+ # または直接指定
181
+ floq config mode gtd # GTDワークフロー(デフォルト)
182
+ floq config mode kanban # カンバンボード
97
183
 
98
184
  # データベースパス設定
99
185
  floq config db /path/to/custom.db
100
186
  floq config db # デフォルトに戻す
187
+
188
+ # データベースリセット(全データ削除)
189
+ floq db reset # 確認あり
190
+ floq db reset --force # 確認なし
101
191
  ```
102
192
 
103
- ## テーマ
193
+ ## クラウド同期(Turso)
104
194
 
105
- ### modern(デフォルト)
106
- シンプルでクリーンなスタイル。シングルボーダー。
195
+ Floqは[Turso](https://turso.tech/)を使用したクラウド同期をサポートしています。Embedded replicasにより、データはクラウドに同期されつつ、オフラインでも利用可能です。
107
196
 
108
- ### norton-commander
109
- - ダブルラインボーダー(╔═╗║╚═╝)
110
- - 大文字ヘッダー
111
- - 画面下部にファンクションキーバー
112
- - シアン/黄色のカラースキーム
197
+ ### セットアップ
113
198
 
114
- ### dos-prompt
115
- - シングルラインボーダー
116
- - 緑テキスト(CRTモニター風)
117
- - シンプルな `>` 選択インジケータ
199
+ 1. [turso.tech](https://turso.tech/)でデータベースを作成
200
+ 2. データベースURLと認証トークンを取得
201
+ 3. Floqを設定:
118
202
 
119
- ### turbo-pascal
120
- - ダブルラインボーダー
121
- - 黄色のアクセント
122
- - IDE風の外観
203
+ ```bash
204
+ # Turso同期を有効化
205
+ floq config turso --url libsql://your-db.turso.io --token your-auth-token
206
+
207
+ # 設定確認
208
+ floq config show
209
+
210
+ # 手動同期
211
+ floq sync
212
+
213
+ # Turso同期を無効化
214
+ floq config turso --disable
215
+ ```
216
+
217
+ ### 仕組み
218
+
219
+ - **Embedded Replicas**: ローカルSQLiteデータベースがTursoクラウドと同期
220
+ - **オフラインサポート**: オフラインでも動作し、接続時に同期
221
+ - **自動同期**: オンライン時は60秒ごとにバックグラウンド同期
222
+ - **データベース分離**: Tursoモードは`floq-turso.db`を使用し、ローカルDBと競合しない
223
+
224
+ ### ステータス表示
225
+
226
+ - TUIヘッダーに接続状態を表示(Tursoはクラウドアイコン、ローカルはローカルアイコン)
227
+ - CLIコマンド実行時、Turso有効時は`🔄 Turso sync: hostname`を表示
228
+
229
+ ## テーマ
123
230
 
124
- > **注意**: 背景色はターミナルの設定に依存します。完全なDOS体験のためには、ターミナルの背景色を青(#0000AA)に設定してください。
231
+ 16種類のテーマが利用可能。`floq config theme` でインタラクティブに選択(j/kで移動)。
232
+
233
+ | テーマ | 説明 |
234
+ |--------|------|
235
+ | `modern` | シンプルでクリーン(デフォルト) |
236
+ | `norton-commander` | MS-DOSファイルマネージャー風 |
237
+ | `dos-prompt` | 緑のCRTモニター |
238
+ | `turbo-pascal` | Borland IDE風 |
239
+ | `classic-mac` | Macintosh System 7モノクロ |
240
+ | `apple-ii` | Apple ][ グリーンモニター |
241
+ | `commodore-64` | C64の青紫カラー |
242
+ | `amiga-workbench` | Amigaのオレンジ&ブルー |
243
+ | `matrix` | デジタルレイン風グリーン |
244
+ | `amber-crt` | 琥珀色モニター |
245
+ | `phosphor` | CRT残光エフェクト |
246
+ | `solarized-dark` | Solarizedダーク |
247
+ | `solarized-light` | Solarizedライト |
248
+ | `synthwave` | ネオン80sスタイル |
249
+ | `paper` | 紙とインク風ライト |
250
+ | `coffee` | 暖かみのある茶系 |
251
+
252
+ > **注意**: 背景色はターミナルの設定に依存します。
125
253
 
126
254
  ## データ保存場所
127
255
 
128
- - 設定: `~/.config/gtd-cli/config.json`
129
- - データベース: `~/.local/share/gtd-cli/gtd.db`
256
+ - 設定: `~/.config/floq/config.json`
257
+ - データベース: `~/.local/share/floq/floq.db`(Turso有効時は`floq-turso.db`)
130
258
 
131
259
  ## ライセンス
132
260
 
package/README.md CHANGED
@@ -7,15 +7,28 @@ A terminal-based GTD (Getting Things Done) task manager with MS-DOS style themes
7
7
  ## Features
8
8
 
9
9
  - **TUI Interface**: Interactive terminal UI built with Ink (React for CLI)
10
- - **GTD Workflow**: Inbox, Next Actions, Waiting For, Someday/Maybe
11
- - **Projects**: Organize tasks into projects
10
+ - **GTD Workflow**: Inbox, Next Actions, Waiting For, Someday/Maybe, Done
11
+ - **Kanban Mode**: 3-column kanban board view (TODO, Doing, Done)
12
+ - **Projects**: Organize tasks into projects with progress tracking
13
+ - **Task Search**: Quick search across all tasks with `/`
14
+ - **Comments**: Add notes and comments to tasks
15
+ - **Cloud Sync**: Optional sync with [Turso](https://turso.tech/) using embedded replicas
12
16
  - **Themes**: Multiple themes including MS-DOS nostalgic styles
13
17
  - **i18n**: English and Japanese support
14
18
  - **Vim-style Navigation**: Use hjkl or arrow keys
19
+ - **Setup Wizard**: First-run wizard for easy configuration
15
20
 
16
21
  ## Installation
17
22
 
18
23
  ```bash
24
+ npm install -g floq
25
+ ```
26
+
27
+ ### From Source
28
+
29
+ ```bash
30
+ git clone https://github.com/polidog/gtd-cli.git
31
+ cd gtd-cli
19
32
  npm install
20
33
  npm run build
21
34
  npm link
@@ -29,11 +42,11 @@ npm link
29
42
  floq
30
43
  ```
31
44
 
32
- ### Keyboard Shortcuts
45
+ ### Keyboard Shortcuts (GTD Mode)
33
46
 
34
47
  | Key | Action |
35
48
  |-----|--------|
36
- | `1-5` | Switch tabs |
49
+ | `1-6` | Switch tabs (Inbox/Next/Waiting/Someday/Projects/Done) |
37
50
  | `h/l` or `←/→` | Previous/Next tab |
38
51
  | `j/k` or `↑/↓` | Navigate tasks |
39
52
  | `a` | Add task |
@@ -41,14 +54,75 @@ floq
41
54
  | `n` | Move to Next Actions |
42
55
  | `s` | Move to Someday/Maybe |
43
56
  | `i` | Move to Inbox |
57
+ | `w` | Move to Waiting For (prompts for person) |
44
58
  | `p` | Convert to project |
45
59
  | `P` | Link to project |
46
- | `Enter` | Open project (on Projects tab) |
47
- | `Esc/b` | Back from project |
60
+ | `Enter` | Open task detail / Open project |
61
+ | `Esc/b` | Back |
62
+ | `/` | Search tasks |
63
+ | `r` | Refresh |
64
+ | `?` | Help |
65
+ | `q` | Quit |
66
+
67
+ #### Project Detail View
68
+
69
+ | Key | Action |
70
+ |-----|--------|
71
+ | `j/k` | Navigate tasks |
72
+ | `a` | Add task to project |
73
+ | `d` | Mark task as done |
74
+ | `Enter` | Open task detail |
75
+ | `Esc/b` | Back to projects list |
76
+
77
+ #### Task Detail View
78
+
79
+ | Key | Action |
80
+ |-----|--------|
81
+ | `i` | Add comment |
82
+ | `d` | Delete selected comment |
83
+ | `P` | Link to project |
84
+ | `j/k` | Navigate comments |
85
+ | `Esc/b` | Back to list / project |
86
+
87
+ ### Keyboard Shortcuts (Kanban Mode)
88
+
89
+ | Key | Action |
90
+ |-----|--------|
91
+ | `1-3` | Switch columns (TODO/Doing/Done) |
92
+ | `h/l` or `←/→` | Previous/Next column |
93
+ | `j/k` or `↑/↓` | Navigate tasks |
94
+ | `a` | Add task |
95
+ | `d` | Mark as done |
96
+ | `m` | Move task right (→) |
97
+ | `Backspace` | Move task left (←) |
98
+ | `Enter` | Open task detail |
99
+ | `/` | Search tasks |
48
100
  | `r` | Refresh |
49
101
  | `?` | Help |
50
102
  | `q` | Quit |
51
103
 
104
+ #### Task Detail View (Kanban)
105
+
106
+ | Key | Action |
107
+ |-----|--------|
108
+ | `i` | Add comment |
109
+ | `d` | Delete selected comment |
110
+ | `j/k` | Navigate comments |
111
+ | `Esc/b` | Back to board |
112
+
113
+ ### Setup Wizard
114
+
115
+ On first run, Floq will launch an interactive setup wizard to configure:
116
+ - Language (English/Japanese)
117
+ - Theme selection
118
+ - View mode (GTD/Kanban)
119
+
120
+ You can also run the wizard manually:
121
+
122
+ ```bash
123
+ floq setup
124
+ ```
125
+
52
126
  ### CLI Commands
53
127
 
54
128
  ```bash
@@ -77,6 +151,10 @@ floq project add "Project name"
77
151
  floq project list
78
152
  floq project show <id>
79
153
  floq project complete <id>
154
+
155
+ # Comments
156
+ floq comment <id> "Comment text" # Add comment
157
+ floq comment <id> # List comments
80
158
  ```
81
159
 
82
160
  ## Configuration
@@ -89,44 +167,94 @@ floq config show
89
167
  floq config lang en # English
90
168
  floq config lang ja # Japanese
91
169
 
92
- # Set theme
170
+ # Set theme (interactive selector with j/k navigation)
171
+ floq config theme
172
+
173
+ # Or specify directly
93
174
  floq config theme modern # Default
94
- floq config theme norton-commander # MS-DOS style
95
- floq config theme dos-prompt # Green on black
96
- floq config theme turbo-pascal # IDE style
175
+ floq config theme synthwave # Neon 80s aesthetic
176
+
177
+ # Set view mode (interactive selector)
178
+ floq config mode
179
+
180
+ # Or specify directly
181
+ floq config mode gtd # GTD workflow (default)
182
+ floq config mode kanban # Kanban board
97
183
 
98
184
  # Set database path
99
185
  floq config db /path/to/custom.db
100
186
  floq config db # Reset to default
187
+
188
+ # Reset database (delete all data)
189
+ floq db reset # With confirmation
190
+ floq db reset --force # Skip confirmation
101
191
  ```
102
192
 
103
- ## Themes
193
+ ## Cloud Sync (Turso)
104
194
 
105
- ### modern (default)
106
- Clean, minimal style with single borders.
195
+ Floq supports cloud synchronization using [Turso](https://turso.tech/), a SQLite-compatible database service. With embedded replicas, your data syncs to the cloud while remaining available offline.
107
196
 
108
- ### norton-commander
109
- - Double-line borders (╔═╗║╚═╝)
110
- - Uppercase headers
111
- - Function key bar at bottom
112
- - Cyan/yellow color scheme
197
+ ### Setup
113
198
 
114
- ### dos-prompt
115
- - Single-line borders
116
- - Green text (CRT monitor style)
117
- - Simple `>` selection indicator
199
+ 1. Create a Turso database at [turso.tech](https://turso.tech/)
200
+ 2. Get your database URL and auth token
201
+ 3. Configure Floq:
118
202
 
119
- ### turbo-pascal
120
- - Double-line borders
121
- - Yellow accents
122
- - IDE-style appearance
203
+ ```bash
204
+ # Enable Turso sync
205
+ floq config turso --url libsql://your-db.turso.io --token your-auth-token
206
+
207
+ # Check configuration
208
+ floq config show
209
+
210
+ # Manual sync
211
+ floq sync
212
+
213
+ # Disable Turso sync
214
+ floq config turso --disable
215
+ ```
216
+
217
+ ### How It Works
218
+
219
+ - **Embedded Replicas**: Local SQLite database syncs with Turso cloud
220
+ - **Offline Support**: Works offline, syncs when connected
221
+ - **Auto Sync**: Background sync every 60 seconds when online
222
+ - **Separate Database**: Turso mode uses `floq-turso.db` to avoid conflicts
223
+
224
+ ### Status Indicator
225
+
226
+ - TUI header shows connection status (cloud icon for Turso, local icon for local mode)
227
+ - CLI commands display `🔄 Turso sync: hostname` when Turso is enabled
228
+
229
+ ## Themes
123
230
 
124
- > **Note**: Background colors depend on your terminal settings. For the full DOS experience, configure your terminal's background color to blue (#0000AA).
231
+ 16 themes available. Use `floq config theme` for interactive selection (j/k to navigate).
232
+
233
+ | Theme | Description |
234
+ |-------|-------------|
235
+ | `modern` | Clean, minimal style (default) |
236
+ | `norton-commander` | MS-DOS file manager style |
237
+ | `dos-prompt` | Green CRT monitor |
238
+ | `turbo-pascal` | Borland IDE style |
239
+ | `classic-mac` | Macintosh System 7 monochrome |
240
+ | `apple-ii` | Apple ][ green phosphor |
241
+ | `commodore-64` | C64 blue/purple palette |
242
+ | `amiga-workbench` | Amiga orange & blue |
243
+ | `matrix` | Digital rain green |
244
+ | `amber-crt` | Amber monitor |
245
+ | `phosphor` | CRT phosphor glow |
246
+ | `solarized-dark` | Solarized dark palette |
247
+ | `solarized-light` | Solarized light palette |
248
+ | `synthwave` | Neon 80s aesthetic |
249
+ | `paper` | Light minimal theme |
250
+ | `coffee` | Warm brown tones |
251
+
252
+ > **Note**: Background colors depend on your terminal settings.
125
253
 
126
254
  ## Data Storage
127
255
 
128
- - Config: `~/.config/gtd-cli/config.json`
129
- - Database: `~/.local/share/gtd-cli/gtd.db`
256
+ - Config: `~/.config/floq/config.json`
257
+ - Database: `~/.local/share/floq/floq.db` (or `floq-turso.db` with Turso enabled)
130
258
 
131
259
  ## License
132
260
 
@@ -0,0 +1,13 @@
1
+ export interface ChangelogEntry {
2
+ version: string;
3
+ date: string;
4
+ sections: {
5
+ type: 'Added' | 'Changed' | 'Deprecated' | 'Removed' | 'Fixed' | 'Security';
6
+ items: string[];
7
+ }[];
8
+ }
9
+ export interface Changelog {
10
+ entries: ChangelogEntry[];
11
+ }
12
+ export declare function parseChangelog(): Changelog;
13
+ export declare function getLatestVersion(): string;
@@ -0,0 +1,95 @@
1
+ import { readFileSync } from 'fs';
2
+ import { fileURLToPath } from 'url';
3
+ import { dirname, join } from 'path';
4
+ function findChangelogPath() {
5
+ // Get the directory of the current module
6
+ const currentFile = fileURLToPath(import.meta.url);
7
+ const currentDir = dirname(currentFile);
8
+ // Try to find CHANGELOG.md relative to the package root
9
+ // From dist/ or src/, go up one level
10
+ const possiblePaths = [
11
+ join(currentDir, '..', 'CHANGELOG.md'),
12
+ join(currentDir, '..', '..', 'CHANGELOG.md'),
13
+ join(process.cwd(), 'CHANGELOG.md'),
14
+ ];
15
+ for (const path of possiblePaths) {
16
+ try {
17
+ readFileSync(path, 'utf-8');
18
+ return path;
19
+ }
20
+ catch {
21
+ // continue to next path
22
+ }
23
+ }
24
+ return possiblePaths[0]; // Return first path as fallback
25
+ }
26
+ export function parseChangelog() {
27
+ const changelogPath = findChangelogPath();
28
+ let content;
29
+ try {
30
+ content = readFileSync(changelogPath, 'utf-8');
31
+ }
32
+ catch {
33
+ return { entries: [] };
34
+ }
35
+ const entries = [];
36
+ const lines = content.split('\n');
37
+ let currentEntry = null;
38
+ let currentSection = null;
39
+ for (const line of lines) {
40
+ // Match version header: ## [0.1.0] - 2025-01-29 or ## [Unreleased]
41
+ const versionMatch = line.match(/^## \[([^\]]+)\](?:\s*-\s*(.+))?$/);
42
+ if (versionMatch) {
43
+ if (currentEntry) {
44
+ if (currentSection && currentSection.items.length > 0) {
45
+ currentEntry.sections.push(currentSection);
46
+ }
47
+ if (currentEntry.sections.length > 0 || currentEntry.version !== 'Unreleased') {
48
+ entries.push(currentEntry);
49
+ }
50
+ }
51
+ currentEntry = {
52
+ version: versionMatch[1],
53
+ date: versionMatch[2]?.trim() || '',
54
+ sections: [],
55
+ };
56
+ currentSection = null;
57
+ continue;
58
+ }
59
+ // Match section header: ### Added, ### Changed, etc.
60
+ const sectionMatch = line.match(/^### (Added|Changed|Deprecated|Removed|Fixed|Security)$/);
61
+ if (sectionMatch && currentEntry) {
62
+ if (currentSection && currentSection.items.length > 0) {
63
+ currentEntry.sections.push(currentSection);
64
+ }
65
+ currentSection = {
66
+ type: sectionMatch[1],
67
+ items: [],
68
+ };
69
+ continue;
70
+ }
71
+ // Match list item: - Item description
72
+ const itemMatch = line.match(/^- (.+)$/);
73
+ if (itemMatch && currentSection) {
74
+ currentSection.items.push(itemMatch[1]);
75
+ }
76
+ }
77
+ // Add last entry
78
+ if (currentEntry) {
79
+ if (currentSection && currentSection.items.length > 0) {
80
+ currentEntry.sections.push(currentSection);
81
+ }
82
+ if (currentEntry.sections.length > 0) {
83
+ entries.push(currentEntry);
84
+ }
85
+ }
86
+ // Filter out Unreleased if it has no content
87
+ return {
88
+ entries: entries.filter(e => e.version !== 'Unreleased' || e.sections.length > 0),
89
+ };
90
+ }
91
+ export function getLatestVersion() {
92
+ const changelog = parseChangelog();
93
+ const released = changelog.entries.find(e => e.version !== 'Unreleased');
94
+ return released?.version || '0.0.0';
95
+ }
package/dist/cli.js CHANGED
@@ -7,7 +7,9 @@ import { listTasks, listProjects } from './commands/list.js';
7
7
  import { moveTask } from './commands/move.js';
8
8
  import { markDone } from './commands/done.js';
9
9
  import { addProject, listProjectsCommand, showProject, completeProject, } from './commands/project.js';
10
- import { showConfig, setLanguage, setDbPath, resetDbPath, setTheme, selectTheme } from './commands/config.js';
10
+ import { showConfig, setLanguage, setDbPath, resetDbPath, setTheme, selectTheme, setViewModeCommand, selectMode, setTurso, disableTurso, syncCommand, resetDatabase } from './commands/config.js';
11
+ import { addComment, listComments } from './commands/comment.js';
12
+ import { runSetupWizard } from './commands/setup.js';
11
13
  import { VERSION } from './version.js';
12
14
  const program = new Command();
13
15
  program
@@ -121,4 +123,71 @@ configCmd
121
123
  await selectTheme();
122
124
  }
123
125
  });
126
+ configCmd
127
+ .command('mode [mode]')
128
+ .description('Set view mode (gtd, kanban) or select interactively')
129
+ .action(async (mode) => {
130
+ if (mode) {
131
+ await setViewModeCommand(mode);
132
+ }
133
+ else {
134
+ await selectMode();
135
+ }
136
+ });
137
+ configCmd
138
+ .command('turso')
139
+ .description('Configure Turso cloud sync')
140
+ .option('--url <url>', 'Turso database URL (libsql://xxx.turso.io)')
141
+ .option('--token <token>', 'Turso auth token')
142
+ .option('--disable', 'Disable Turso sync')
143
+ .action(async (options) => {
144
+ if (options.disable) {
145
+ await disableTurso();
146
+ }
147
+ else if (options.url && options.token) {
148
+ await setTurso(options.url, options.token);
149
+ }
150
+ else {
151
+ console.error('Usage: floq config turso --url <url> --token <token>');
152
+ console.error(' floq config turso --disable');
153
+ process.exit(1);
154
+ }
155
+ });
156
+ // Sync command
157
+ program
158
+ .command('sync')
159
+ .description('Sync with Turso cloud')
160
+ .action(async () => {
161
+ await syncCommand();
162
+ });
163
+ // Database commands
164
+ const dbCmd = program
165
+ .command('db')
166
+ .description('Database management commands');
167
+ dbCmd
168
+ .command('reset')
169
+ .description('Reset the database (delete all data)')
170
+ .option('-f, --force', 'Skip confirmation')
171
+ .action(async (options) => {
172
+ await resetDatabase(options.force ?? false);
173
+ });
174
+ // Comment command
175
+ program
176
+ .command('comment <taskId> [content]')
177
+ .description('Add or list comments for a task')
178
+ .action(async (taskId, content) => {
179
+ if (content) {
180
+ await addComment(taskId, content);
181
+ }
182
+ else {
183
+ await listComments(taskId);
184
+ }
185
+ });
186
+ // Setup wizard command
187
+ program
188
+ .command('setup')
189
+ .description('Run the setup wizard')
190
+ .action(async () => {
191
+ await runSetupWizard();
192
+ });
124
193
  export { program };