Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": false,
"trailingComma": "es5",
"printWidth": 80,
"tabWidth": 2
}
7 changes: 7 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Code Conventions

## Linting & Formatting

- ESLint: `npm run lint` (includes `tsc --noEmit` + ESLint), `npm run lint:fix` to auto-fix
- Prettier: `npm run format` to write, `npm run format:check` to verify
- Config: `eslint.config.js` (flat config), `.prettierrc`
- Unused variables must be prefixed with `_`

## JavaScript/TypeScript style

- Use `Number.parseInt()` instead of global `parseInt()`
Expand Down
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,31 @@ crucible inspect my-queue --seq 12345
crucible search my-queue --body "OrderId:123"
crucible search my-queue --property "CorrelationId=abc"

# Dead-letter management
# Dead-letter management (queues)
crucible deadletter my-queue --reasons
crucible replay my-queue --dry-run
crucible replay my-queue --count 10 --backup before-replay.json
crucible purge my-queue --dlq

# Dead-letter management (topic subscriptions)
crucible deadletter my-topic/my-sub --reasons
crucible replay my-topic/my-sub --dry-run
crucible purge my-topic/my-sub --dlq

# Send messages
crucible send my-queue --body '{"orderId": 123}'
crucible send my-topic/my-sub --body '{"event": "retry"}'
crucible send my-queue --file payload.json --count 100 --delay 50

# Export / Import
crucible export my-queue --dlq --format json > dlq-messages.json
crucible export my-topic/my-sub --dlq --format json > dlq-messages.json
crucible export my-queue --format csv > messages.csv
crucible import my-queue --file dlq-messages.json

# Namespace topology
crucible topology # tree view
crucible topology --rules # include filter expressions
crucible topology --format mermaid > topology.md

# Snapshot & drift detection
Expand All @@ -85,6 +93,17 @@ crucible watch my-queue --dlq-threshold 10 --notify
crucible watch my-queue --dlq-threshold 100 --exec 'curl -X POST https://hooks.slack.com/... -d "{\"text\":\"DLQ alert: $CRUCIBLE_ENTITY has $CRUCIBLE_DLQ messages\"}"'
```

## Entity Format

Most commands accept an `<entity>` argument. Use the queue name for queues, or `topic/subscription` for topic subscriptions:

| Format | Target |
|---|---|
| `my-queue` | Queue named `my-queue` |
| `my-topic/my-sub` | Subscription `my-sub` on topic `my-topic` |

For example, `crucible deadletter my-queue` targets a queue's DLQ, while `crucible deadletter my-topic/my-sub` targets the subscription's DLQ.

## Commands

### Foundation
Expand Down Expand Up @@ -112,7 +131,7 @@ crucible watch my-queue --dlq-threshold 100 --exec 'curl -X POST https://hooks.s
| `crucible watch` | Local DLQ alerts — `--dlq-threshold`, `--exec`, `--notify` |
| `crucible export` | Export messages as JSON or CSV (pipe-friendly) |
| `crucible import` | Bulk send from JSON file |
| `crucible topology` | Namespace tree — `--format tree\|json\|mermaid` |
| `crucible topology` | Namespace tree — `--format tree\|json\|mermaid`, `--rules` to show filter expressions |

### Power Features
| Command | Description |
Expand Down
20 changes: 20 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import prettierConfig from "eslint-config-prettier";

export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
prettierConfig,
{
ignores: ["dist/", "node_modules/"],
},
{
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_" },
],
},
}
);
Loading
Loading