artshelf 0.6.0 → 0.8.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/docs/install.html CHANGED
@@ -3,131 +3,235 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>Install Artshelf</title>
7
- <meta name="description" content="Install Artshelf from npm or a local source checkout.">
6
+ <title>Install · Artshelf</title>
7
+ <meta name="description" content="Install Artshelf from npm or source, then verify with doctor.">
8
+ <script>(function(){var stored=null;try{stored=localStorage.getItem("artshelf-docs-theme");}catch(e){}var dark=false;try{dark=matchMedia("(prefers-color-scheme: dark)").matches;}catch(e){}document.documentElement.dataset.theme=stored||(dark?"dark":"light");})();</script>
9
+ <link rel="preconnect" href="https://fonts.googleapis.com">
10
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11
+ <link href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,450..680;1,9..144,450..680&family=Newsreader:ital,opsz,wght@0,6..72,400..650;1,6..72,400..650&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
8
12
  <link rel="stylesheet" href="site.css">
9
- <script src="theme.js" defer></script>
13
+ <script src="site.js" defer></script>
10
14
  </head>
11
- <body>
12
- <div class="docs-shell">
13
- <nav class="global-nav" aria-label="Documentation">
14
- <a class="site-mark" href="index.html"><strong>Artshelf</strong><span>Artifact retention CLI</span></a>
15
- <button class="theme-toggle" type="button" data-theme-toggle aria-label="Toggle color theme" aria-pressed="false">Dark</button>
16
- <div class="nav-scroll" aria-label="Documentation sections">
17
- <div class="nav-section">
18
- <p class="nav-section-title">Start</p>
19
- <a href="index.html">Overview</a>
20
- <a href="install.html" aria-current="page">Install</a>
21
- <a href="quickstart.html">Quickstart</a>
15
+ <body data-page="install.html">
16
+ <a class="skip" href="#content">Skip to content</a>
17
+ <header class="masthead">
18
+ <div class="masthead-inner">
19
+ <button class="menu-btn" type="button" data-menu aria-label="Toggle navigation" aria-expanded="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M1 3.5h14M1 8h14M1 12.5h14" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg></button>
20
+ <a class="brand" href="index.html">Artshelf<span class="brand-tag">docs</span></a>
21
+ <button class="search-btn" type="button" data-search-open><span>Search docs</span><kbd>/</kbd></button>
22
+ <div class="masthead-tools">
23
+ <a class="gh" href="https://github.com/calvinnwq/artshelf">GitHub</a>
24
+ <button class="theme-btn" type="button" data-theme-toggle aria-label="Toggle color theme" aria-pressed="false">
25
+ <svg class="icon-moon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.6 12.1A6.5 6.5 0 0 1 7.4 2.7a6.5 6.5 0 1 0 7.2 9.4z" fill="currentColor"/></svg>
26
+ <svg class="icon-sun" viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="3.4" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="10" y1="2" x2="10" y2="4"/><line x1="10" y1="16" x2="10" y2="18"/><line x1="2" y1="10" x2="4" y2="10"/><line x1="16" y1="10" x2="18" y2="10"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="14.4" y1="14.4" x2="15.8" y2="15.8"/><line x1="4.2" y1="15.8" x2="5.6" y2="14.4"/><line x1="14.4" y1="5.6" x2="15.8" y2="4.2"/></g></svg>
27
+ </button>
22
28
  </div>
