hzl-cli 1.5.1 → 1.6.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 (2) hide show
  1. package/README.md +233 -132
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,164 +1,246 @@
1
- # HZL
1
+ # HZL (Hazel)
2
2
 
3
- **Lightweight task tracking for AI agents and swarms.**
3
+ **A shared task ledger for OpenClaw and poly-agent workflows.**
4
4
 
5
- HZL is a CLI-first task management system designed for solo developers working with multiple AI agents across multiple projects. It provides durable, local coordination without the overhead of team-oriented project management tools.
5
+ OpenClaw is great at doing work: running tools, coordinating sub-agents, and maintaining memory.
6
+ What it (and most agent tools) do not give you is a durable, shared backlog that survives:
6
7
 
7
- ## Why HZL?
8
+ - session boundaries
9
+ - crashes/reboots
10
+ - switching between different agent runtimes (Claude Code, Codex, Gemini, etc.)
8
11
 
9
- Most project management tools assume teams of humans collaborating on shared repositories. When you're a solo developer with AI agents as your primary collaborators, these tools become heavyweight:
12
+ HZL fills that gap: a lightweight, local-first task tracker that any agent can read/write.
10
13
 
11
- - **Repository-level storage is limiting.** You work across many repos and non-code projects. HZL stores tasks at the user level (`~/.hzl/data.db`), giving you one source of truth for all your work.
14
+ Using OpenClaw? Start here: [OpenClaw integration](#openclaw-integration)
12
15
 
13
- - **Agents need machine-readable interfaces.** HZL's CLI is optimized for programmatic use with `--json` output, atomic operations, and deterministic selection policies that agents can rely on.
16
+ Not using OpenClaw? Jump to: [Using HZL with Claude Code, Codex, Gemini CLI, or any coding agent](#using-hzl-with-claude-code-codex-gemini-cli-or-any-coding-agent)
14
17
 
15
- - **Concurrent agents need coordination.** Multiple agents working in parallel can atomically claim tasks, preventing conflicts. No heartbeats required—checkpoints let agents recover each other's work.
18
+ HZL provides:
16
19
 
17
- - **Active work, not archival.** HZL is designed for coordinating current projects, not storing years of task history. Track recent work, see progress stats, then let completed tasks fade.
20
+ - Projects and tasks
21
+ - Dependencies (`B` waits for `A`)
22
+ - Checkpoints (progress snapshots you can resume from)
23
+ - Leases (time-limited claims for multi-agent coordination)
24
+ - Event history (audit trail)
25
+ - A CLI + JSON output that agents can script against
18
26
 
19
- ## Design Principles
27
+ Data is stored in SQLite. Default location: `$XDG_DATA_HOME/hzl/data.db` (fallback `~/.local/share/hzl/data.db`); Windows: `%LOCALAPPDATA%\\hzl\\data.db`.
20
28
 
21
- 1. **Tracker, not orchestrator.** HZL is a dumb ledger. It tracks work state—it doesn't orchestrate, prioritize, or decide what agents should do. Orchestration belongs elsewhere: in your control agents, workflow tools, or the agents themselves. This separation is intentional. HZL stays simple and reliable because it does one thing well.
22
-
23
- 2. **Events are truth.** Every change is an append-only event. Current state is a projection. Full audit trails, reconstructable history.
29
+ ---
24
30
 
25
- 3. **Local-first.** SQLite with WAL mode. No network dependency. Works offline.
31
+ ## Why another task tracker?
26
32
 
27
- 4. **Hierarchical but simple.** Projects contain tasks. Tasks can have subtasks and dependencies. That's it.
33
+ Because most task trackers are built for humans.
28
34
 
29
- ## Non-Goals
35
+ HZL is built for agents:
30
36
 
31
- HZL intentionally does not do these things:
37
+ - It is backend-first, not UI-first. Think "task database with a CLI," not "another Trello."
38
+ - It is model-agnostic. Your tasks live outside any one vendor's memory or chat history.
39
+ - It is multi-agent safe. Leases prevent orphaned work and enable clean handoffs.
40
+ - It is resumable. Checkpoints let an agent crash, reboot, or swap models and keep going.
32
41
 
33
- - **Orchestration.** HZL doesn't spawn agents, manage their lifecycles, assign work, or decide what should happen next. If you need a control agent that spawns sub-agents, that logic lives in your agent—not in HZL.
42
+ If you already have a favorite human todo app, keep it.
43
+ If you need a shared task state that multiple agents can read/write, that is HZL.
34
44
 
35
- - **Task decomposition.** HZL won't break down "build the app" into subtasks. Humans or agents create the task hierarchy; HZL just tracks it.
45
+ ---
36
46
 
37
- - **Smart scheduling.** `hzl next` uses simple, deterministic rules (priority, then FIFO). There's no learning, no load balancing, no routing based on agent capabilities. If you need smarter task selection, your orchestration layer decides and claims by ID.
47
+ ## Where HZL fits
38
48
 
39
- - **Team collaboration.** No permissions, roles, notifications, or multi-user features. HZL assumes a single developer working with their agents.
49
+ ### 1) OpenClaw orchestrator + sub-agents
40
50
 
41
- - **Cloud sync.** Local SQLite by design. If you want sync, export/import or backup to your own storage.
51
+ ```mermaid
52
+ flowchart LR
53
+ You[You] --> OC["OpenClaw (orchestrator)"]
54
+ OC --> Tools["OpenClaw tools<br/>(browser, exec, email, etc.)"]
55
+ OC <--> HZL[(HZL task ledger)]
56
+ OC --> S1[Claude Code]
57
+ OC --> S2[Codex / other]
58
+ S1 <--> HZL
59
+ S2 <--> HZL
60
+ ```
42
61
 
43
- ## Installation
62
+ OpenClaw coordinates the work. HZL is the shared, durable task board that OpenClaw and its sub-agents can use across sessions.
44
63
 
45
- Requires Node.js 22.14+.
64
+ ### 2) Any poly-agent system (no OpenClaw required)
46
65
 
47
- ```bash
48
- npm install -g hzl-cli
66
+ ```mermaid
67
+ flowchart LR
68
+ U[You] --> O["Orchestrator (human or agent)"]
69
+ O <--> HZL[(HZL)]
70
+ O --> C[Claude Code]
71
+ O --> X[Codex]
72
+ O --> G[Gemini]
73
+ C <--> HZL
74
+ X <--> HZL
75
+ G <--> HZL
49
76
  ```
50
77
 
51
- Or from source:
78
+ Same idea: once you are switching tools/models, you need a shared ledger.
52
79
 
53
- ```bash
54
- git clone https://github.com/tmchow/hzl.git
55
- cd hzl
56
- npm install
57
- npm run build
58
- npm link packages/hzl-cli
80
+ ### 3) One agent, many sessions
81
+
82
+ ```mermaid
83
+ flowchart LR
84
+ U[You] --> A[Coding agent]
85
+ A <--> HZL
86
+ A --> R[Repo / files]
59
87
  ```
60
88
 
61
- ## Quick Start
89
+ Use HZL to persist "what's next" and "what changed" between sessions.
62
90
 
63
- ```bash
64
- # Initialize the database
65
- hzl init
91
+ ### 4) HZL as the backend for your own UI
66
92
 
67
- # Create a project
68
- hzl project create myapp
93
+ ```mermaid
94
+ flowchart LR
95
+ UI[Your lightweight web app] --> HZL
96
+ Agents[Agents + scripts] --> HZL
97
+ ```
69
98
 
70
- # Create tasks
71
- hzl task add "Set up authentication" -P myapp --priority 2 --tags backend,auth
72
- hzl task add "Write API tests" -P myapp --depends-on <task-id>
99
+ If you want a human-friendly interface, build one. HZL stays the durable backend that both humans and agents can use.
73
100
 
74
- # List available work
75
- hzl task list --project myapp --available
101
+ ---
76
102
 
77
- # Claim and work
78
- hzl task next --project myapp
79
- hzl task claim <task-id> --author agent-1
80
- hzl task checkpoint <task-id> "Completed OAuth flow"
81
- hzl task complete <task-id>
82
- ```
103
+ ## Quickstart
83
104
 
84
- ## Key Commands
105
+ ### Install
85
106
 
86
- ### Task Lifecycle
107
+ Requires Node.js 22.14+.
87
108
 
88
109
  ```bash
89
- hzl task add <title> -P <project> # Create a task
90
- hzl task list [--project] [--status] # List tasks
91
- hzl task next [--project] # Show next claimable task
92
- hzl task claim <id> # Claim a task
93
- hzl task complete <id> # Mark done
110
+ npm install -g hzl-cli
111
+ hzl init
94
112
  ```
95
113
 
96
- ### For Agents
114
+ ### Create a project and tasks
97
115
 
98
116
  ```bash
99
- # All commands support --json for structured output
100
- hzl task list --project myapp --available --json
101
- hzl task claim <id> --author agent-1 --json
117
+ hzl project create portland-trip
102
118
 
103
- # Checkpoints let agents recover each other's work
104
- hzl task checkpoint <id> "step-3-complete" --data '{"files":["a.ts","b.ts"]}'
105
- hzl task show <id> --json # Get task details + history
119
+ hzl task add "Check calendars for March weekends" -P portland-trip --priority 5
120
+ hzl task add "Research neighborhoods + activities" -P portland-trip --priority 4
121
+ hzl task add "Shortlist 2-3 weekend options" -P portland-trip --priority 3 \
122
+ --depends-on <calendar-task-id> --depends-on <research-task-id>
106
123
  ```
107
124
 
108
- ### Stuck Task Recovery
125
+ ### Work with checkpoints
109
126
 
110
127
  ```bash
111
- hzl task claim <id> --lease 30 # Claim with 30-minute lease
112
- hzl task stuck # Find tasks with expired leases
113
- hzl task steal <id> --if-expired # Reclaim expired work
128
+ hzl task claim <calendar-task-id> --author trevin-agent
129
+ hzl task checkpoint <calendar-task-id> "Found 3 options: Mar 7-9, 14-16, 21-23"
130
+ hzl task complete <calendar-task-id>
114
131
  ```
115
132
 
116
- ### Human Oversight
133
+ ### Use JSON output when scripting
117
134
 
118
135
  ```bash
119
- hzl project list # See all projects
120
- hzl task show <id> # Task details + history
121
- hzl task comment <id> "guidance..." # Add steering comments
136
+ hzl task show <id> --json
137
+ hzl task next --project portland-trip --json
122
138
  ```
123
139
 
124
- ### Dependencies
140
+ ---
125
141
 
126
- ```bash
127
- hzl task add-dep <task> <depends-on> # Task waits for dependency
128
- hzl task remove-dep <task> <dep> # Remove dependency
129
- hzl validate # Check for cycles
130
- ```
142
+ ## Core concepts (the stuff that matters)
143
+
144
+ ### Tasks are units of work, not reminders
145
+
146
+ HZL is optimized for "do work, report progress, unblock the next step."
147
+
148
+ If you need time-based reminders, pair HZL with a scheduler (cron, OpenClaw cron, etc.).
149
+
150
+ ### Checkpoints are progress snapshots
151
+
152
+ A checkpoint is a compact, durable record of what happened:
153
+
154
+ - what you tried
155
+ - what you found
156
+ - what's still missing
157
+ - links, commands, or file paths needed to resume
158
+
159
+ ### Dependencies encode ordering
160
+
161
+ Dependencies are how an agent avoids premature work:
162
+
163
+ - "Don't search flights before you know dates."
164
+ - "Don't open a PR before tests pass."
165
+
166
+ ### Leases make multi-agent handoffs reliable
167
+
168
+ Leases are time-limited claims:
169
+
170
+ - A worker agent claims a task with `--lease 30`
171
+ - If it disappears, the lease expires
172
+ - Another agent can detect stuck work and take over
173
+
174
+ ---
175
+
176
+ ## Patterns
177
+
178
+ ### Pattern: Poly-agent backlog (recommended)
131
179
 
132
- ## Configuration
180
+ Conventions that help:
133
181
 
134
- HZL stores configuration in `~/.hzl/config.json`. The config file is created automatically when you run `hzl init`.
182
+ - Use consistent author IDs: `openclaw`, `claude-code`, `codex`, `gemini`, etc.
183
+ - Claim tasks before work.
184
+ - Checkpoint whenever you learn something that would be painful to rediscover.
135
185
 
136
- To use a custom database location:
186
+ Example handoff:
137
187
 
138
188
  ```bash
139
- hzl init --db ~/my-project/tasks.db
189
+ # Orchestrator creates task
190
+ hzl task add "Implement REST API endpoints" -P myapp --priority 2
191
+ TASK_ID=<id>
192
+
193
+ # Worker agent claims with a lease
194
+ hzl task claim "$TASK_ID" --author claude-code --lease 30
195
+ hzl task checkpoint "$TASK_ID" "Endpoints scaffolded; next: auth middleware"
196
+ hzl task complete "$TASK_ID"
140
197
  ```
141
198
 
142
- Subsequent commands will automatically use this database.
199
+ ### Pattern: Personal todo list (it works, but bring your own UI)
200
+
201
+ HZL can track personal tasks and has the advantage of centralizing agent and personal tasks.
202
+ This enables scenarios like OpenClaw assigning you tasks without needing to sync with other todo systems.
203
+
204
+ HZL itself is not trying to be a polished, human-first todo app. You bring other pieces for that.
143
205
 
144
- **Config resolution order (highest to lowest priority):**
145
- 1. `--db` flag
146
- 2. `HZL_DB` environment variable
147
- 3. `~/.hzl/config.json`
148
- 4. Default: `~/.hzl/data.db`
206
+ If you want a todo app, build or use a UI:
207
+
208
+ - a tiny web app
209
+ - a TUI wrapper
210
+ - a menu bar widget
211
+
212
+ HZL stays the storage layer and concurrency-safe ledger underneath.
213
+
214
+ ---
149
215
 
150
- ## Environment Variables
216
+ ## Using HZL with Claude Code, Codex, Gemini CLI, or any coding agent
151
217
 
152
- | Variable | Description |
153
- |----------|-------------|
154
- | `HZL_DB` | Override database location |
155
- | `HZL_CONFIG` | Override config file location (default: `~/.hzl/config.json`) |
156
- | `HZL_AUTHOR` | Default author for claims/comments |
157
- | `HZL_AGENT_ID` | Default agent identifier |
218
+ If your coding agent supports an instruction file (for example `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, etc.), add a short policy so the agent reaches for HZL consistently.
158
219
 
159
- ## Claude Code Marketplace
220
+ ### Drop-in policy snippet
160
221
 
161
- HZL includes a [Claude Code](https://claude.ai/code) plugin marketplace with skills that help AI agents work effectively with HZL.
222
+ ```md
223
+ ### HZL task ledger (use for multi-step work)
224
+
225
+ When a request has multiple steps, spans multiple sessions, or involves coordination with other agents/tools:
226
+ 1) Create or use an HZL project for the work.
227
+ 2) Break work into tasks with dependencies.
228
+ 3) Claim tasks before work and checkpoint after meaningful progress.
229
+ 4) Use `--json` when producing output another tool will parse.
230
+
231
+ Key commands:
232
+ - `hzl project create <name>`
233
+ - `hzl task add "<title>" -P <project> [--depends-on <id>]`
234
+ - `hzl task claim <id> --author <agent-id> [--lease 30]`
235
+ - `hzl task checkpoint <id> "<progress + next step>"`
236
+ - `hzl task complete <id>`
237
+ ```
238
+
239
+ That snippet is intentionally short. The goal is consistency, not ceremony.
240
+
241
+ ### Claude Code marketplace (optional)
242
+
243
+ HZL includes a Claude Code plugin marketplace with skills that help agents work effectively with HZL.
162
244
 
163
245
  ```bash
