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