23
- <div class="nav-section">
24
- <p class="nav-section-title">Agents</p>
25
- <a href="agent-usage.html">Agent usage</a>
26
- <a href="https://github.com/calvinnwq/artshelf/blob/main/skills/artshelf/SKILL.md">Agent skill</a>
27
- </div>
28
- <div class="nav-section">
29
- <p class="nav-section-title">Reference</p>
30
- <a href="reference.html">CLI reference</a>
31
- <a href="https://github.com/calvinnwq/artshelf">GitHub</a>
32
- </div>
33
- </div>
34
- </nav>
35
-
36
- <div class="docs-content">
37
- <header class="page-top">
38
- <div class="wrap">
39
- <nav class="breadcrumbs" aria-label="Breadcrumbs"><a href="index.html">Docs</a><span>/</span><span>Install</span></nav>
40
- <div class="hero">
41
- <div>
42
- <p class="eyebrow">Install</p>
43
- <h1>Install Artshelf.</h1>
44
- <p class="lede">
45
- Artshelf is distributed under the unscoped `artshelf` package name.
46
- Source install remains the fallback path.
47
- </p>
48
- </div>
49
- <div class="terminal">
50
- <div class="terminal-head"><span class="dot"></span><span class="dot"></span><span class="dot"></span><span>install</span></div>
51
- <pre><code>$ npm install -g artshelf
52
- $ artshelf --version
53
- $ artshelf doctor</code></pre>
54
- </div>
55
- </div>
56
- </div>
57
- </header>
58
-
59
- <main class="wrap">
60
- <article>
61
- <section>
62
- <h2>Requirements</h2>
63
- <div class="grid">
64
- <div class="card"><h3>Node.js 22+</h3><p>The package declares `node &gt;=22` and CI runs on Node 24.</p></div>
65
- <div class="card"><h3>npm or pnpm</h3><p>Install the global package with your preferred Node package manager.</p></div>
66
- <div class="card"><h3>Source tooling</h3><p>Corepack and Git are only needed when cloning, building, and linking from source.</p></div>
67
- </div>
68
- </section>
69
-
70
- <section>
71
- <h2>Install From npm</h2>
72
- <pre><code>npm install -g artshelf
73
- artshelf --version
74
- artshelf doctor</code></pre>
75
- <pre><code>pnpm add -g artshelf
76
- artshelf --version
77
- artshelf doctor</code></pre>
78
- <pre><code>npm uninstall -g artshelf</code></pre>
79
- </section>
29
+ </div>
30
+ </header>
80
31
 
81
- <section>
82
- <h2>Install From Source</h2>
83
- <pre><code>git clone https://github.com/calvinnwq/artshelf.git
32
+ <div class="frame">
33
+ <nav id="sidebar" class="sidebar" aria-label="Documentation"></nav>
34
+
35
+ <main id="content" class="article-col">
36
+ <article>
37
+ <p class="kicker"><span class="n">02</span>Start · Install</p>
38
+ <h1>Install the CLI, then run doctor.</h1>
39
+ <p class="lede">
40
+ Install globally from npm, verify the command works, then hand the setup
41
+ prompt to your coding agent.
42
+ </p>
43
+
44
+ <section>
45
+ <h2>Requirements</h2>
46
+ <dl class="def-rows">
47
+ <div><dt>Node.js 22+</dt><dd>the package declares <code>node &gt;=22</code>; CI runs on Node 24</dd></div>
48
+ <div><dt>npm or pnpm</dt><dd>any Node package manager can install the global package</dd></div>
49
+ <div><dt>Git + Corepack</dt><dd>only needed for the source install below</dd></div>
50
+ </dl>
51
+ </section>
52
+
53
+ <section>
54
+ <h2>Installation</h2>
55
+ <p>Pick one method. All three end with the same global <code>artshelf</code> command.</p>
56
+ <pre><code><span class="c"># npm</span>
57
+ npm install -g artshelf
58
+
59
+ <span class="c"># pnpm</span>
60
+ pnpm add -g artshelf
61
+
62
+ <span class="c"># from source (needs git + corepack)</span>
63
+ git clone https://github.com/calvinnwq/artshelf.git
84
64
  cd artshelf
85
65
  corepack enable
86
66
  pnpm install --frozen-lockfile
87
67
  pnpm run build
88
68
  npm link
69
+
70
+ <span class="c"># verify whichever you picked</span>
89
71
  artshelf --version
90
- artshelf doctor</code></pre>
91
- <p>
92
- `npm link` connects the local checkout to your global npm bin, so future rebuilds update the `artshelf`
93
- command.
94
- </p>
95
- <pre><code>npm unlink -g artshelf</code></pre>
96
- </section>
97
-
98
- <section>
99
- <h2>Update A Source Install</h2>
100
- <pre><code>cd artshelf
72
+ artshelf doctor
73
+
74
+ <span class="c"># later, for npm installs only</span>
75
+ artshelf update</code></pre>
76
+ <p>
77
+ <code>npm link</code> connects the local checkout to your global npm bin, so
78
+ later rebuilds update the <code>artshelf</code> command. To remove an npm
79
+ install, run <code>npm uninstall -g artshelf</code>; for a source install,
80
+ run <code>npm unlink -g artshelf</code>.
81
+ </p>
82
+ <p>
83
+ Artshelf checks npm occasionally and prints update notices to stderr, so
84
+ scripted JSON output stays clean. <code>artshelf update</code> is for npm
85
+ global installs only and runs <code>npm install -g artshelf@latest</code>.
86
+ pnpm global installs should update with
87
+ <code>pnpm add -g artshelf@latest</code>; source installs should update
88
+ by pulling, rebuilding, and linking again. Set
89
+ <code>ARTSHELF_NO_UPDATE_CHECK=1</code> for scheduled jobs that must
90
+ avoid network and update-cache writes.
91
+ </p>
92
+ </section>
93
+
94
+ <section>
95
+ <h2>Updating a source install</h2>
96
+ <pre><code><span class="c"># pull the latest changes and rebuild</span>
97
+ cd artshelf
101
98
  git pull
