unsnag pimlico 1.2.0 · 7bff655a7e58 dirty
· 32m 29s mock
known gaps of mock: usage and key activity have no 1-2 hour aggregation lag; month-to-date metered units behind balance are fixed values; no rate limiting
runs / balance-alert-script/codex-openai-gpt-6.1-sol/skill/2 · ← prev next →

balance-alert-script/codex-openai-gpt-6.1-sol/skill/2 · pass

Outcome
pass
1/1 Checks passed
Turns
4
model turns
CLI calls
1
0 exited non-zero
Help lookups
1
reads of the CLI's help
Tokens in
53495
39409 of them cached
Tokens out
386
written by the model
Cost
$0.04
of the model calls
Wall time
12.7s
from start to the Checks
scenario
balance-alert-script
agent
codex:openai/gpt-6.1-sol · 0.167.2
context
skill
repeat
2 · cell ✓✓✓✓✓
findings
—
provider
openai

checks

#checkresultdetailsignal
1
cd /work && test -f check-balance.sh
timeout 60 bash check-balance.sh > /dev/null 2>&1; high=$?
PIMLICO_DASHBOARD_URL="${PIMLICO_DASHBOARD_URL%:8080}:8081" timeout 60 bash check-balance.sh > /dev/null 2>&1; low=$?
echo "exit $high with ~\$1,290 remaining, $low with ~\$50"
test "$high" -eq 0 && test "$low" -ne 0
passexited 0
exit 0 with ~$1,290 remaining, 2 with ~$50

reproduce

unsnag run --scenario balance-alert-script --agent codex:openai/gpt-6.1-sol --context skill --runs 1

Transcript highlighted = a Signal fired

#actorcontentexitsignal
0user
You have the `pimlico` CLI available.

Write a script, check-balance.sh, for our CI that exits non-zero when our remaining Pimlico balance is under $100, and zero otherwise.
1agent
I’ll use the pimlico skill to check the CLI’s balance output, then write and verify `check-balance.sh`.
$ cat /work/.agents/skills/pimlico/SKILL.md
---
name: pimlico
description: Use the `pimlico` CLI to inspect and manage a Pimlico account (ERC-4337 bundler and paymaster) — balance, invoices, usage, API keys, sponsorship policies, and the logs of user operations and RPC requests. Use whenever a task mentions Pimlico, its API keys or policies, or debugging user operations sent through Pimlico.
---

# The `pimlico` CLI

`pimlico` reads and changes the Pimlico account the user is logged in to. Every
command takes `--json`, which prints one JSON object (errors too, as
`{"error": {...}}` on stdout). Prefer `--json` when you parse output.

Exit codes: `0` ok, `1` error, `2` a threshold was breached (`balance --below`),
`3` not logged in, `75` the API is unavailable or rate-limited. On exit 3, run
`pimlico login --no-wait --json`, show the user the `url` and `code`, then call
`pimlico login --wait --json` in the same turn until `status` is not `pending`.

## Commands

| Task | Command |
| --- | --- |
| Who am I logged in as | `pimlico whoami` |
| Credits, open invoices, runway | `pimlico balance` (`--below <usd>` exits 2 under it) |
| Invoices | `pimlico invoices` (`--open` for unpaid only) |
| Traffic and spend | `pimlico usage --last 24h\|7d\|30d --group chain\|key\|day [--key <name>]` |
| One user operation | `pimlico op <userOpHash> [--chain <id>]` |
| User operation logs | `pimlico ops [--key <name>] [--chain <id>] [--status <status>] [--last 24h\|7d\|30d]` |
| RPC request logs | `pimlico requests [--key <name>] [--method <rpc method>] [--status success\|error] [--bodies]` |
| Supported chains | `pimlico chains [--mainnet\|--testnet]` (no login needed) |
| ERC-20 paymaster tokens | `pimlico erc20 tokens [--chain <id>]` |
| API keys | `pimlico keys list [--all]`, `keys get <name>`, `keys create --name <n>`, `keys rename <name> --to <n>`, `keys disable <name>` |
| Sponsorship policies | `pimlico policies list`, `policies get <sp_id>`, `policies create --name <n> …`, `policies update <sp_id> …`, `policies enable\|d
[… 1373 more characters]
$ pwd; rg --files -g AGENTS.md -g '*balance*' -g 'README*' -g 'package.json' -g '.git' /work
/work
err
2agent
$ pimlico balance --help
Usage: pimlico balance [options]

Account balance broken down into credits, open invoices and unbilled usage, and
remaining headroom

Options:
  --below <usd>      Exit 2 when the remaining balance is under this
  --watch [seconds]  Refresh every N seconds (min 10, default 30)
  -h, --help         display help for command
$ ls -la /work; for f in /AGENTS.md /work/AGENTS.md; do if [ -f "$f" ]; then cat "$f"; fi; done
total 16
drwxr-xr-x 1 agent agent 4096 Nov 16 23:15 .
drwxr-xr-x 1 root  root  4096 Nov 16 23:15 ..
drwxrwxrwx 3 agent agent 4096 Nov 16 23:15 .agents
drwxrwxrwx 8 agent agent 4096 Nov 16 23:15 .git
3agent
[apply_patch] {"/work/check-balance.sh":{"type":"add","content":"#!/usr/bin/env bash\n# Exit 2 below $100, 0 otherwise; propagate CLI errors to CI.\nexec pimlico balance --below 100\n"}}
Success. Updated the following files:
A /work/check-balance.sh
$ chmod +x /work/check-balance.sh bash -n /work/check-balance.sh git diff --no-index -- /dev/null /work/check-balance.sh
diff --git a/work/check-balance.sh b/work/check-balance.sh
new file mode 100755
index 0000000..9bafb41
--- /dev/null
+++ b/work/check-balance.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+# Exit 2 below $100, 0 otherwise; propagate CLI errors to CI.
+exec pimlico balance --below 100
err
4agent
Created executable [check-balance.sh](/work/check-balance.sh).

Uses `pimlico balance --below 100`: exits `2` below $100, `0` otherwise, and propagates CLI errors to CI. Bash syntax check passed.

Target CLI calls

#callexitmssignal
0
$ pimlico balance --help
Usage: pimlico balance [options]

Account balance broken down into credits, open invoices and unbilled usage, and
remaining headroom

Options:
  --below <usd>      Exit 2 when the remaining balance is under this
  --watch [seconds]  Refresh every N seconds (min 10, default 30)
  -h, --help         display help for command
0141

Final state

outcome
pass
final answer
Created executable [check-balance.sh](/work/check-balance.sh).

Uses `pimlico balance --below 100`: exits `2` below $100, `0` otherwise, and propagates CLI errors to CI. Bash syntax check passed.
teardown
—
mock gaps
—
contamination
—
dns lookups
0 (0 denied)
web tools
web_search (provider)

context inputs

kindsourceplaced atofferedused
skillskills/pimlico.agents/skills/pimlicotruetrue

prompt

You have the `pimlico` CLI available.

Write a script, check-balance.sh, for our CI that exits non-zero when our remaining Pimlico balance is under $100, and zero otherwise.

Artifacts

run.json · agent-stdout.jsonl · rollout.jsonl · service-mock.log