donebear 0.3.1 → 0.3.3

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 CHANGED
@@ -1,225 +1,188 @@
1
1
  # donebear
2
2
 
3
- Done Bear CLI for OAuth auth, workspace management, and task workflows against `manage-api`.
3
+ Command-line interface for Done Bear.
4
4
 
5
5
  ## Quick start
6
6
 
7
- 1. Install workspace dependencies from repo root:
7
+ Install and build from the repo root:
8
8
 
9
9
  ```bash
10
10
  npm install
11
- ```
12
-
13
- 2. Build the CLI package:
14
-
15
- ```bash
16
11
  npm run build --workspace=apps/cli
17
12
  ```
18
13
 
19
- 3. Set required environment variables:
14
+ Run the CLI:
20
15
 
21
16
  ```bash
22
- export DONEBEAR_SUPABASE_URL="https://<project-ref>.supabase.co"
23
- export DONEBEAR_SUPABASE_PUBLISHABLE_KEY="<publishable-or-anon-key>"
24
- export DONEBEAR_API_URL="http://127.0.0.1:3001"
17
+ npx donebear --help
25
18
  ```
26
19
 
27
- 4. Define a local runner command:
20
+ Log in and start using it:
28
21
 
29
22
  ```bash
30
- CLI="npm exec --workspace=apps/cli donebear --"
23
+ npx donebear auth login
24
+ npx donebear workspace list
25
+ npx donebear workspace use <workspace-id-or-slug>
26
+ npx donebear task add "Ship donebear CLI" --when today
27
+ npx donebear task list
31
28
  ```
32
29
 
33
- 5. Authenticate and run the core task flow:
30
+ No environment variables are needed — the CLI connects to production by default.
34
31
 
35
- ```bash
36
- $CLI auth login
37
- $CLI workspace list
38
- $CLI workspace use <workspace-id-or-slug>
39
- $CLI task add "Ship donebear CLI" --when today
40
- $CLI task list --state open
41
- ```
32
+ ## Authentication
42
33
 
43
- ## OAuth setup
34
+ Log in via browser OAuth:
44
35
 
45
- The default callback URL is:
46
-
47
- ```text
48
- http://127.0.0.1:8787/auth/callback
36
+ ```bash
37
+ npx donebear auth login
38
+ npx donebear auth login --provider google
39
+ npx donebear auth login --provider github
49
40
  ```
50
41
 
51
- Add that URL to Supabase Auth allowed redirect URLs.
52
-
53
- Login options:
42
+ Check or clear your session:
54
43
 
55
44
  ```bash
56
- $CLI auth login --provider google
57
- $CLI auth login --provider github --port 8787 --timeout 180
58
- $CLI auth login --no-open
45
+ npx donebear auth status
46
+ npx donebear whoami
47
+ npx donebear auth logout
59
48
  ```
60
49
 
61
- Check and clear auth:
50
+ For CI or scripts, use an API key instead:
62
51
 
63
52
  ```bash
64
- $CLI auth status
65
- $CLI whoami
66
- $CLI auth logout
53
+ npx donebear api-key create "CI"
54
+ export DONEBEAR_TOKEN=<key>
55
+ npx donebear task list --json
67
56
  ```
68
57
 
69
- ## Core task flows
58
+ Token precedence: `--token` flag > `DONEBEAR_TOKEN` env var > stored session.
70
59
 
71
- Capture:
60
+ ## Tasks
61
+
62
+ Add tasks:
72
63
 
73
64
  ```bash
74
- $CLI task add "Draft release notes" --when inbox
75
- $CLI task add "Pay invoice" --when today --deadline 2026-03-05
76
- $CLI task add "Write tests" --project PROJ --team ENG
65
+ npx donebear task add "Draft release notes" --when inbox
66
+ npx donebear task add "Pay invoice" --when today --deadline 2026-03-05
67
+ npx donebear task add "Write tests" --project PROJ --team ENG
77
68
  ```
78
69
 
79
- Review:
70
+ List and search:
80
71
 
81
72
  ```bash