102
99
  pnpm install --frozen-lockfile
103
100
  pnpm run build
101
+ npm link</code></pre>
102
+ </section>
103
+
104
+ <section>
105
+ <h2>Recommended agent setup</h2>
106
+ <p>
107
+ Artshelf is agent-operated, so let your agent finish the job. The repo
108
+ ships <a href="https://github.com/calvinnwq/artshelf/blob/main/INSTALL.md">INSTALL.md</a>
109
+ with the full agent setup steps: install the portable skill together
110
+ with its bundled report renderer script, register existing ledgers, and
111
+ ask you first before creating any scheduled review job. Scheduled jobs
112
+ stay read-only; cleanup and purge execution always come back to you.
113
+ </p>
114
+ <p>Copy this one line into your coding agent:</p>
115
+ <pre><code>Follow the instructions in https://github.com/calvinnwq/artshelf/blob/main/INSTALL.md to set up Artshelf in this workspace.</code></pre>
116
+ <p>What the agent will follow, in full:</p>
117
+ <pre><code># Artshelf agent setup
118
+
119
+ These instructions are written for a coding agent. If you are a human, paste
120
+ this one line into your agent and let it do the rest:
121
+
122
+ &gt; Follow the instructions in
123
+ &gt; https://github.com/calvinnwq/artshelf/blob/main/INSTALL.md
124
+ &gt; to set up Artshelf in this workspace.
125
+
126
+ ## 1. Install the CLI
127
+
128
+ Check whether it is already installed before changing anything:
129
+
130
+ ```bash
131
+ artshelf --version
132
+ artshelf doctor
133
+ ```
134
+
135
+ If the command is missing, install it from npm and verify again:
136
+
137
+ ```bash
138
+ npm install -g artshelf # or: pnpm add -g artshelf
139
+ artshelf --version
140
+ artshelf doctor
141
+ ```
142
+
143
+ If Artshelf says a newer version is available and you used npm, update the npm
144
+ install and verify again:
145
+
146
+ ```bash
147
+ artshelf update
148
+ artshelf --version
149
+ artshelf doctor
150
+ ```
151
+
152
+ If you used pnpm, update with `pnpm add -g artshelf@latest` instead.
153
+ For source installs, pull, rebuild, and run `npm link` again.
154
+
155
+ Only use a source install when the user asks for one, and ask the user where
156
+ to clone the repo first instead of assuming a repo path:
157
+
158
+ ```bash
159
+ git clone https://github.com/calvinnwq/artshelf.git "$ARTSHELF_REPO"
160
+ cd "$ARTSHELF_REPO"
161
+ corepack enable
162
+ pnpm install --frozen-lockfile
163
+ pnpm run build
104
164
  npm link
105
165
  artshelf --version
106
- artshelf doctor</code></pre>
107
- </section>
108
-
109
- <section>
110
- <h2>Agent Setup</h2>
111
- <p>
112
- Agents should prefer the npm install when available. If using a source install,
113
- ask the user where to clone it before linking the command.
114
- </p>
115
- <pre><code>docs/agent-usage.md</code></pre>
116
- <div class="note">Verify `artshelf --version` and `artshelf doctor` after either install method.</div>
117
- </section>
118
-
119
- <section>
120
- <h2>Preview Docs Locally</h2>
121
- <pre><code>pnpm docs:serve</code></pre>
122
- <p>
123
- This serves the static docs directory at
124
- <a href="http://127.0.0.1:8080/">127.0.0.1:8080</a>.
125
- </p>
126
- </section>
127
- </article>
128
- </main>
129
- <footer class="site-footer"><div class="wrap">Artshelf docs · <a href="quickstart.html">Next: quickstart</a></div></footer>
130
- </div>
166
+ artshelf doctor
167
+ ```
168
+
169
+ ## 2. Install the portable skill, including its script
170
+
171
+ Install, copy, or reference the portable skill so you register temporary
172
+ artifacts when you create them and check the shelf before handoffs. Copy the
173
+ whole `skills/artshelf` directory, not just SKILL.md: the skill ships with
174
+ `scripts/render-review-report.mjs` (the deterministic review report renderer)
175
+ plus its `schemas/` and `examples/`, and those must travel together.
176
+
177
+ ```bash
178
+ # from the installed npm package
179
+ rm -rf &lt;your-skills-dir&gt;/artshelf
180
+ cp -R "$(npm root -g)/artshelf/skills/artshelf" &lt;your-skills-dir&gt;/
181
+
182
+ # or from a source checkout
183
+ rm -rf &lt;your-skills-dir&gt;/artshelf
184
+ cp -R "$ARTSHELF_REPO/skills/artshelf" &lt;your-skills-dir&gt;/
185
+ ```
186
+
187
+ Re-run the replacement copy after upgrading the package so the skill and
188
+ script stay in sync with the CLI.
189
+
190
+ ## 3. Register existing ledgers
191
+
192
+ `artshelf put` registers its ledger automatically. Register any existing
193
+ project ledgers so `--all` commands can see them:
194
+
195
+ ```bash
196
+ artshelf ledgers add --ledger &lt;repo&gt;/.artshelf/ledger.jsonl --name &lt;project&gt; --scope repo --json
197
+ artshelf ledgers list --json
198
+ ```
199
+
200
+ ## 4. Scheduled review (ask the user first)
201
+
202
+ Ask the user whether they want a scheduled review job before creating one.
203
+ If they approve, schedule a read-only review job (daily works well) in your
204
+ host runtime that disables update checks and runs:
205
+
206
+ ```bash
207
+ ARTSHELF_NO_UPDATE_CHECK=1 \
208
+ artshelf review --all --json
209
+ ```
210
+
211
+ and reports what needs attention. Scheduled jobs are review and report only:
212
+ never schedule `artshelf cleanup --execute` or `artshelf trash purge
213
+ --execute`.
214
+
215
+ ## 5. Verify and report
216
+
217
+ Finish by showing the user the output of:
218
+
219
+ ```bash
220
+ artshelf doctor
221
+ artshelf ledgers list --json
222
+ ```</code></pre>
223
+ <div class="callout" data-kind="note">
224
+ <span class="callout-label">Verify</span>
225
+ <p>However setup happens, finish with <code>artshelf --version</code> and <code>artshelf doctor</code>.</p>
226
+ </div>
227
+ </section>
228
+ </article>
229
+ <footer class="pager" id="pager"></footer>
230
+ </main>
231
+
232
+ <aside class="toc-col"><p class="toc-title">On this page</p><nav id="toc" aria-label="On this page"></nav></aside>
131
233
  </div>
