@secondlayer/cli 14.2.1 → 14.3.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 (27) hide show
  1. package/README.md +30 -16
  2. package/dist/cli.js +2961 -2798
  3. package/dist/cli.js.map +22 -21
  4. package/package.json +5 -5
  5. package/templates/{subscriptions → webhooks}/cloudflare/README.md +2 -2
  6. package/templates/{subscriptions → webhooks}/node/README.md +2 -2
  7. package/templates/{subscriptions → webhooks}/node/src/index.ts +2 -2
  8. package/templates/{subscriptions → webhooks}/trigger/README.md +2 -2
  9. /package/templates/{subscriptions → webhooks}/cloudflare/.env.example +0 -0
  10. /package/templates/{subscriptions → webhooks}/cloudflare/package.json +0 -0
  11. /package/templates/{subscriptions → webhooks}/cloudflare/src/index.ts +0 -0
  12. /package/templates/{subscriptions → webhooks}/cloudflare/tsconfig.json +0 -0
  13. /package/templates/{subscriptions → webhooks}/cloudflare/wrangler.toml +0 -0
  14. /package/templates/{subscriptions → webhooks}/inngest/.env.example +0 -0
  15. /package/templates/{subscriptions → webhooks}/inngest/README.md +0 -0
  16. /package/templates/{subscriptions → webhooks}/inngest/package.json +0 -0
  17. /package/templates/{subscriptions → webhooks}/inngest/src/inngest.ts +0 -0
  18. /package/templates/{subscriptions → webhooks}/inngest/src/server.ts +0 -0
  19. /package/templates/{subscriptions → webhooks}/inngest/tsconfig.json +0 -0
  20. /package/templates/{subscriptions → webhooks}/node/.env.example +0 -0
  21. /package/templates/{subscriptions → webhooks}/node/package.json +0 -0
  22. /package/templates/{subscriptions → webhooks}/node/tsconfig.json +0 -0
  23. /package/templates/{subscriptions → webhooks}/trigger/.env.example +0 -0
  24. /package/templates/{subscriptions → webhooks}/trigger/package.json +0 -0
  25. /package/templates/{subscriptions → webhooks}/trigger/src/tasks/subgraph-event.ts +0 -0
  26. /package/templates/{subscriptions → webhooks}/trigger/trigger.config.ts +0 -0
  27. /package/templates/{subscriptions → webhooks}/trigger/tsconfig.json +0 -0
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @secondlayer/cli
2
2
 
3
3
  The Secondlayer CLI — one binary for Stacks indexing, real-time subgraphs,
4
- subscriptions, and Clarity code generation.
4
+ webhooks, and Clarity code generation.
5
5
 
