@nijaru/tk 0.0.4 → 0.1.1
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/bin/tk.js +30 -0
- package/package.json +22 -45
- package/LICENSE +0 -21
- package/README.md +0 -242
- package/src/cli.test.ts +0 -976
- package/src/cli.ts +0 -695
- package/src/db/storage.ts +0 -1014
- package/src/lib/completions.ts +0 -425
- package/src/lib/format.test.ts +0 -361
- package/src/lib/format.ts +0 -188
- package/src/lib/help.ts +0 -249
- package/src/lib/priority.test.ts +0 -105
- package/src/lib/priority.ts +0 -40
- package/src/lib/root.ts +0 -79
- package/src/lib/time.ts +0 -115
- package/src/types.ts +0 -130
package/bin/tk.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
const { spawnSync } = require('child_process')
|
|
5
|
+
|
|
6
|
+
const BINS = {
|
|
7
|
+
'darwin-arm64': '@nijaru/tk-darwin-arm64/bin/tk',
|
|
8
|
+
'darwin-x64': '@nijaru/tk-darwin-x64/bin/tk',
|
|
9
|
+
'linux-arm64': '@nijaru/tk-linux-arm64/bin/tk',
|
|
10
|
+
'linux-x64': '@nijaru/tk-linux-x64/bin/tk',
|
|
11
|
+
'win32-x64': '@nijaru/tk-win32-x64/bin/tk.exe',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const key = `${process.platform}-${process.arch}`
|
|
15
|
+
const bin = BINS[key]
|
|
16
|
+
|
|
17
|
+
if (!bin) {
|
|
18
|
+
process.stderr.write(`tk: unsupported platform ${key}\n`)
|
|
19
|
+
process.exit(1)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let resolved
|
|
23
|
+
try {
|
|
24
|
+
resolved = require.resolve(bin)
|
|
25
|
+
} catch {
|
|
26
|
+
process.stderr.write(`tk: binary not found — try reinstalling: npm install -g @nijaru/tk\n`)
|
|
27
|
+
process.exit(1)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
process.exit(spawnSync(resolved, process.argv.slice(2), { stdio: 'inherit' }).status ?? 1)
|
package/package.json
CHANGED
|
@@ -1,47 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@types/bun": "^1.3.5"
|
|
26
|
-
},
|
|
27
|
-
"peerDependencies": {
|
|
28
|
-
"typescript": "^5"
|
|
29
|
-
},
|
|
30
|
-
"keywords": [
|
|
31
|
-
"task",
|
|
32
|
-
"todo",
|
|
33
|
-
"cli",
|
|
34
|
-
"agent",
|
|
35
|
-
"bun"
|
|
36
|
-
],
|
|
37
|
-
"license": "MIT",
|
|
38
|
-
"repository": {
|
|
39
|
-
"type": "git",
|
|
40
|
-
"url": "git+https://github.com/nijaru/tk.git"
|
|
41
|
-
},
|
|
42
|
-
"author": "nijaru",
|
|
43
|
-
"homepage": "https://github.com/nijaru/tk#readme",
|
|
44
|
-
"bugs": {
|
|
45
|
-
"url": "https://github.com/nijaru/tk/issues"
|
|
46
|
-
}
|
|
2
|
+
"name": "@nijaru/tk",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Minimal task tracker CLI",
|
|
5
|
+
"homepage": "https://github.com/nijaru/tk",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/nijaru/tk.git"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"bin": {
|
|
12
|
+
"tk": "bin/tk.js"
|
|
13
|
+
},
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=14"
|
|
16
|
+
},
|
|
17
|
+
"optionalDependencies": {
|
|
18
|
+
"@nijaru/tk-darwin-arm64": "0.1.1",
|
|
19
|
+
"@nijaru/tk-darwin-x64": "0.1.1",
|
|
20
|
+
"@nijaru/tk-linux-arm64": "0.1.1",
|
|
21
|
+
"@nijaru/tk-linux-x64": "0.1.1",
|
|
22
|
+
"@nijaru/tk-win32-x64": "0.1.1"
|
|
23
|
+
}
|
|
47
24
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 nijaru
|
|
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
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
# tk
|
|
2
|
-
|
|
3
|
-
Minimal task tracker. Simple, fast, git-friendly.
|
|
4
|
-
|
|
5
|
-
- Plain JSON files in `.tasks/`
|
|
6
|
-
- No daemons, no merge conflicts, no viruses
|
|
7
|
-
|
|
8
|
-
## Install
|
|
9
|
-
|
|
10
|
-
Requires [Bun](https://bun.sh) runtime.
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
# Install Bun first (if not installed)
|
|
14
|
-
curl -fsSL https://bun.sh/install | bash
|
|
15
|
-
|
|
16
|
-
# Then install tk globally
|
|
17
|
-
bun add -g @nijaru/tk
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Quick Start
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
$ cd myapp
|
|
24
|
-
$ tk init # project auto-derived from directory
|
|
25
|
-
Initialized: .tasks
|
|
26
|
-
|
|
27
|
-
$ tk add "Implement auth" -p 1
|
|
28
|
-
myapp-a7b3
|
|
29
|
-
|
|
30
|
-
$ tk add "Write tests" -p 2
|
|
31
|
-
myapp-x9k2
|
|
32
|
-
|
|
33
|
-
$ tk block x9k2 a7b3 # tests blocked by auth (just use ref)
|
|
34
|
-
|
|
35
|
-
$ tk ready # what can I work on?
|
|
36
|
-
ID | PRIO | STATUS | TITLE
|
|
37
|
-
-----------------------------------------------------------------
|
|
38
|
-
myapp-a7b3 | p1 | open | Implement auth
|
|
39
|
-
|
|
40
|
-
$ tk start a7b3 # just the ref works everywhere
|
|
41
|
-
Started: myapp-a7b3
|
|
42
|
-
|
|
43
|
-
$ tk log a7b3 "Using JWT approach"
|
|
44
|
-
Logged: myapp-a7b3
|
|
45
|
-
|
|
46
|
-
$ tk done a7b3
|
|
47
|
-
Completed: myapp-a7b3
|
|
48
|
-
|
|
49
|
-
$ tk ready # tests now unblocked
|
|
50
|
-
ID | PRIO | STATUS | TITLE
|
|
51
|
-
-----------------------------------------------------------------
|
|
52
|
-
myapp-x9k2 | p2 | open | Write tests
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Commands
|
|
56
|
-
|
|
57
|
-
| Command | Description |
|
|
58
|
-
| --------------------------- | ------------------------------------------ |
|
|
59
|
-
| `tk init` | Initialize (project name from directory) |
|
|
60
|
-
| `tk add <title>` | Create task |
|
|
61
|
-
| `tk ls` / `tk list` | List tasks |
|
|
62
|
-
| `tk ready` | List active/open + unblocked tasks |
|
|
63
|
-
| `tk show <id>` | Show task details |
|
|
64
|
-
| `tk start <id>` | Start working (open → active) |
|
|
65
|
-
| `tk done <id>` | Complete task |
|
|
66
|
-
| `tk reopen <id>` | Reopen task |
|
|
67
|
-
| `tk edit <id>` | Edit task |
|
|
68
|
-
| `tk log <id> "<msg>"` | Add log entry |
|
|
69
|
-
| `tk block <id> <blocker>` | Add dependency (id blocked by blocker) |
|
|
70
|
-
| `tk unblock <id> <blocker>` | Remove dependency |
|
|
71
|
-
| `tk rm` / `tk remove <id>` | Delete task |
|
|
72
|
-
| `tk clean` | Remove old done tasks (default: 14 days) |
|
|
73
|
-
| `tk check` | Check task integrity |
|
|
74
|
-
| `tk config` | Show/set configuration |
|
|
75
|
-
| `tk completions <shell>` | Output shell completions (bash, zsh, fish) |
|
|
76
|
-
| `tk help [command]` | Show help (or command-specific help) |
|
|
77
|
-
|
|
78
|
-
## Add Options
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
tk add "Title" -p 2 # Priority (0-4)
|
|
82
|
-
tk add "Title" -P api # Project prefix
|
|
83
|
-
tk add "Title" -d "Description" # Description
|
|
84
|
-
tk add "Title" -l bug,urgent # Labels (CSV)
|
|
85
|
-
tk add "Title" -A nick,alice # Assignees (CSV, @me for git user)
|
|
86
|
-
tk add "Title" --parent a7b3 # Parent task (ref works)
|
|
87
|
-
tk add "Title" --estimate 3 # Estimate (user-defined units)
|
|
88
|
-
tk add "Title" --due 2026-01-15 # Due date (YYYY-MM-DD)
|
|
89
|
-
tk add "Title" --due +7d # Relative due date (+Nh/+Nd/+Nw/+Nm)
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## List Options
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
tk ls # List tasks (limit 20)
|
|
96
|
-
tk ls -a # Show all (no limit)
|
|
97
|
-
tk ls -s active # Filter by status
|
|
98
|
-
tk ls -p 1 # Filter by priority
|
|
99
|
-
tk ls -P api # Filter by project
|
|
100
|
-
tk ls -l bug # Filter by label
|
|
101
|
-
tk ls --assignee nick # Filter by assignee
|
|
102
|
-
tk ls --parent a7b3 # Filter by parent (ref works)
|
|
103
|
-
tk ls --roots # Top-level tasks only
|
|
104
|
-
tk ls --overdue # Overdue tasks only
|
|
105
|
-
tk ls -n 10 # Limit results
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Edit Options
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
tk edit a7b3 -t "New title" # Update title
|
|
112
|
-
tk edit a7b3 -p 1 # Update priority
|
|
113
|
-
tk edit a7b3 -l +urgent # Add label
|
|
114
|
-
tk edit a7b3 -l -bug # Remove label (use --labels=-bug)
|
|
115
|
-
tk edit a7b3 --due - # Clear due date
|
|
116
|
-
tk edit a7b3 --parent - # Clear parent
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## Clean Options
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
tk clean # Remove done tasks older than config (default: 14 days)
|
|
123
|
-
tk clean --older-than 30 # Custom threshold (days)
|
|
124
|
-
tk clean --force # Force clean even if disabled in config
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Config
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
tk config # Show all config
|
|
131
|
-
tk config project # Show default project
|
|
132
|
-
tk config project api # Set default project
|
|
133
|
-
tk config project lsmvec --rename cloudlsmvec # Rename cloudlsmvec-* → lsmvec-*
|
|
134
|
-
tk config alias # List aliases
|
|
135
|
-
tk config alias web src/web # Add alias
|
|
136
|
-
tk config alias --rm web # Remove alias
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
Config file (`.tasks/config.json`):
|
|
140
|
-
|
|
141
|
-
```json
|
|
142
|
-
{
|
|
143
|
-
"version": 1,
|
|
144
|
-
"project": "myapp",
|
|
145
|
-
"clean_after": 14,
|
|
146
|
-
"defaults": { "priority": 3, "labels": [], "assignees": [] },
|
|
147
|
-
"aliases": {}
|
|
148
|
-
}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
- `clean_after`: Days to keep done tasks (default: 14). Set to `false` to disable cleaning.
|
|
152
|
-
|
|
153
|
-
## Task IDs
|
|
154
|
-
|
|
155
|
-
Format: `project-ref` (e.g., `myapp-a7b3`, `api-x9k2`, `web-3m8p`)
|
|
156
|
-
|
|
157
|
-
- **Just use the ref** - `a7b3` works everywhere, no need to type `myapp-a7b3`
|
|
158
|
-
- Project prefix auto-derived from directory name on init (or use `-P` flag)
|
|
159
|
-
- Random 4-char alphanumeric ref (a-z, 0-9)
|
|
160
|
-
- Prefix matching: `a7` resolves to `myapp-a7b3` if unambiguous
|
|
161
|
-
- Random IDs prevent merge conflicts in team workflows
|
|
162
|
-
|
|
163
|
-
## Priority
|
|
164
|
-
|
|
165
|
-
| Value | Name | Description |
|
|
166
|
-
| ----- | ------ | ---------------- |
|
|
167
|
-
| 0 | none | No priority set |
|
|
168
|
-
| 1 | urgent | Drop everything |
|
|
169
|
-
| 2 | high | Important |
|
|
170
|
-
| 3 | medium | Normal (default) |
|
|
171
|
-
| 4 | low | Nice to have |
|
|
172
|
-
|
|
173
|
-
Accepts: `0-4`, `p0-p4`, or `none/urgent/high/medium/low`
|
|
174
|
-
|
|
175
|
-
## Status Flow
|
|
176
|
-
|
|
177
|
-
```
|
|
178
|
-
open → active → done
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## Storage
|
|
182
|
-
|
|
183
|
-
```
|
|
184
|
-
.tasks/
|
|
185
|
-
config.json # Project config
|
|
186
|
-
tk-a7b3.json # Task files
|
|
187
|
-
api-x9k2.json
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
Each task file:
|
|
191
|
-
|
|
192
|
-
```json
|
|
193
|
-
{
|
|
194
|
-
"project": "tk",
|
|
195
|
-
"ref": "a7b3",
|
|
196
|
-
"title": "Implement auth",
|
|
197
|
-
"description": "Use JWT approach",
|
|
198
|
-
"status": "open",
|
|
199
|
-
"priority": 3,
|
|
200
|
-
"labels": ["bug"],
|
|
201
|
-
"assignees": ["nick"],
|
|
202
|
-
"parent": null,
|
|
203
|
-
"blocked_by": [],
|
|
204
|
-
"estimate": 3,
|
|
205
|
-
"due_date": "2026-01-15",
|
|
206
|
-
"logs": [{ "ts": "2026-01-05T10:00:00Z", "msg": "Started research" }],
|
|
207
|
-
"created_at": "2026-01-05T09:00:00Z",
|
|
208
|
-
"updated_at": "2026-01-05T10:00:00Z",
|
|
209
|
-
"completed_at": null,
|
|
210
|
-
"external": {}
|
|
211
|
-
}
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
## Global Options
|
|
215
|
-
|
|
216
|
-
- `-C <dir>` - Run in different directory (`tk -C ../other-repo ls`)
|
|
217
|
-
- `--json` - Output as JSON (works anywhere: `tk ls --json` or `tk --json ls`)
|
|
218
|
-
- `-h, --help` - Show help (`tk add --help` or `tk help add` for command help)
|
|
219
|
-
- `-V, --version` - Show version
|
|
220
|
-
|
|
221
|
-
## Environment
|
|
222
|
-
|
|
223
|
-
- `NO_COLOR` - Disable colored output (any non-empty value)
|
|
224
|
-
|
|
225
|
-
Colors are also automatically disabled when output is piped.
|
|
226
|
-
|
|
227
|
-
## Shell Completions
|
|
228
|
-
|
|
229
|
-
```bash
|
|
230
|
-
# Bash (add to ~/.bashrc)
|
|
231
|
-
eval "$(tk completions bash)"
|
|
232
|
-
|
|
233
|
-
# Zsh (add to ~/.zshrc)
|
|
234
|
-
eval "$(tk completions zsh)"
|
|
235
|
-
|
|
236
|
-
# Fish (add to ~/.config/fish/config.fish)
|
|
237
|
-
tk completions fish | source
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
## License
|
|
241
|
-
|
|
242
|
-
[MIT](LICENSE)
|