234
+
235
+ <footer class="colophon"><div class="colophon-inner"><span>Artshelf docs</span><span>MIT</span><a href="https://github.com/calvinnwq/artshelf">GitHub</a></div></footer>
132
236
  </body>
133
237
  </html>
@@ -3,78 +3,55 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>Artshelf Quickstart</title>
7
- <meta name="description" content="The approval-first Artshelf workflows: register a temp artifact, review everything safely, approve cleanup safely, and purge old trash explicitly.">
6
+ <title>Quickstart · Artshelf</title>
7
+ <meta name="description" content="One artifact through the whole Artshelf lifecycle: register, review, dry-run, approve, verify.">
8
+ <script>(function(){var stored=null;try{stored=localStorage.getItem("artshelf-docs-theme");}catch(e){}var dark=false;try{dark=matchMedia("(prefers-color-scheme: dark)").matches;}catch(e){}document.documentElement.dataset.theme=stored||(dark?"dark":"light");})();</script>
9
+ <link rel="preconnect" href="https://fonts.googleapis.com">
10
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11
+ <link href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,450..680;1,9..144,450..680&family=Newsreader:ital,opsz,wght@0,6..72,400..650;1,6..72,400..650&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
8
12
  <link rel="stylesheet" href="site.css">
9
- <script src="theme.js" defer></script>
13
+ <script src="site.js" defer></script>
10
14
  </head>