164
246
  # Add the marketplace
@@ -170,63 +252,82 @@ HZL includes a [Claude Code](https://claude.ai/code) plugin marketplace with ski
170
252
 
171
253
  See [`packages/hzl-marketplace`](./packages/hzl-marketplace) for details.
172
254
 
173
- ## Related Projects
255
+ ## OpenClaw integration
174
256
 
175
- - [Beads](https://github.com/steveyegge/beads) - Steve Yegge's task management for agents
176
- - [beads-rust](https://github.com/Dicklesworthstone/beads_rust) - Rust port of Beads
257
+ OpenClaw is a self-hosted AI assistant that can coordinate tools and sub-agents.
258
+ HZL fits well as the task ledger that OpenClaw (and its sub-agents) can share.
177
259
 
178
- HZL takes a different approach: user-level storage, CLI-first for agents, and designed for solo developers coordinating multiple agents across projects.
260
+ ### Quick start (recommended)
179
261
 
180
- ## Development
262
+ Copy/paste this into an OpenClaw chat (single prompt):
263
+
264
+ ```
265
+ Install HZL from https://github.com/tmchow/hzl and run hzl init. Install the HZL skill from https://www.clawhub.ai/tmchow/hzl. Then append the HZL policy from https://raw.githubusercontent.com/tmchow/hzl/main/docs/openclaw/tools-prompt.md to my TOOLS.md.
266
+ ```
267
+
268
+ ### Manual setup
269
+
270
+ 1) Install HZL on the machine running OpenClaw:
181
271
 
182
272
  ```bash
183
- npm install
184
- npm run build
185
- npm test
186
- npm run lint
273
+ npm install -g hzl-cli
274
+ hzl init
275
+ ```
276
+
277
+ 2) Install the HZL skill from https://www.clawhub.ai/tmchow/hzl
278
+ Skill source (for reference only): **[`docs/openclaw/skill-hzl.md`](./docs/openclaw/skill-hzl.md)**
279
+
280
+ 3) Teach OpenClaw when to use HZL (important):
281
+ - Copy/paste from: **[`docs/openclaw/tools-prompt.md`](./docs/openclaw/tools-prompt.md)**
282
+ - Or tell OpenClaw to add this policy to `TOOLS.md`:
187
283
 