82
- $CLI task list --state open --limit 50
83
- $CLI task list --state all --search invoice
84
- $CLI task show <task-id-or-prefix>
85
- $CLI task read <id>
86
- $CLI today
87
- $CLI search "invoice"
73
+ npx donebear task list
74
+ npx donebear task list --state all --search invoice
75
+ npx donebear task show <id>
76
+ npx donebear today
77
+ npx donebear search "invoice"
88
78
  ```
89
79
 
90
- Triage/edit:
80
+ Edit:
91
81
 
92
82
  ```bash
93
- $CLI task edit <id> --title "Pay vendor invoice"
94
- $CLI task edit <id> --notes "Waiting for approval" --when upcoming
95
- $CLI task edit <id> --clear-deadline
96
- $CLI task append <id> "Added follow-up note"
97
- $CLI task prepend <id> "Priority note"
83
+ npx donebear task edit <id> --title "Pay vendor invoice"
84
+ npx donebear task edit <id> --notes "Waiting for approval" --when upcoming
85
+ npx donebear task edit <id> --clear-deadline
86
+ npx donebear task append <id> "Added follow-up note"
98
87
  ```
99
88
 
100
- Complete and clean up:
89
+ Complete and manage:
101
90
 
102
91
  ```bash
103
- $CLI task done <id>
104
- $CLI task reopen <id>
105
- $CLI task archive <id>
106
- $CLI task unarchive <id>
92
+ npx donebear task done <id>
93
+ npx donebear task reopen <id>
94
+ npx donebear task archive <id>
107
95
  ```
108
96
 
109
97
  Checklists:
110
98
 
111
99
  ```bash
112
- $CLI task checklist <id>
113
- $CLI task checklist <id> add "Subtask title"
114
- $CLI task checklist <id> done <item-id>
115
- $CLI task checklist <id> remove <item-id>
100
+ npx donebear task checklist <id>
101
+ npx donebear task checklist <id> add "Subtask title"
102
+ npx donebear task checklist <id> done <item-id>
103
+ npx donebear task checklist <id> remove <item-id>
116
104
  ```
117
105
 
118
- Projects:
106
+ Task IDs can be a full UUID or a unique prefix (4+ characters).
119
107
 
120
- ```bash
121
- $CLI project list
122
- $CLI project add "Q1 Launch" --key LAUNCH --target-date 2026-06-30
123
- $CLI project edit LAUNCH --target-date 2026-03-31
124
- $CLI project done LAUNCH
125
- $CLI project archive LAUNCH
126
- ```
127
-
128
- Workspace:
108
+ ## Projects
129
109
 
130
110
  ```bash