11
- <body>
12
- <div class="docs-shell">
13
- <nav class="global-nav" aria-label="Documentation">
14
- <a class="site-mark" href="index.html"><strong>Artshelf</strong><span>Artifact retention CLI</span></a>
15
- <button class="theme-toggle" type="button" data-theme-toggle aria-label="Toggle color theme" aria-pressed="false">Dark</button>
16
- <div class="nav-scroll" aria-label="Documentation sections">
17
- <div class="nav-section">
18
- <p class="nav-section-title">Start</p>
19
- <a href="index.html">Overview</a>
20
- <a href="install.html">Install</a>
21
- <a href="quickstart.html" aria-current="page">Quickstart</a>
15
+ <body data-page="quickstart.html">
16
+ <a class="skip" href="#content">Skip to content</a>
17
+ <header class="masthead">
18
+ <div class="masthead-inner">
19
+ <button class="menu-btn" type="button" data-menu aria-label="Toggle navigation" aria-expanded="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M1 3.5h14M1 8h14M1 12.5h14" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg></button>
20
+ <a class="brand" href="index.html">Artshelf<span class="brand-tag">docs</span></a>
21
+ <button class="search-btn" type="button" data-search-open><span>Search docs</span><kbd>/</kbd></button>
22
+ <div class="masthead-tools">
23
+ <a class="gh" href="https://github.com/calvinnwq/artshelf">GitHub</a>
24
+ <button class="theme-btn" type="button" data-theme-toggle aria-label="Toggle color theme" aria-pressed="false">
25
+ <svg class="icon-moon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.6 12.1A6.5 6.5 0 0 1 7.4 2.7a6.5 6.5 0 1 0 7.2 9.4z" fill="currentColor"/></svg>
26
+ <svg class="icon-sun" viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="3.4" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="10" y1="2" x2="10" y2="4"/><line x1="10" y1="16" x2="10" y2="18"/><line x1="2" y1="10" x2="4" y2="10"/><line x1="16" y1="10" x2="18" y2="10"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="14.4" y1="14.4" x2="15.8" y2="15.8"/><line x1="4.2" y1="15.8" x2="5.6" y2="14.4"/><line x1="14.4" y1="5.6" x2="15.8" y2="4.2"/></g></svg>
27
+ </button>
22
28
  </div>
23
- <div class="nav-section">
24
- <p class="nav-section-title">Agents</p>
25
- <a href="agent-usage.html">Agent usage</a>
26
- <a href="https://github.com/calvinnwq/artshelf/blob/main/skills/artshelf/SKILL.md">Agent skill</a>
27
- </div>
28
- <div class="nav-section">
29
- <p class="nav-section-title">Reference</p>
30
- <a href="reference.html">CLI reference</a>
31
- <a href="https://github.com/calvinnwq/artshelf">GitHub</a>
32
- </div>
33
- </div>
34
- </nav>
29
+ </div>
30
+ </header>
35
31
 
36
- <div class="docs-content">
37
- <header class="page-top">
38
- <div class="wrap">
39
- <nav class="breadcrumbs" aria-label="Breadcrumbs"><a href="index.html">Docs</a><span>/</span><span>Quickstart</span></nav>
40
- <div class="hero">
41
- <div>
42
- <p class="eyebrow">Approval-first workflows</p>
43
- <h1>Register, review, approve — safely.</h1>
44
- <p class="lede">
45
- Artshelf centers on four workflows: register a temp artifact when it is created,
46
- review everything safely before anything moves, approve cleanup safely from a
47
- reviewed plan, and purge old trash only from a separate reviewed plan. Start with
48
- explicit ledger and registry paths when testing.
49
- </p>
50
- </div>
51
- <div class="terminal">
52
- <div class="terminal-head"><span class="dot"></span><span class="dot"></span><span class="dot"></span><span>quickstart</span></div>
53
- <pre><code>$ mkdir -p /tmp/artshelf-demo
54
- $ echo "debug output" &gt; /tmp/artshelf-demo/output.txt
55
- $ artshelf put /tmp/artshelf-demo \
56
- --reason "quickstart artifact" \
57
- --ttl 1d \
58
- --kind scratch \
59
- --cleanup trash \
60
- --ledger /tmp/artshelf-ledger.jsonl \
61
- --registry /tmp/artshelf-registry.json</code></pre>
62
- </div>
63
- </div>
64
- </div>
65
- </header>
32
+ <div class="frame">
33
+ <nav id="sidebar" class="sidebar" aria-label="Documentation"></nav>
66
34
 
