artshelf 0.7.0 โ 0.9.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.
- package/CHANGELOG.md +34 -2
- package/README.md +150 -248
- package/SPEC.md +81 -3
- package/dist/src/cli.js +468 -76
- package/docs/agent-clean.html +6 -24
- package/docs/agent-monitor.html +2 -1
- package/docs/agent-purge.html +111 -0
- package/docs/agent-usage.html +13 -9
- package/docs/agent-usage.md +12 -7
- package/docs/index.html +10 -5
- package/docs/install.html +28 -2
- package/docs/reference.html +75 -10
- package/docs/site.js +2 -1
- package/package.json +1 -1
- package/skills/artshelf/SKILL.md +16 -13
package/CHANGELOG.md
CHANGED
|
@@ -54,8 +54,40 @@
|
|
|
54
54
|
- Added packaged `ArtshelfReviewReport` schema, canonical example files, and a
|
|
55
55
|
portable renderer script for deterministic agent review reports, plus
|
|
56
56
|
deterministic footnote guidance for `artshelf put --json` registrations.
|
|
57
|
-
- Split the agent docs into Create, Monitor, Review, and
|
|
58
|
-
backed by shared docs-site chrome, search, and navigation.
|
|
57
|
+
- Split the agent docs into Create, Monitor, Review, Clean, and Purge workflow
|
|
58
|
+
pages backed by shared docs-site chrome, search, and navigation.
|
|
59
|
+
- Added `artshelf update` plus cached npm update notices, with
|
|
60
|
+
`ARTSHELF_NO_UPDATE_CHECK=1` for no-network scheduled jobs.
|
|
61
|
+
- Rewrote `artshelf help` into a compact, grouped command list (Create, Inspect,
|
|
62
|
+
Review, Clean, System) with one-line summaries and focused per-command help,
|
|
63
|
+
added nested help for `trash`/`ledgers` subcommands plus `artshelf trash help`
|
|
64
|
+
and `artshelf ledgers help` aliases, advertised short `-h`/`-v` flags, and
|
|
65
|
+
reclassified `--ledger`, `--registry`, and `--all` as command-specific scope
|
|
66
|
+
flags instead of global options.
|
|
67
|
+
|
|
68
|
+
## [0.9.0](https://github.com/calvinnwq/artshelf/compare/artshelf-v0.8.0...artshelf-v0.9.0) (2026-06-11)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Features
|
|
72
|
+
|
|
73
|
+
* **cli:** rewrite help with grouped commands, focused per-command help, and short flags ([7310638](https://github.com/calvinnwq/artshelf/commit/73106385ce3e3d037921cdb4ff534614d024244f))
|
|
74
|
+
* **cli:** rewrite top-level help with grouped commands, focused per-command help, and subcommand routing ([c8dea22](https://github.com/calvinnwq/artshelf/commit/c8dea2255628915eb629c5cc4cbc2ef1ec31c3a7))
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Bug Fixes
|
|
78
|
+
|
|
79
|
+
* **cli:** advertise short help flag ([825c4ae](https://github.com/calvinnwq/artshelf/commit/825c4ae38aa61209f22c702a82f51b93c5ea3d09))
|
|
80
|
+
* **cli:** advertise short version flag ([23ca99b](https://github.com/calvinnwq/artshelf/commit/23ca99b0ba7c596a8df89ec3c0384286c55d2a96))
|
|
81
|
+
* **cli:** polish nested help output ([109255d](https://github.com/calvinnwq/artshelf/commit/109255dfa3baa50c6aae837190adb19cfa7249b8))
|
|
82
|
+
* **cli:** support ledgers help subcommand ([18723ce](https://github.com/calvinnwq/artshelf/commit/18723ce384fbdeed33fe066ad0093093d30dc5a5))
|
|
83
|
+
* **cli:** support short help flag ([081b50f](https://github.com/calvinnwq/artshelf/commit/081b50f67a5e0821341aca4f98ab3244ab316338))
|
|
84
|
+
|
|
85
|
+
## [0.8.0](https://github.com/calvinnwq/artshelf/compare/artshelf-v0.7.0...artshelf-v0.8.0) (2026-06-11)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
### Features
|
|
89
|
+
|
|
90
|
+
* **cli:** add update command ([#35](https://github.com/calvinnwq/artshelf/issues/35)) ([c55f689](https://github.com/calvinnwq/artshelf/commit/c55f689d1a58a10430d1ea00a1dea5de408e5ac2))
|
|
59
91
|
|
|
60
92
|
## [0.7.0](https://github.com/calvinnwq/artshelf/compare/artshelf-v0.6.0...artshelf-v0.7.0) (2026-06-10)
|
|
61
93
|
|
package/README.md
CHANGED
|
@@ -1,51 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
somewhere accountable, with an expiry tag and a cleanup plan.
|
|
3
|
+
# ๐๏ธ Artshelf
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
create files in `tmp/`, repo folders, or backup locations and then lose context.
|
|
8
|
-
Artshelf gives them a small, auditable contract: record why an artifact exists
|
|
9
|
-
when it is created, monitor the ledgers later, present a review packet, and clean
|
|
10
|
-
only from explicit approvals.
|
|
5
|
+
**Accountable retention for the temporary files agents leave behind.**
|
|
11
6
|
|
|
12
|
-
|
|
13
|
-
moment it is created, **review everything safely** before anything moves,
|
|
14
|
-
**approve cleanup safely** from a reviewed plan, and **purge old trash
|
|
15
|
-
explicitly** from a separate reviewed plan. The reference sections further down
|
|
16
|
-
stay out of the way until you need them.
|
|
7
|
+
[](https://www.npmjs.com/package/artshelf) [](https://www.npmjs.com/package/artshelf) [](https://github.com/calvinnwq/artshelf/actions/workflows/ci.yml) [](https://calvinnwq.github.io/artshelf/) [](LICENSE) [](https://x.com/calvinnwq)
|
|
17
8
|
|
|
18
|
-
|
|
9
|
+
[**Docs**](https://calvinnwq.github.io/artshelf/) ยท [Quickstart](#quickstart) ยท [Spec](SPEC.md) ยท [Agent setup](INSTALL.md)
|
|
19
10
|
|
|
20
|
-
|
|
21
|
-
`artshelf` package name. The existing local/source install path remains supported
|
|
22
|
-
as a fallback.
|
|
11
|
+
</div>
|
|
23
12
|
|
|
24
|
-
|
|
13
|
+
Agents make a mess. Coding agents, workflow runners, and review bots scatter
|
|
14
|
+
debug dumps, backups, and run outputs across `tmp/` and your repo โ then forget
|
|
15
|
+
them. The clutter piles up, and nobody remembers what's safe to delete.
|
|
25
16
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
Artshelf makes that mess accountable. Every artifact is logged with a reason, an
|
|
18
|
+
expiry, and a cleanup plan the moment it's created. Later you review the ledger,
|
|
19
|
+
preview a cleanup, and execute only an approved plan โ approval-first, trash
|
|
20
|
+
before delete, `--json` everywhere. No daemon, no surprise deletions, no guessing
|
|
21
|
+
from a filesystem scan.
|
|
30
22
|
|
|
31
|
-
|
|
23
|
+
> **Status:** early v1 MVP, published to npm as the unscoped `artshelf` package.
|
|
32
24
|
|
|
33
|
-
|
|
34
|
-
npm install -g artshelf
|
|
35
|
-
artshelf --version
|
|
36
|
-
artshelf doctor
|
|
37
|
-
```
|
|
25
|
+
## Quickstart
|
|
38
26
|
|
|
39
|
-
|
|
27
|
+
Install globally โ all methods end with the same `artshelf` command (requires
|
|
28
|
+
Node.js 22+):
|
|
40
29
|
|
|
41
30
|
```bash
|
|
31
|
+
# npm
|
|
32
|
+
npm install -g artshelf
|
|
33
|
+
|
|
34
|
+
# pnpm
|
|
42
35
|
pnpm add -g artshelf
|
|
36
|
+
|
|
37
|
+
# verify
|
|
43
38
|
artshelf --version
|
|
44
39
|
artshelf doctor
|
|
40
|
+
|
|
41
|
+
# later, for npm installs
|
|
42
|
+
artshelf update
|
|
45
43
|
```
|
|
46
44
|
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
<details>
|
|
46
|
+
<summary>Install from source</summary>
|
|
49
47
|
|
|
50
48
|
```bash
|
|
51
49
|
git clone https://github.com/calvinnwq/artshelf.git
|
|
@@ -58,269 +56,173 @@ artshelf --version
|
|
|
58
56
|
artshelf doctor
|
|
59
57
|
```
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
npm unlink -g artshelf
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
For agent setup, the agent should prompt before optional integration steps:
|
|
69
|
-
|
|
70
|
-
- install CLI from npm, or use a source checkout
|
|
71
|
-
- install/copy/reference the whole `skills/artshelf` directory
|
|
72
|
-
- register existing project ledgers
|
|
73
|
-
- schedule a read-only review job in the host runtime
|
|
74
|
-
- choose where review packets should be delivered
|
|
75
|
-
|
|
76
|
-
Agents should drive the selected setup steps explicitly and verify with
|
|
77
|
-
`artshelf doctor`.
|
|
78
|
-
|
|
79
|
-
## Core Workflows
|
|
80
|
-
|
|
81
|
-
Artshelf is built around four approval-first workflows. Start here; the reference
|
|
82
|
-
sections below are there when you need them, not before.
|
|
83
|
-
|
|
84
|
-
### 1. Register a temp artifact
|
|
85
|
-
|
|
86
|
-
Record an artifact the moment it is created, while the reason is still fresh:
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
artshelf put tmp/run-output --reason "debug parser output" --ttl 3d --kind scratch --cleanup trash
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Artshelf returns an id. Capture it anywhere restart or cleanup context matters.
|
|
93
|
-
|
|
94
|
-
### 2. Review everything safely
|
|
95
|
-
|
|
96
|
-
Inspect the ledger and preview cleanup without moving anything:
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
artshelf list
|
|
100
|
-
artshelf status
|
|
101
|
-
artshelf due
|
|
102
|
-
artshelf cleanup --dry-run
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Because this example keeps the artifact for three days, an immediate dry-run
|
|
106
|
-
reports `not-created` and writes no plan. A dry-run returns a real plan id only
|
|
107
|
-
after `due` shows cleanup entries.
|
|
108
|
-
|
|
109
|
-
### 3. Approve cleanup safely
|
|
110
|
-
|
|
111
|
-
Execute only from a reviewed plan id, and only after a human approves it:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
artshelf cleanup --execute --plan-id plan_20260601_120000_ab12
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
There is no auto-execute, no global execute, and no fresh-plan-then-execute
|
|
118
|
-
shortcut. Execution writes a receipt and updates the touched ledger records.
|
|
119
|
-
|
|
120
|
-
### 4. Purge old trash explicitly
|
|
121
|
-
|
|
122
|
-
Cleanup execution with `cleanup=trash` moves artifacts into Artshelf's local trash
|
|
123
|
-
folder. Those trashed records remain discoverable (`artshelf trash list`) for review
|
|
124
|
-
and should only be physically removed through a separately reviewed trash purge
|
|
125
|
-
plan:
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
artshelf trash purge --older-than 30d --dry-run --json
|
|
129
|
-
artshelf trash purge --execute --plan-id purge_20260601_120000_ab12
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
This adds a separate approval boundary between quarantine and destructive deletion.
|
|
133
|
-
|
|
134
|
-
## Ideal Agent Loop
|
|
135
|
-
|
|
136
|
-
Agents should use Artshelf as a small lifecycle around their own work:
|
|
59
|
+
`npm link` connects the checkout to your global npm bin, so later rebuilds update
|
|
60
|
+
the command. Remove an npm install with `npm uninstall -g artshelf`; a source
|
|
61
|
+
install with `npm unlink -g artshelf`.
|
|
62
|
+
</details>
|
|
137
63
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
approval targets, and a clear safety line.
|
|
146
|
-
4. **Clean**: after explicit approval for the reviewed ledger and plan id, run
|
|
147
|
-
cleanup or resolve, then verify the next review is quiet or explain what
|
|
148
|
-
remains.
|
|
64
|
+
Artshelf checks npm occasionally and prints a non-blocking notice to stderr when
|
|
65
|
+
a newer published version is available. Run `artshelf update` only for npm
|
|
66
|
+
global installs; it upgrades with `npm install -g artshelf@latest`. pnpm global
|
|
67
|
+
installs should update with `pnpm add -g artshelf@latest`, and source installs
|
|
68
|
+
still update by pulling, rebuilding, and linking the checkout. Set
|
|
69
|
+
`ARTSHELF_NO_UPDATE_CHECK=1` for scheduled jobs that must avoid network and
|
|
70
|
+
update-cache writes.
|
|
149
71
|
|
|
150
|
-
|
|
72
|
+
### Recommended agent setup
|
|
151
73
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
`--registry <path>` for tests, demos, and unusual workflows:
|
|
74
|
+
Artshelf is agent-operated, so let your agent finish the job. Paste this one line
|
|
75
|
+
into your coding agent:
|
|
155
76
|
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
artshelf list --ledger /tmp/artshelf-ledger.jsonl
|
|
77
|
+
```text
|
|
78
|
+
Follow the instructions in https://github.com/calvinnwq/artshelf/blob/main/INSTALL.md to set up Artshelf in this workspace.
|
|
159
79
|
```
|
|
160
80
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
81
|
+
It will install the CLI, copy the portable skill (with its bundled review-report
|
|
82
|
+
renderer), register any existing project ledgers, and โ only with your approval โ
|
|
83
|
+
schedule a **read-only** daily review. Scheduled jobs review and report only;
|
|
84
|
+
cleanup and purge execution always come back to you. See [INSTALL.md](INSTALL.md)
|
|
85
|
+
for the full steps.
|
|
165
86
|
|
|
166
|
-
|
|
167
|
-
artshelf ledgers list
|
|
168
|
-
artshelf ledgers add --ledger /path/to/repo/.artshelf/ledger.jsonl --name my-repo
|
|
169
|
-
```
|
|
87
|
+
## How it works
|
|
170
88
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
registry or any ledger is broken โ so it doubles as a stale-entry check. Add
|
|
174
|
-
`--plain` for the fast listing that skips validation.
|
|
89
|
+
The whole lifecycle is five steps, and every step that touches files is gated on
|
|
90
|
+
a reviewed plan a human approved:
|
|
175
91
|
|
|
176
|
-
|
|
92
|
+
| Step | What happens | Command |
|
|
93
|
+
|------|--------------|---------|
|
|
94
|
+
| **1. Register** | Record an artifact the moment it is created, while the reason is fresh. Returns an id. | `artshelf put <path> --reason "โฆ" --ttl 3d --kind scratch --cleanup trash` |
|
|
95
|
+
| **2. Monitor** | Read-only checks across all known ledgers โ moves nothing. | `artshelf status --all --json` ยท `artshelf due --all` |
|
|
96
|
+
| **3. Review** | Preview a cleanup plan. A real plan id appears only once entries are due. | `artshelf review --all` ยท `artshelf cleanup --dry-run` |
|
|
97
|
+
| **4. Clean** | Execute exactly the reviewed plan id, after approval. Trashes, never deletes. | `artshelf cleanup --execute --plan-id <id>` |
|
|
98
|
+
| **5. Purge** | Permanently remove old trashed artifacts via a *separate* reviewed plan. | `artshelf trash purge --older-than 30d --dry-run` โ `--execute --plan-id <id>` |
|
|
177
99
|
|
|
178
|
-
|
|
179
|
-
artshelf
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
artshelf trash list --all --json
|
|
183
|
-
artshelf find --all --owner <agent-or-runtime> --json
|
|
184
|
-
```
|
|
100
|
+
Trash is the holding area between steps 4 and 5: cleanup quarantines artifacts
|
|
101
|
+
into Artshelf's local trash (`artshelf trash list`), and only a separately
|
|
102
|
+
reviewed purge removes them for good โ a second approval boundary before
|
|
103
|
+
destructive deletion.
|
|
185
104
|
|
|
186
|
-
|
|
187
|
-
manual-review, missing-path, executable, and skipped counts plus preview plan
|
|
188
|
-
ids) and states the next safe action, while staying read-only.
|
|
105
|
+
## Safety model
|
|
189
106
|
|
|
190
|
-
|
|
191
|
-
|
|
107
|
+
- **Ledger-first**, not filesystem-scan-first โ every artifact is a recorded decision.
|
|
108
|
+
- **Dry-run before mutation**, and execute only from a reviewed plan id.
|
|
109
|
+
- **No daemon, no auto-execute, no global execute** โ `--all` is read-only or
|
|
110
|
+
dry-run reporting; cleanup and purge refuse it.
|
|
111
|
+
- **No fresh-plan-then-execute shortcut** โ review the plan, then run that plan.
|
|
112
|
+
- **Trash before delete** โ `cleanup=delete` stays refused; physical deletion
|
|
113
|
+
needs its own reviewed trash purge. No silent deletion, ever.
|
|
114
|
+
- **`--json` on every command**, so agents can act on structured output.
|
|
192
115
|
|
|
193
|
-
|
|
194
|
-
artshelf cleanup --dry-run --all --json
|
|
195
|
-
```
|
|
116
|
+
## Reference
|
|
196
117
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
Repeated dry-runs with the same executable cleanup entries reuse the existing
|
|
200
|
-
plan id and refresh its timestamp instead of creating duplicate plan files.
|
|
201
|
-
|
|
202
|
-
## Safety Model
|
|
203
|
-
|
|
204
|
-
- Ledger-first, not filesystem-scan-first.
|
|
205
|
-
- Dry-run before mutation.
|
|
206
|
-
- Execute only from a reviewed plan id.
|
|
207
|
-
- No daemon or auto-execute path.
|
|
208
|
-
- No global execute; cleanup execute and trash purge refuse `--all`.
|
|
209
|
-
`--all` is read-only or dry-run reporting only.
|
|
210
|
-
- No fresh-plan-then-execute shortcut.
|
|
211
|
-
- Trash/review by default, not delete.
|
|
212
|
-
- No silent deletion; `cleanup=delete` stays refused, and trash purge needs its own reviewed plan.
|
|
213
|
-
- Agent-friendly JSON output from every command.
|
|
214
|
-
- Small enough to actually use.
|
|
215
|
-
|
|
216
|
-
V1 only moves `cleanup=trash` entries into Artshelf's local trash folder. Entries
|
|
217
|
-
marked `cleanup=review` become `review-required`, and `cleanup=delete` is
|
|
218
|
-
refused as `cleanup-refused`; physical deletion only happens through a separate
|
|
219
|
-
reviewed `artshelf trash purge --execute` plan.
|
|
220
|
-
|
|
221
|
-
Dry-run cleanup writes a plan only when there are executable cleanup entries.
|
|
222
|
-
No-op dry-runs report `not-created` and avoid writing plan files. When Artshelf does
|
|
223
|
-
write a plan, it also records that plan in the ledger as an Artshelf-owned artifact.
|
|
224
|
-
|
|
225
|
-
After `cleanup --execute`, Artshelf writes a receipt, records the receipt as a
|
|
226
|
-
Artshelf-owned artifact, and updates touched ledger records. Handled records stop
|
|
227
|
-
appearing in `due` and later dry-run cleanup plans, while `artshelf list` still
|
|
228
|
-
keeps the audit trail visible.
|
|
229
|
-
|
|
230
|
-
## Commands
|
|
118
|
+
<details>
|
|
119
|
+
<summary>All commands</summary>
|
|
231
120
|
|
|
232
121
|
```bash
|
|
233
122
|
artshelf put <path> --reason "debug parser output" --ttl 3d --kind scratch
|
|
234
|
-
artshelf ledgers list
|
|
235
|
-
artshelf ledgers
|
|
236
|
-
artshelf
|
|
237
|
-
artshelf list
|
|
238
|
-
artshelf list --all
|
|
239
|
-
artshelf list --status active
|
|
123
|
+
artshelf ledgers list [--plain] [--json]
|
|
124
|
+
artshelf ledgers add --ledger <path> [--name <project>] [--scope repo|user|other] [--json]
|
|
125
|
+
artshelf list [--all] [--status active]
|
|
240
126
|
artshelf find --path <path> --owner <agent-or-runtime> --label <task-or-run-id>
|
|
241
127
|
artshelf find --all --owner <agent-or-runtime>
|
|
242
|
-
artshelf get <id>
|
|
243
|
-
artshelf
|
|
244
|
-
artshelf
|
|
245
|
-
artshelf
|
|
246
|
-
artshelf
|
|
247
|
-
artshelf validate --all
|
|
248
|
-
artshelf review
|
|
249
|
-
artshelf review --all
|
|
128
|
+
artshelf get <id> [--all]
|
|
129
|
+
artshelf due [--all]
|
|
130
|
+
artshelf validate [--all]
|
|
131
|
+
artshelf review [--all]
|
|
132
|
+
artshelf status [--all]
|
|
250
133
|
artshelf doctor
|
|
251
|
-
artshelf
|
|
252
|
-
artshelf
|
|
253
|
-
artshelf cleanup --
|
|
254
|
-
artshelf cleanup --dry-run --all
|
|
255
|
-
artshelf cleanup --execute --plan-id <id>
|
|
134
|
+
artshelf update [--json]
|
|
135
|
+
artshelf cleanup --dry-run [--all]
|
|
136
|
+
artshelf cleanup --execute --plan-id <id> [--ledger <path>] [--json]
|
|
256
137
|
artshelf trash list [--all] [--ledger <path>] [--json]
|
|
257
138
|
artshelf trash purge --older-than <ttl> --dry-run [--ledger <path>] [--json]
|
|
258
139
|
artshelf trash purge --execute --plan-id <id> [--ledger <path>] [--json]
|
|
259
|
-
artshelf resolve <id> --status resolved --reason "inspected and no longer needed"
|
|
140
|
+
artshelf resolve <id> --status resolved --reason "inspected and no longer needed" [--ledger <path>] [--json]
|
|
260
141
|
```
|
|
261
142
|
|
|
262
|
-
Use `artshelf help`
|
|
263
|
-
commands
|
|
143
|
+
Use `artshelf help` for a grouped command list, then `artshelf <command> --help`
|
|
144
|
+
or `artshelf help <command>` for focused details. Nested commands such as
|
|
145
|
+
`artshelf trash purge --help` and `artshelf ledgers add --help` show only that
|
|
146
|
+
subcommand. All core commands support `--json`; `--ledger`, `--registry`, and
|
|
147
|
+
`--all` are scope flags only on commands that list them.
|
|
148
|
+
</details>
|
|
264
149
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
[v1 spec](SPEC.md) and [agent usage guide](docs/agent-usage.md).
|
|
150
|
+
<details>
|
|
151
|
+
<summary>Explicit ledgers and <code>--all</code> discovery</summary>
|
|
268
152
|
|
|
269
|
-
|
|
153
|
+
By default, Artshelf writes repo-local `.artshelf/ledger.jsonl` inside a git repo
|
|
154
|
+
and `~/.artshelf/ledger.jsonl` outside one. Use `--ledger <path>` and an isolated
|
|
155
|
+
`--registry <path>` for tests, demos, and unusual workflows:
|
|
270
156
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
lookup surface, why `cleanup --execute` requires explicit approval for a
|
|
276
|
-
reviewed plan id, how to render dry-run cleanup and trash purge plans as
|
|
277
|
-
review-report decision packets, how to review trashed records with
|
|
278
|
-
`artshelf trash list` before a separately approved trash purge, and when
|
|
279
|
-
`artshelf resolve <id> --status resolved --reason <text>` may mark confirmed
|
|
280
|
-
handled, missing, or no-longer-needed records without moving or deleting files.
|
|
157
|
+
```bash
|
|
158
|
+
artshelf put /tmp/parser-output --reason "parser fixture" --ttl 1d --ledger /tmp/artshelf-ledger.jsonl --registry /tmp/artshelf-registry.json --json
|
|
159
|
+
artshelf list --ledger /tmp/artshelf-ledger.jsonl
|
|
160
|
+
```
|
|
281
161
|
|
|
282
|
-
|
|
283
|
-
|
|
162
|
+
Artshelf keeps a small global registry of known ledgers at
|
|
163
|
+
`~/.artshelf/ledgers.json` (override with `--registry <path>` or
|
|
164
|
+
`ARTSHELF_REGISTRY`). `put` registers its ledger automatically; register an
|
|
165
|
+
existing one with `artshelf ledgers add --ledger <path> --name <project> --json`.
|
|
166
|
+
`artshelf ledgers list` validates each registered ledger by default (ok/missing/invalid
|
|
167
|
+
status with counts, non-zero exit when broken), so it doubles as a stale-entry
|
|
168
|
+
check; add `--plain` to skip validation.
|
|
169
|
+
|
|
170
|
+
Use `--all` for one read-only discovery entry point across registered ledgers
|
|
171
|
+
(`review`, `status`, `due`, `trash list`, `find`). `artshelf cleanup --dry-run --all`
|
|
172
|
+
writes plans for ledgers with executable entries without moving files. Global
|
|
173
|
+
execution is intentionally refused: to mutate files, review a dry-run plan, then
|
|
174
|
+
execute it against the specific ledger that produced it.
|
|
175
|
+
</details>
|
|
176
|
+
|
|
177
|
+
<details>
|
|
178
|
+
<summary>Agent skill</summary>
|
|
179
|
+
|
|
180
|
+
The package includes an agent-facing skill at `skills/artshelf`. Agents that
|
|
181
|
+
support local skills can copy or reference this directory to learn when to call
|
|
182
|
+
`artshelf put`, how to report deterministic footnotes after JSON registration,
|
|
183
|
+
why `artshelf find` / `artshelf get` are the read-only idempotency lookup surface,
|
|
184
|
+
why `cleanup --execute` requires an approved reviewed plan id, how to render
|
|
185
|
+
dry-run cleanup and trash purge plans as review-report decision packets, and when
|
|
186
|
+
`artshelf resolve <id> --status resolved --reason <text>` may mark a record handled
|
|
187
|
+
without moving or deleting files.
|
|
188
|
+
|
|
189
|
+
The skill ships in the npm package alongside `scripts/render-review-report.mjs`,
|
|
284
190
|
`schemas/artshelf-review-report.schema.json`, and the canonical
|
|
285
|
-
`examples/artshelf-review-report.json` packet.
|
|
286
|
-
|
|
287
|
-
|
|
191
|
+
`examples/artshelf-review-report.json` packet. Copy the whole `skills/artshelf`
|
|
192
|
+
directory so the renderer, schema, and examples travel together.
|
|
193
|
+
</details>
|
|
288
194
|
|
|
289
|
-
|
|
195
|
+
<details>
|
|
196
|
+
<summary>Development</summary>
|
|
290
197
|
|
|
291
198
|
```bash
|
|
292
199
|
pnpm install
|
|
293
|
-
pnpm check
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
Preview the static docs site locally:
|
|
297
|
-
|
|
298
|
-
```bash
|
|
299
|
-
pnpm docs:serve
|
|
200
|
+
pnpm check # build + test
|
|
201
|
+
pnpm docs:serve # preview docs at http://127.0.0.1:8080/
|
|
300
202
|
```
|
|
301
203
|
|
|
302
|
-
|
|
204
|
+
Release Please owns version bumps, changelog, tags, and releases. When a Release
|
|
205
|
+
Please PR merges, the release workflow validates with `pnpm check` and publishes
|
|
206
|
+
`artshelf` to npm through npm Trusted Publishing โ no long-lived npm token in
|
|
207
|
+
GitHub secrets. During tests or one-off runs, pass both `--ledger <path>` and
|
|
208
|
+
`--registry <path>` to keep entries out of default Artshelf storage.
|
|
209
|
+
</details>
|
|
303
210
|
|
|
304
|
-
|
|
305
|
-
When a Release Please PR is merged and a release is created, the release workflow
|
|
306
|
-
validates the package with `pnpm check` and publishes `artshelf` to npm through
|
|
307
|
-
npm Trusted Publishing. The npm package must have this repository's release
|
|
308
|
-
workflow configured as a trusted publisher; no long-lived npm token is expected
|
|
309
|
-
in GitHub secrets.
|
|
211
|
+
## Learn more
|
|
310
212
|
|
|
311
|
-
|
|
312
|
-
|
|
213
|
+
- **[Docs site](https://calvinnwq.github.io/artshelf/)** โ install, quickstart, agent usage, and CLI reference.
|
|
214
|
+
- **[v1 spec](SPEC.md)** โ the full behavioral contract.
|
|
215
|
+
- **[Agent usage guide](docs/agent-usage.md)** โ deeper agent integration notes.
|
|
313
216
|
|
|
314
217
|
## Contributing
|
|
315
218
|
|
|
316
219
|
Artshelf is small on purpose. Keep new behavior ledger-first, previewable, and
|
|
317
220
|
covered by tests. See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
318
221
|
|
|
319
|
-
## Support
|
|
222
|
+
## Support and security
|
|
320
223
|
|
|
321
224
|
Use [GitHub issues](https://github.com/calvinnwq/artshelf/issues) for bugs and
|
|
322
|
-
feature ideas. See
|
|
323
|
-
[SUPPORT.md](SUPPORT.md) and [SECURITY.md](SECURITY.md).
|
|
225
|
+
feature ideas. See [SUPPORT.md](SUPPORT.md) and [SECURITY.md](SECURITY.md).
|
|
324
226
|
|
|
325
227
|
## License
|
|
326
228
|
|
package/SPEC.md
CHANGED
|
@@ -36,6 +36,35 @@ somewhere accountable, with an expiry tag and a cleanup plan.
|
|
|
36
36
|
|
|
37
37
|
## V1 CLI
|
|
38
38
|
|
|
39
|
+
### Help and option presentation
|
|
40
|
+
|
|
41
|
+
Top-level help is compact and points readers to focused command help.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
artshelf help
|
|
45
|
+
artshelf --help
|
|
46
|
+
artshelf <command> --help
|
|
47
|
+
artshelf help <command>
|
|
48
|
+
artshelf <command> <subcommand> --help
|
|
49
|
+
artshelf help <command> <subcommand>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Rules:
|
|
53
|
+
|
|
54
|
+
- `artshelf help`, `artshelf --help`, and `artshelf -h` show a grouped command
|
|
55
|
+
list with one-line summaries instead of dumping every command variant.
|
|
56
|
+
- Command groups are `Create`, `Inspect`, `Review`, `Clean`, and `System`.
|
|
57
|
+
- `artshelf <command> --help` and `artshelf help <command>` show focused help
|
|
58
|
+
for that command.
|
|
59
|
+
- Nested help is supported for `trash list`, `trash purge`, `ledgers list`, and
|
|
60
|
+
`ledgers add`.
|
|
61
|
+
- `artshelf trash help` and `artshelf ledgers help` are aliases for the focused
|
|
62
|
+
help of those commands, matching `artshelf help trash` and `artshelf help ledgers`.
|
|
63
|
+
- Top-level help presents `-h, --help` and `-v, --version` as global options,
|
|
64
|
+
`--json` as the output mode, and `--ledger`, `--registry`, and `--all` as
|
|
65
|
+
command-specific scope flags. The short `-h` and `-v` forms work both at the
|
|
66
|
+
top level and after a command.
|
|
67
|
+
|
|
39
68
|
### `artshelf put`
|
|
40
69
|
|
|
41
70
|
Records an existing file or directory in the ledger.
|
|
@@ -79,8 +108,9 @@ Lists or registers known Artshelf ledgers.
|
|
|
79
108
|
|
|
80
109
|
```bash
|
|
81
110
|
artshelf ledgers list
|
|
111
|
+
artshelf ledgers list --json
|
|
82
112
|
artshelf ledgers list --plain
|
|
83
|
-
artshelf ledgers add --ledger <path> --name <project> --scope repo
|
|
113
|
+
artshelf ledgers add --ledger <path> --name <project> --scope repo --json
|
|
84
114
|
```
|
|
85
115
|
|
|
86
116
|
Rules:
|
|
@@ -284,6 +314,45 @@ ledger exits non-zero. Due entries are normal operational state and do not chang
|
|
|
284
314
|
the exit code. With single `--ledger`, a not-yet-created ledger reports empty
|
|
285
315
|
counts.
|
|
286
316
|
|
|
317
|
+
### `artshelf update`
|
|
318
|
+
|
|
319
|
+
Checks the latest published npm version and, for npm global installs, updates the
|
|
320
|
+
package with npm.
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
artshelf update
|
|
324
|
+
artshelf update --json
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Rules:
|
|
328
|
+
|
|
329
|
+
- Normal commands may perform a best-effort npm update check after command
|
|
330
|
+
handling and print a non-blocking notice to stderr when a newer version is
|
|
331
|
+
available.
|
|
332
|
+
- Read-only command guarantees refer to ledger and artifact mutation; automatic
|
|
333
|
+
update-check cache writes are separate and can be disabled.
|
|
334
|
+
- Update notices must never pollute JSON stdout.
|
|
335
|
+
- Automatic checks cache successful and failed latest-version lookups at
|
|
336
|
+
`~/.artshelf/update-check.json` by default, with a 24-hour TTL.
|
|
337
|
+
- `ARTSHELF_NO_UPDATE_CHECK=1` disables automatic checks for scheduled jobs,
|
|
338
|
+
tests, and no-network environments.
|
|
339
|
+
- `ARTSHELF_UPDATE_CACHE` overrides the update-cache path,
|
|
340
|
+
`ARTSHELF_UPDATE_CHECK_TTL_MS` overrides the cache TTL, and
|
|
341
|
+
`ARTSHELF_NPM_REGISTRY_URL` overrides the npm latest-version endpoint.
|
|
342
|
+
- `ARTSHELF_LATEST_VERSION` overrides the discovered latest version for tests.
|
|
343
|
+
- `ARTSHELF_UPDATE_DRY_RUN=1` makes `artshelf update` report the npm command it
|
|
344
|
+
would run without invoking npm.
|
|
345
|
+
- `artshelf update` forces a fresh latest-version check and does not run the
|
|
346
|
+
automatic post-command notice check.
|
|
347
|
+
- If the current version is already current, update exits 0 and reports that no
|
|
348
|
+
update was installed.
|
|
349
|
+
- When an update is available, `artshelf update` runs
|
|
350
|
+
`npm install -g artshelf@latest`; `--json` captures npm stdout/stderr and
|
|
351
|
+
returns npm's exit code.
|
|
352
|
+
- `artshelf update` is for npm global installs only. pnpm global installs should
|
|
353
|
+
use `pnpm add -g artshelf@latest`; source installs should pull, rebuild, and
|
|
354
|
+
link the checkout again.
|
|
355
|
+
|
|
287
356
|
### `artshelf cleanup --dry-run`
|
|
288
357
|
|
|
289
358
|
Creates a cleanup plan when there are executable cleanup entries, but does not
|
|
@@ -322,8 +391,8 @@ plan id.
|
|
|
322
391
|
Executes a previously generated cleanup plan.
|
|
323
392
|
|
|
324
393
|
```bash
|
|
325
|
-
artshelf cleanup --execute --plan-id <id>
|
|
326
|
-
artshelf cleanup --execute --plan-id <id> --json
|
|
394
|
+
artshelf cleanup --execute --plan-id <id> [--ledger <path>]
|
|
395
|
+
artshelf cleanup --execute --plan-id <id> [--ledger <path>] --json
|
|
327
396
|
```
|
|
328
397
|
|
|
329
398
|
Rules:
|
|
@@ -450,6 +519,10 @@ V1 also supports a user-level registry of known ledgers:
|
|
|
450
519
|
- Retention and due calculations use wall-clock time by default. `ARTSHELF_NOW`
|
|
451
520
|
overrides it for tests and controlled runs; legacy `SHELF_NOW` is read only
|
|
452
521
|
when `ARTSHELF_NOW` is unset.
|
|
522
|
+
- Automatic npm update checks cache their latest-version result at
|
|
523
|
+
`~/.artshelf/update-check.json` by default. `ARTSHELF_NO_UPDATE_CHECK=1`
|
|
524
|
+
disables automatic checks, `ARTSHELF_UPDATE_CACHE` overrides the cache path,
|
|
525
|
+
and `ARTSHELF_UPDATE_CHECK_TTL_MS` overrides the cache TTL.
|
|
453
526
|
- `put` registers the ledger it writes to.
|
|
454
527
|
- `ledgers add` registers an existing ledger explicitly.
|
|
455
528
|
- `--all` reads registered ledgers as one review surface.
|
|
@@ -632,6 +705,9 @@ artshelf trash list --all --json
|
|
|
632
705
|
artshelf trash purge --older-than <ttl> --dry-run --ledger <path> --json
|
|
633
706
|
```
|
|
634
707
|
|
|
708
|
+
Set `ARTSHELF_NO_UPDATE_CHECK=1` for scheduled jobs that must avoid npm network
|
|
709
|
+
checks and update-cache writes.
|
|
710
|
+
|
|
635
711
|
`artshelf review --all --json` is the read-only all-ledger triage surface;
|
|
636
712
|
scheduled reports should include its aggregate `summary` and `nextAction` when
|
|
637
713
|
whole-machine review is needed.
|
|
@@ -683,6 +759,8 @@ human review.
|
|
|
683
759
|
- CLI reports a read-only daily dashboard through `artshelf status`, with
|
|
684
760
|
`--all --json` suitable for cron and human output short enough to paste into
|
|
685
761
|
a chat; status never creates plans, receipts, or records.
|
|
762
|
+
- CLI can check for npm package updates, print non-blocking stderr notices, and
|
|
763
|
+
update npm global installs through `artshelf update`.
|
|
686
764
|
- Cleanup dry-run creates a plan id only when there are executable cleanup
|
|
687
765
|
entries; no-op dry-runs do not write plan files.
|
|
688
766
|
- Cleanup dry-run and execute register the plan/receipt artifacts that Artshelf
|