131
- $CLI workspace create "Personal" --slug personal --no-use
132
- $CLI workspace join <invite-code>
133
- $CLI workspace members <workspace-id>
134
- $CLI workspace invitations <workspace-id>
135
- $CLI workspace invite <workspace-id> --email user@example.com
136
- $CLI workspace clear
111
+ npx donebear project list
112
+ npx donebear project add "Q1 Launch" --key LAUNCH --target-date 2026-06-30
113
+ npx donebear project edit LAUNCH --target-date 2026-03-31
114
+ npx donebear project done LAUNCH
115
+ npx donebear project archive LAUNCH
137
116
  ```
138
117
 
139
- Notes:
140
-
141
- - `task show|done|reopen|archive|unarchive|edit` accept a full task ID or unique ID prefix (>= 4 chars).
142
- - `project show|edit|done|archive|unarchive` accept a full ID, project key, or name.
143
- - Prefix resolution uses your selected workspace, or `--workspace` if provided.
144
- - `task list` paginates through GraphQL results, so it is not capped at 100 tasks.
145
- - `donebear auth`, `donebear workspace`, and `donebear task` run sensible defaults (status, list workspaces, list open tasks).
118
+ Projects accept a full ID, project key, or name.
146
119
 
147
- ## Command reference
148
-
149
- Global options:
150
-
151
- - `--json` machine-readable output
152
- - `--format <format>` output format: text | json | csv | tsv
153
- - `--copy` copy output to clipboard
154
- - `--total` print count only
155
- - `--token <token>` explicit bearer token
156
- - `--api-url <url>` manage-api base URL
157
- - `--debug` include stack traces in failures
158
- - `--no-color` disable ANSI color
159
-
160
- Root commands:
161
-
162
- - `auth` (default: status) + login/status/logout
163
- - `workspace` (default: list) + list/current/use/clear/create/join/members/invitations/invite
164
- - `task` (default: list open) + list/show/add/edit/done/reopen/archive/unarchive/read/append/prepend/random/checklist
165
- - `project` (default: list) + list/show/add/edit/done/archive/unarchive
166
- - `label` (default: list) + list/show
167
- - `team` (default: list) + list/show
168
- - `today` list today's tasks
169
- - `search <query>` search tasks by title or notes
170
- - `history` workspace audit log
171
- - `context` workspace state snapshot (--markdown for system prompts)
172
- - `spec` progressive CLI spec for agent discovery (no auth required)
173
- - `api-key` + create/list/revoke
174
- - `import things` import from Things 3 (--dry-run supported)
175
- - `whoami` print current authenticated user (`me` alias)
176
-
177
- Run `donebear <command> --help` for aliases and short flags.
178
-
179
- ## JSON and automation
180
-
181
- Example: pick current workspace id:
120
+ ## Workspaces
182
121
 
183
122
  ```bash
184
- $CLI workspace current --json | jq -r '.workspace.id'
123
+ npx donebear workspace list
124
+ npx donebear workspace use <id-or-slug>
125
+ npx donebear workspace create "Personal" --slug personal
126
+ npx donebear workspace join <invite-code>
127
+ npx donebear workspace members <workspace-id>
128
+ npx donebear workspace invite <workspace-id> --email user@example.com
185
129
  ```
186
130
 
187
- Example: list open task titles:
131
+ ## Output formats
188
132
 
189
133
  ```bash