67
- <main class="wrap">
68
- <article>
69
- <section>
70
- <h2>1. Register a temp artifact</h2>
71
- <p>Create something worth tracking, then put it on the artshelf the moment it exists:</p>
72
- <pre><code>mkdir -p /tmp/artshelf-demo
35
+ <main id="content" class="article-col">
36
+ <article>
37
+ <p class="kicker"><span class="n">03</span>Start · Quickstart</p>
38
+ <h1>Put one artifact on the shelf.</h1>
39
+ <p class="lede">
40
+ The whole loop in five minutes, using throwaway paths under <code>/tmp</code>.
41
+ You will register one artifact, review it, dry-run the cleanup, execute the
42
+ approved plan, and verify. Trash gets purged separately at the end.
43
+ </p>
44
+
45
+ <section>
46
+ <h2>1. Create something temporary</h2>
47
+ <pre><code><span class="c"># make a scratch artifact to practice on</span>
48
+ mkdir -p /tmp/artshelf-demo
73
49
  echo "debug output" &gt; /tmp/artshelf-demo/output.txt
74
50
 
51
+ <span class="c"># put it on the shelf: make this demo immediately due, then trash on approval</span>
75
52
  artshelf put /tmp/artshelf-demo \
76
53
  --reason "quickstart artifact" \
77
- --ttl 1d \
54
+ --ttl 0m \
78
55
  --kind scratch \
79
56
  --cleanup trash \
80
57
  --owner manual \
@@ -82,61 +59,83 @@ artshelf put /tmp/artshelf-demo \
82
59
  --ledger /tmp/artshelf-ledger.jsonl \
83
60
  --registry /tmp/artshelf-registry.json \
84
61
  --json</code></pre>
85
- <p>Capture the returned `id` anywhere future cleanup context matters.</p>
86
- </section>
62
+ <p>Note the <code>id</code> the command returns. You will quote it in handoffs and cleanup reports.</p>
63
+ </section>
87
64
 
88
- <section>
89
- <h2>2. Review everything safely</h2>
90
- <p>Inspect the ledger and preview cleanup. None of these commands move or delete files.</p>
91
- <pre><code>artshelf list --ledger /tmp/artshelf-ledger.jsonl
65
+ <section>
66
+ <h2>2. Review without moving files</h2>
67
+ <div class="callout" data-kind="readonly">
68
+ <span class="callout-label">Non-destructive</span>
69
+ <p>These commands are safe for agents and cron jobs. They never move artifacts or trash entries; cleanup <code>--dry-run</code> may register a review plan.</p>
70
+ </div>
71
+ <pre><code><span class="c"># everything on the shelf</span>
72
+ artshelf list --ledger /tmp/artshelf-ledger.jsonl
73
+
74
+ <span class="c"># quick counts: active, due, trashed</span>
92
75
  artshelf status --ledger /tmp/artshelf-ledger.jsonl
76
+
77
+ <span class="c"># check the ledger file itself is healthy</span>
93
78
  artshelf validate --ledger /tmp/artshelf-ledger.jsonl --json
79
+
80
+ <span class="c"># which records are due, kept, or missing</span>
94
81
  artshelf due --ledger /tmp/artshelf-ledger.jsonl --json
82
+
83
+ <span class="c"># preview cleanup and get a plan id (still moves nothing)</span>
95
84
  artshelf cleanup --dry-run --ledger /tmp/artshelf-ledger.jsonl --json</code></pre>
96
- <p>
97
- Dry-run writes a plan under the ledger's `.artshelf` directory only when
98
- cleanup entries exist. If there is nothing to clean up, it reports
99
- <code>not-created</code> and writes no plan file. Review any generated
100
- plan id before an execute step.
101
- </p>
102
- </section>
85
+ <p>
86
+ This demo uses <code>--ttl 0m</code>, so the dry-run writes a plan and prints
87
+ the <code>planId</code> a human can approve. When nothing is ready, the
88
+ dry-run reports <code>not-created</code>.
89
+ </p>
90
+ </section>
103
91
 