6
6
  ```bash
7
7
  bun add -g @secondlayer/cli
@@ -57,6 +57,20 @@ secondlayer setup --yes \
57
57
  `secondlayer subgraphs scaffold` writes the definition file, creates/updates
58
58
  `package.json`, and runs `bun install` (pass `--no-install` to skip).
59
59
 
60
+ ## Archive
61
+
62
+ `secondlayer archive` groups the history-plane verbs. `archive bootstrap`,
63
+ `archive verify`, and `archive repair` are the same commands as the top-level
64
+ `bootstrap` / `verify` / `repair` (golden-path aliases stay). `archive latest`
65
+ shows the official tip; `archive quote --against <manifest>` prices a fetch
66
+ without charging.
67
+
68
+ ```bash
69
+ secondlayer archive latest
70
+ secondlayer archive quote --against https://archive.secondlayer.tools/latest.json
71
+ secondlayer archive bootstrap --against https://archive.secondlayer.tools/latest.json
72
+ ```
73
+
60
74
  ## Commands
61
75
 
62
76
  ### Local runtime
@@ -138,29 +152,29 @@ points at.
138
152
 
139
153
  Reads emit JSON to stdout (`--json` accepted across all read commands); `-o/--output` is a file path, not a format.
140
154
 
141
- ### Subscriptions
155
+ ### Webhooks
142
156
 
143
157
  | Command | What it does |
144
158
  |---|---|
145
- | `secondlayer subscriptions create <name> --subgraph <name> --table <name> [--runtime <inngest\|trigger\|cloudflare\|node>] [--url <url>]` | Subgraph subscription (optional local receiver scaffold). Runtime defaults to `node` once any of `-s/-t/-u` or `--no-scaffold` is given; the menu only appears in a terminal with no flags |
146
- | `secondlayer subscriptions create <name> --url <url> --trigger '<json>'` | Chain subscription (repeat `--trigger` or pass `--triggers-file`) |
147
- | `secondlayer subscriptions list` / `get <id\|name>` | List or show config + delivery state |
148
- | `secondlayer subscriptions update <id\|name> --url <url> [--filter key.gte=value]` | Patch URL, filter, format, retry, etc. |
149
- | `secondlayer subscriptions pause/resume <id\|name>` | Stop or restart delivery |
150
- | `secondlayer subscriptions rotate-secret <id\|name>` | Rotate signing secret (printed once) |
151
- | `secondlayer subscriptions deliveries/dead <id\|name>` | Recent attempts / dead-letter rows |
152
- | `secondlayer subscriptions requeue <id\|name> <outboxId>` | Requeue one dead-letter row |
153
- | `secondlayer subscriptions replay <id\|name> --from-block <n> --to-block <n>` | Enqueue a historical block range |
154
- | `secondlayer subscriptions doctor/test <id\|name>` | Health check / signed fixture |
159
+ | `secondlayer webhooks create <name> --subgraph <name> --table <name> [--runtime <inngest\|trigger\|cloudflare\|node>] [--url <url>]` | Subgraph webhook (optional local receiver scaffold). Runtime defaults to `node` once any of `-s/-t/-u` or `--no-scaffold` is given; the menu only appears in a terminal with no flags |
160
+ | `secondlayer webhooks create <name> --url <url> --trigger '<json>'` | Chain webhook (repeat `--trigger` or pass `--triggers-file`) |
161
+ | `secondlayer webhooks list` / `get <id\|name>` | List or show config + delivery state |
162
+ | `secondlayer webhooks update <id\|name> --url <url> [--filter key.gte=value]` | Patch URL, filter, format, retry, etc. |
163
+ | `secondlayer webhooks pause/resume <id\|name>` | Stop or restart delivery |
164
+ | `secondlayer webhooks rotate-secret <id\|name>` | Rotate signing secret (printed once) |
165
+ | `secondlayer webhooks deliveries/dead <id\|name>` | Recent attempts / dead-letter rows |
166
+ | `secondlayer webhooks requeue <id\|name> <outboxId>` | Requeue one dead-letter row |
167
+ | `secondlayer webhooks replay <id\|name> --from-block <n> --to-block <n>` | Enqueue a historical block range |
168
+ | `secondlayer webhooks doctor/test <id\|name>` | Health check / signed fixture |
155
169
 
156
170
  Read/action commands support `--json`. Destructive commands prompt unless
157
171
  `-y` / `--yes`, default to no, and exit 1 when stdin is not a TTY. Filters are schema-aware: unknown tables/columns, bad operators,
158
172
  and non-scalar columns are rejected before the API call.
159
173
 
160
- Subscriptions are **subgraph** (a table's rows) or **chain** (raw events, no
161
- subgraph). `secondlayer subscriptions create` with `--subgraph`/`--table` makes the
174
+ Webhooks are **subgraph** (a table's rows) or **chain** (raw events, no
175
+ subgraph). `secondlayer webhooks create` with `--subgraph`/`--table` makes the
162
176
  first. Pass `--trigger` or `--triggers-file` for the second. SDK, REST, and
163
- MCP take the same `triggers` array. Every other `secondlayer subscriptions` command
177
+ MCP take the same `triggers` array. Every other `secondlayer webhooks` command
164
178
  operates on both kinds.
165
179
 
166
180
  ### Other
@@ -168,7 +182,7 @@ operates on both kinds.
168
182
  | Command | What it does |
169
183
  |---|---|
170
184
  | `secondlayer codegen contracts [files...]` | Generate TS interfaces from Clarity contracts |
171
- | `secondlayer context` | Instance snapshot — Streams + Index tips, subgraphs, subscriptions |
185
+ | `secondlayer context` | Instance snapshot — Streams + Index tips, subgraphs, webhooks |
172
186
  | `secondlayer doctor` / `secondlayer status` | Reachability + health checks |
173
187
  | `secondlayer config get/set/reset/delete` | Inspect or reset local config |
174
188