@paxnax/berliner 0.0.0-stage → 0.2.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/README.md +119 -2
- package/dist/agents/claude.js +61 -0
- package/dist/agents/codex.js +43 -0
- package/dist/agents/index.js +35 -0
- package/dist/agents/opencode.js +27 -0
- package/dist/agents/read.js +37 -0
- package/dist/agents/types.js +1 -0
- package/dist/args.js +45 -0
- package/dist/client.js +65 -0
- package/dist/commands/body.js +144 -0
- package/dist/commands/delete.js +35 -0
- package/dist/commands/hook.js +228 -0
- package/dist/commands/query.js +25 -0
- package/dist/commands/report.js +65 -0
- package/dist/commands/session.js +33 -0
- package/dist/commands/sessions.js +17 -0
- package/dist/commands/setup.js +174 -0
- package/dist/commands/skill.js +5 -0
- package/dist/commands/summary.js +25 -0
- package/dist/commands/update.js +21 -0
- package/dist/config.js +33 -0
- package/dist/git.js +42 -0
- package/dist/index.js +71 -0
- package/dist/output.js +28 -0
- package/dist/prices.js +98 -0
- package/dist/setup/connect.js +42 -0
- package/dist/setup/hooks.js +84 -0
- package/dist/setup/targets.js +41 -0
- package/dist/upload.js +94 -0
- package/opencode/berliner.js +124 -0
- package/package.json +28 -4
- package/skill/SKILL.md +103 -0
package/skill/SKILL.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: berliner
|
|
3
|
+
description: Use when you commit, open or update a pull request, or finish a task, and whenever the user asks you to report to Berliner. Reports the task, pull requests, test coverage and screenshots or videos with the berliner CLI.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Reporting to Berliner
|
|
7
|
+
|
|
8
|
+
Berliner records what an autonomous session cost and produced. You report with one command, `berliner report`.
|
|
9
|
+
|
|
10
|
+
## When to report
|
|
11
|
+
|
|
12
|
+
- Before your final message, whenever you committed, opened or updated a pull request, or finished a task.
|
|
13
|
+
- Again whenever a PR changes (opened, merged, CI finishes) or you add evidence.
|
|
14
|
+
- Right away when the user asks you to report to Berliner.
|
|
15
|
+
|
|
16
|
+
Reporting again is safe. The new values replace the old ones, PR URLs are added to the list, and evidence already uploaded is skipped. It never double-counts.
|
|
17
|
+
|
|
18
|
+
## Inside Claude Code, Codex or OpenCode
|
|
19
|
+
|
|
20
|
+
Hooks installed by `berliner setup` already report the session's cost, model, repository and commits after every reply. Send only what you know and the hooks don't:
|
|
21
|
+
|
|
22
|
+
| Flag | What to send |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `--title` | A short line naming the task. |
|
|
25
|
+
| `--task`, `--task-url` | The ticket ID and its URL, if there is one. |
|
|
26
|
+
| `--pr` | Every pull request, one flag each. |
|
|
27
|
+
| `--coverage` | Percent, from the test run's coverage summary. |
|
|
28
|
+
| `--evidence` | Each screenshot or video. |
|
|
29
|
+
|
|
30
|
+
Do not pass `--session-id`, `--cost` or `--model`: the CLI fills them in from the tool's own records, and an explicit value is ignored with a warning. `--repo` and `--plan` are not needed either: the plan comes from the user's `BERLINER_PLAN`, or from their subscriptions in Settings. A report without `--title` keeps the session's existing title. `berliner update` ignores a session ID here.
|
|
31
|
+
|
|
32
|
+
## Outside those tools
|
|
33
|
+
|
|
34
|
+
Without a hook, `report` needs these flags:
|
|
35
|
+
|
|
36
|
+
| Flag | Source |
|
|
37
|
+
|---|---|
|
|
38
|
+
| `--session-id` | Your harness's session ID if it exposes one, otherwise generate a UUID at the start of the session and reuse it for every report. |
|
|
39
|
+
| `--title` | One short line describing the work. |
|
|
40
|
+
| `--repo` | `owner/name`, from `git remote get-url origin`. |
|
|
41
|
+
| `--cost` | Estimated USD. Your harness's reported session cost if it shows one, otherwise estimate from token usage at the model's API prices. |
|
|
42
|
+
| `--model` | The primary model ID you ran on. |
|
|
43
|
+
| `--plan` | Your best guess at the plan you run on. Claude: `free`, `pro`, `max_x5`, `max_x20`, `team`, `enterprise`. OpenAI (Codex): `free`, `go`, `plus`, `pro`, `pro_more`, `pro_max`, `business`, `business_premium`. Billed per token: `api`. Always pass it: when the user has set `BERLINER_PLAN`, that value replaces yours. |
|
|
44
|
+
|
|
45
|
+
Report again with the same `--session-id` whenever something changes.
|
|
46
|
+
|
|
47
|
+
## Optional values
|
|
48
|
+
|
|
49
|
+
- `--commits <n>` (outside the tools; the hooks count them): `git rev-list --count <base>..HEAD`
|
|
50
|
+
- `--coverage <percent>`: from the test run's coverage summary.
|
|
51
|
+
- `--pr <url>[,merge=<open|merged|closed>][,ci=<pending|running|passed|failed|none>]`: repeat per PR. URL from `gh pr view --json url`.
|
|
52
|
+
- `--evidence <path>[::caption]`: repeat per screenshot or video.
|
|
53
|
+
- `--task <id>`, `--task-url <url>`, `--project <name>`, `--started-at <ISO>`, `--ended-at <ISO>`.
|
|
54
|
+
|
|
55
|
+
Quote any value that contains spaces.
|
|
56
|
+
|
|
57
|
+
## Environment
|
|
58
|
+
|
|
59
|
+
`berliner setup` stores the API token in a config file, so `BERLINER_TOKEN` is only needed to override it (a token from the Settings page at https://berliner.app). `BERLINER_URL` overrides the server address. `BERLINER_PLAN`, when the user sets it, replaces any `--plan`.
|
|
60
|
+
|
|
61
|
+
If the `berliner` command is not found, ask the user to run `npx @paxnax/berliner@latest setup`. Do not try to install it yourself.
|
|
62
|
+
|
|
63
|
+
## Timeouts
|
|
64
|
+
|
|
65
|
+
The session is saved first, then evidence is uploaded. Allow at least 10 minutes for the command when attaching videos.
|
|
66
|
+
|
|
67
|
+
## Reading the output
|
|
68
|
+
|
|
69
|
+
- Success prints what was saved, then an evidence line such as `Evidence: 1 uploaded, 0 already uploaded, 0 skipped.`
|
|
70
|
+
- A line starting `berliner:` on stderr is a warning: the report may be incomplete (server unreachable, a file skipped). The command still exits 0, so it never fails your work (`--strict` makes failures exit 1). Re-run the same command; it is safe to repeat.
|
|
71
|
+
- `--json` prints the saved session as JSON, plus an `evidence` field with `uploaded`, `existing` and `skipped` results when `--evidence` was given.
|
|
72
|
+
- To change a field later without resending everything, use `berliner update --commits 5` inside the tools, or `berliner update <session-id> --commits 5` outside them.
|
|
73
|
+
|
|
74
|
+
## Examples
|
|
75
|
+
|
|
76
|
+
Inside Claude Code, Codex or OpenCode:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
berliner report \
|
|
80
|
+
--title "Fix recurring event off-by-one" \
|
|
81
|
+
--task TEC-5521 \
|
|
82
|
+
--task-url https://linear.app/octo/issue/TEC-5521 \
|
|
83
|
+
--coverage 87.5 \
|
|
84
|
+
--pr "https://github.com/octo/app/pull/42,ci=running" \
|
|
85
|
+
--evidence "./shots/after.png::Calendar after the fix"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Anywhere else:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
berliner report \
|
|
92
|
+
--session-id 3f1c2a9e-7b64-4d0a-9a51-2c8f0e6d1b77 \
|
|
93
|
+
--title "Fix recurring event off-by-one" \
|
|
94
|
+
--repo octo/app \
|
|
95
|
+
--cost 4.20 \
|
|
96
|
+
--model claude-opus-5-5 \
|
|
97
|
+
--plan max_x20 \
|
|
98
|
+
--task TEC-5521 \
|
|
99
|
+
--commits 3 \
|
|
100
|
+
--coverage 87.5 \
|
|
101
|
+
--pr "https://github.com/octo/app/pull/42,ci=running" \
|
|
102
|
+
--evidence "./shots/after.png::Calendar after the fix"
|
|
103
|
+
```
|