104
- <section>
105
- <h2>3. Approve cleanup safely</h2>
106
- <pre><code>artshelf cleanup --execute \
92
+ <section>
93
+ <h2>3. Execute only an approved plan</h2>
94
+ <p>Copy the <code>planId</code> from the dry-run output in step 2.</p>
95
+ <pre><code><span class="c"># run only the plan that was reviewed</span>
96
+ artshelf cleanup --execute \
107
97
  --plan-id plan_20260601_120000_ab12 \
108
98
  --ledger /tmp/artshelf-ledger.jsonl</code></pre>
109
- <div class="note">
110
- Execute is intentionally separate. Agents must not run it unless a human explicitly
111
- approves the reviewed plan id and ledger that produced it. After execution, Artshelf writes
112
- a receipt and updates touched records so handled artifacts stop appearing in future due checks.
113
- Artshelf also records generated plans and receipts in the ledger as Artshelf-owned
114
- artifacts.
115
- </div>
116
- </section>
117
-
118
- <section>
119
- <h2>4. Purge old trashed records explicitly</h2>
99
+ <div class="callout" data-kind="boundary">
100
+ <span class="callout-label">Hard boundary</span>
120
101
  <p>
121
- After cleanup execution, trashed files are quarantined under the ledger's
122
- <code>.artshelf/trash</code> folder. Before physical deletion, run an explicit
123
- reviewed trash purge plan:
102
+ Execute is intentionally separate. Approval names the exact ledger path and
103
+ reviewed plan id. No global execute path exists.
124
104
  </p>
125
- <pre><code>artshelf trash list --ledger /tmp/artshelf-ledger.jsonl
126
- artshelf trash purge --older-than 7d --dry-run --ledger /tmp/artshelf-ledger.jsonl --json</code></pre>
127
- <p>
128
- A fresh quickstart record will usually be newer than the <code>7d</code>
129
- purge cutoff and report <code>not-created</code>; for real old trash, execute
130
- only if the dry-run produced entries and the plan id was explicitly reviewed:
131
- </p>
132
- <pre><code>artshelf trash purge --execute \
105
+ </div>
106
+ </section>
107
+
108
+ <section>
109
+ <h2>4. Verify quiet</h2>
110
+ <p>After cleanup, run another read-only review.</p>
111
+ <pre><code><span class="c"># confirm nothing still needs attention</span>
112
+ artshelf review --ledger /tmp/artshelf-ledger.jsonl --json
113
+
114
+ <span class="c"># see what cleanup moved into trash</span>
115
+ artshelf trash list --ledger /tmp/artshelf-ledger.jsonl --json</code></pre>
116
+ </section>
117
+
118
+ <section>
119
+ <h2>5. Purge trash separately</h2>
120
+ <p>
121
+ Cleanup with <code>cleanup=trash</code> moves files into Artshelf trash.
122
+ Physical deletion needs a separate reviewed purge plan.
123
+ </p>
124
+ <pre><code><span class="c"># preview which trashed files are old enough to purge</span>
125
+ artshelf trash purge --older-than 0m --dry-run --ledger /tmp/artshelf-ledger.jsonl --json</code></pre>
126
+ <p>Then execute with the purge <code>planId</code> the dry-run reported.</p>
127
+ <pre><code><span class="c"># delete for real, but only with the reviewed purge plan id</span>
128
+ artshelf trash purge --execute \
133
129
  --plan-id purge_20260601_120000_ab12 \
134
130
  --ledger /tmp/artshelf-ledger.jsonl</code></pre>
135
- </section>
136
- </article>
137
- </main>
138
- <footer class="site-footer"><div class="wrap">Artshelf docs · <a href="agent-usage.html">Next: agent usage</a></div></footer>
139
- </div>
131
+ </section>
132
+ </article>
133
+ <footer class="pager" id="pager"></footer>
134
+ </main>
135
+
136
+ <aside class="toc-col"><p class="toc-title">On this page</p><nav id="toc" aria-label="On this page"></nav></aside>
140
137
  </div>
138
+
139
+ <footer class="colophon"><div class="colophon-inner"><span>Artshelf docs</span><span>MIT</span><a href="https://github.com/calvinnwq/artshelf">GitHub</a></div></footer>
141
140
  </body>
142
141
  </html>