188
- # Try the sample project
189
- hzl sample-project
284
+ ```
285
+ HZL is a tool available to you for task management in certain cases. I want you to add this information to your TOOLS.md in the right way so you remember how to use it:
286
+ https://raw.githubusercontent.com/tmchow/hzl/main/docs/openclaw/tools-prompt.md
190
287
  ```
191
288
 
192
289
  ---
193
290
 
194
- ## CLAUDE.md / AGENTS.md Snippet
291
+ ## When to use HZL (and when not to)
292
+
293
+ ### Use HZL when:
195
294
 
196
- Copy this into your project's `CLAUDE.md` or `AGENTS.md`:
295
+ - work has multiple steps and you want explicit sequencing
296
+ - work spans multiple sessions (resume tomorrow with confidence)
297
+ - you are coordinating multiple agents or model providers
298
+ - you need durable status reporting (done / in progress / blocked / next)
299
+ - you want a task ledger your own UI can sit on top of
197
300
 
198
- ````markdown
199
- ## Task Management
301
+ ### Consider something else when:
200
302
 
201
- This project uses [HZL](https://github.com/tmchow/hzl) for task tracking.
303
+ - you need time-based reminders or notifications (use a scheduler + a notifier)
304
+ - you need rich human workflow features (due dates, recurring tasks, calendar views)
305
+ - you are tracking an org-wide backlog (GitHub/Jira/etc. may be a better fit)
306
+
307
+ ---
202
308
 
203
- ### Choosing a project name
309
+ ## CLI reference (short)
204
310
 
205
- Use a **stable identifier** you can always derive:
311
+ ```bash
312
+ hzl init
206
313
 
207
- - **Working in a repo?** Use the repository name (e.g., `hzl`, `my-app`)
208
- - **Long-lived agent?** Use your agent identity (e.g., `openclaw`, `kalids-openclaw`)
314
+ hzl project create <name>
315
+ hzl project list
209
316
 
210
- Projects group related work. Don't create per-feature projects—keep them long-lived. If no project is specified, tasks default to `inbox`.
317
+ hzl task add "<title>" -P <project>
318
+ hzl task list --project <project>
319
+ hzl task next --project <project>
211
320
 
212
- ### Commands
321
+ hzl task claim <id> --author <name> [--lease <minutes>]
322
+ hzl task checkpoint <id> "<message>"
323
+ hzl task complete <id>
213
324
 
214
- ```bash
215
- # Projects
216
- hzl project list # List all projects
217
- hzl project rename <old> <new> # Rename a project
325
+ hzl task stuck
326
+ hzl task steal <id> --if-expired
218
327
 
219
- # Tasks
220
- hzl task add "Task title" -P <project> # Create task
221
- hzl task next --project <project> --json # Show next available
222
- hzl task show <task-id> --json # Task details + history
223
- hzl task checkpoint <task-id> "<name>" # Save progress
224
- hzl task complete <task-id> # Mark done
328
+ hzl task show <id> --json
225
329
  ```
226
330
 
227
- Use `--json` for structured output. HZL handles atomic claiming.
228
- ````
229
-
230
331
  ---
231
332
 
232
333
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hzl-cli",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "CLI for HZL - Lightweight task tracking for AI agents and swarms",
5
5
  "type": "module",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "better-sqlite3": "^11.8.1",
40
40
  "commander": "^12.0.0",
41
- "hzl-core": "^1.5.1",
41
+ "hzl-core": "^1.6.0",
42
42
  "zod": "^3.22.4"
43
43
  },
44
44
  "devDependencies": {