190
- $CLI task list --state open --json | jq -r '.tasks[].title'
134
+ npx donebear task list --json
135
+ npx donebear task list --format csv > tasks.csv
136
+ npx donebear task list --copy # copy to clipboard
137
+ npx donebear task list --total # count only
191
138
  ```
192
139
 
193
- Example: export tasks as CSV:
140
+ ## Global options
194
141
 
195
- ```bash
196
- $CLI task list --format csv > tasks.csv
197
- ```
142
+ | Flag | Description |
143
+ | ----------------- | ------------------------ |
144
+ | `--json` | Machine-readable output |
145
+ | `--format <fmt>` | text, json, csv, or tsv |
146
+ | `--copy` | Copy output to clipboard |
147
+ | `--total` | Print count only |
148
+ | `--token <tok>` | Explicit bearer token |
149
+ | `--api-url <url>` | API base URL override |
150
+ | `--debug` | Include stack traces |
151
+ | `--no-color` | Disable ANSI color |
198
152
 
199
- Non-interactive auth with API key or token:
153
+ ## Commands
200
154
 
201
- ```bash
202
- $CLI api-key create "CI" # creates a long-lived API key
203
- export DONEBEAR_TOKEN=<key>
204
- $CLI task list --json
205
- ```
206
-
207
- Auth token precedence:
155
+ | Command | Default action | Subcommands |
156
+ | --------------- | -------------- | ------------------------------------------------------------------------------------------------- |
157
+ | `auth` | status | login, status, logout |
158
+ | `workspace` | list | list, current, use, clear, create, join, members, invitations, invite |
159
+ | `task` | list open | list, show, add, edit, done, reopen, archive, unarchive, read, append, prepend, random, checklist |
160
+ | `project` | list | list, show, add, edit, done, archive, unarchive |
161
+ | `label` | list | list, show |
162
+ | `team` | list | list, show |
163
+ | `today` | — | List today's tasks |
164
+ | `search` | — | Search tasks by title or notes |
165
+ | `history` | — | Workspace audit log |
166
+ | `context` | — | Workspace state snapshot (--markdown for prompts) |
167
+ | `spec` | — | CLI spec for agent discovery (no auth required) |
168
+ | `api-key` | — | create, list, revoke |
169
+ | `import things` | — | Import from Things 3 (--dry-run supported) |
170
+ | `whoami` | — | Print current user |
208
171
 
209
- 1. `--token <token>`
210
- 2. `DONEBEAR_TOKEN`
211
- 3. stored session (`auth login`)
172
+ Run `npx donebear <command> --help` for full details.
212
173
 
213
174
  ## Environment variables
214
175
 
215
- | Variable | Purpose | Default / fallback |
216
- | ----------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------- |
217
- | `DONEBEAR_SUPABASE_URL` | Supabase project URL for OAuth | fallback: `NEXT_PUBLIC_SUPABASE_URL`, `SUPABASE_URL` |
218
- | `DONEBEAR_SUPABASE_PUBLISHABLE_KEY` | Supabase publishable/anon key | fallback: `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY`, `SUPABASE_ANON_KEY` |
219
- | `DONEBEAR_API_URL` | manage-api base URL | fallback: `NEXT_PUBLIC_RESERVE_MANAGE_API`, default `http://127.0.0.1:3001` |
220
- | `DONEBEAR_TOKEN` | non-interactive bearer token | none |
221
- | `DONEBEAR_CONFIG_DIR` | override local config/cache directory | OS config dir + `/donebear` |
222
- | `DONEBEAR_DEBUG` | enable debug logging (`1`) | disabled |
176
+ These are optional the CLI works out of the box for production use.
177
+
178
+ | Variable | Purpose | Default |
179
+ | ----------------------------------- | ------------------------------ | -------------------------- |
180
+ | `DONEBEAR_TOKEN` | Non-interactive bearer token | none |
181
+ | `DONEBEAR_API_URL` | API base URL override | `https://api.donebear.com` |
182
+ | `DONEBEAR_SUPABASE_URL` | Supabase project URL for OAuth | production instance |
183
+ | `DONEBEAR_SUPABASE_PUBLISHABLE_KEY` | Supabase publishable key | production key |
184
+ | `DONEBEAR_CONFIG_DIR` | Config/cache directory | `~/.config/donebear` |
185
+ | `DONEBEAR_DEBUG` | Enable debug logging (`1`) | disabled |
223
186
 
224
187
  ## Exit codes
225
188
 
@@ -232,12 +195,12 @@ Auth token precedence:
232
195
 
233
196
  ## Troubleshooting
234
197
 
235
- | Symptom | Cause | Fix |
236
- | --------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------- |
237
- | `Not authenticated. Run donebear auth login.` | Missing or expired token | Run `$CLI auth login`, or pass `--token` |
238
- | OAuth times out waiting for callback | Callback URL/port mismatch or blocked browser redirect | Verify Supabase redirect URL and retry with `--port` or `--no-open` |
239
- | `No default workspace selected.` | Multiple workspaces and none selected | Run `$CLI workspace use <id-or-slug>` |
240
- | `Task prefix "..." is ambiguous` | Prefix matches multiple tasks | Use full task ID from `task list` |
198
+ | Symptom | Fix |
199
+ | -------------------------------- | ------------------------------------------------- |
200
+ | `Not authenticated` | Run `npx donebear auth login` or pass `--token` |
201
+ | OAuth times out | Check browser, retry with `--port` or `--no-open` |
202
+ | `No default workspace selected` | Run `npx donebear workspace use <id-or-slug>` |
203
+ | `Task prefix "..." is ambiguous` | Use the full task ID from `task list` |
241
204
 
242
205
  ## Development
243
206