@zibby/cli 0.5.8 → 0.6.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/dist/bin/zibby.js +3 -3
- package/dist/commands/app-run.js +19 -0
- package/dist/commands/app-solo.js +19 -0
- package/dist/commands/app.js +22 -20
- package/dist/commands/init.js +100 -95
- package/dist/commands/workflows/generate.js +156 -151
- package/dist/config/soloTiers.js +1 -0
- package/dist/config/warmPool.js +1 -0
- package/dist/lib/api-client.js +17 -0
- package/dist/lib/find-app-link.js +2 -0
- package/dist/lib/framework-commands.js +1 -0
- package/dist/package.json +2 -2
- package/dist/templates/.claude/CLAUDE.md +318 -10
- package/dist/templates/.claude/agents/zibby-test-author.md +87 -0
- package/dist/templates/.claude/agents/zibby-workflow-builder.md +101 -0
- package/dist/templates/.claude/commands/{add-node.md → zibby-add-node.md} +1 -1
- package/dist/templates/.claude/commands/{add-skill.md → zibby-add-skill.md} +1 -1
- package/dist/templates/.claude/commands/zibby-app-destroy.md +60 -0
- package/dist/templates/.claude/commands/zibby-app-list.md +80 -0
- package/dist/templates/.claude/commands/zibby-app-logs.md +60 -0
- package/dist/templates/.claude/commands/zibby-app-status.md +53 -0
- package/dist/templates/.claude/commands/zibby-app-upgrade.md +67 -0
- package/dist/templates/.claude/commands/zibby-debug.md +67 -0
- package/dist/templates/.claude/commands/zibby-delete.md +37 -0
- package/dist/templates/.claude/commands/zibby-deploy-app.md +92 -0
- package/dist/templates/.claude/commands/zibby-deploy.md +87 -0
- package/dist/templates/.claude/commands/zibby-list.md +30 -0
- package/dist/templates/.claude/commands/zibby-login.md +68 -0
- package/dist/templates/.claude/commands/zibby-mcp-install.md +93 -0
- package/dist/templates/.claude/commands/zibby-memory-cost.md +39 -0
- package/dist/templates/.claude/commands/zibby-memory-pull.md +47 -0
- package/dist/templates/.claude/commands/zibby-memory-remote-use-hosted.md +61 -0
- package/dist/templates/.claude/commands/zibby-memory-stats.md +38 -0
- package/{templates/.claude/commands/new-workflow.md → dist/templates/.claude/commands/zibby-new-workflow.md} +1 -1
- package/dist/templates/.claude/commands/zibby-set-auth.md +85 -0
- package/dist/templates/.claude/commands/zibby-static-ip.md +70 -0
- package/dist/templates/.claude/commands/zibby-status.md +54 -0
- package/dist/templates/.claude/commands/zibby-tail.md +53 -0
- package/dist/templates/.claude/commands/zibby-test-debug.md +59 -0
- package/dist/templates/.claude/commands/zibby-test-generate.md +39 -0
- package/dist/templates/.claude/commands/zibby-test-run.md +49 -0
- package/dist/templates/.claude/commands/zibby-test-write.md +46 -0
- package/dist/templates/.claude/commands/zibby-trigger.md +56 -0
- package/{templates/.claude/commands/validate-workflow.md → dist/templates/.claude/commands/zibby-validate-workflow.md} +1 -1
- package/dist/templates/.cursor/rules/zibby.mdc +127 -0
- package/dist/templates/AGENTS.md +248 -0
- package/dist/utils/managed-block.js +6 -0
- package/package.json +2 -2
- package/templates/.claude/CLAUDE.md +318 -10
- package/templates/.claude/agents/zibby-test-author.md +87 -0
- package/templates/.claude/agents/zibby-workflow-builder.md +101 -0
- package/templates/.claude/commands/{add-node.md → zibby-add-node.md} +1 -1
- package/templates/.claude/commands/{add-skill.md → zibby-add-skill.md} +1 -1
- package/templates/.claude/commands/zibby-app-destroy.md +60 -0
- package/templates/.claude/commands/zibby-app-list.md +80 -0
- package/templates/.claude/commands/zibby-app-logs.md +60 -0
- package/templates/.claude/commands/zibby-app-status.md +53 -0
- package/templates/.claude/commands/zibby-app-upgrade.md +67 -0
- package/templates/.claude/commands/zibby-debug.md +67 -0
- package/templates/.claude/commands/zibby-delete.md +37 -0
- package/templates/.claude/commands/zibby-deploy-app.md +92 -0
- package/templates/.claude/commands/zibby-deploy.md +87 -0
- package/templates/.claude/commands/zibby-list.md +30 -0
- package/templates/.claude/commands/zibby-login.md +68 -0
- package/templates/.claude/commands/zibby-mcp-install.md +93 -0
- package/templates/.claude/commands/zibby-memory-cost.md +39 -0
- package/templates/.claude/commands/zibby-memory-pull.md +47 -0
- package/templates/.claude/commands/zibby-memory-remote-use-hosted.md +61 -0
- package/templates/.claude/commands/zibby-memory-stats.md +38 -0
- package/{dist/templates/.claude/commands/new-workflow.md → templates/.claude/commands/zibby-new-workflow.md} +1 -1
- package/templates/.claude/commands/zibby-set-auth.md +85 -0
- package/templates/.claude/commands/zibby-static-ip.md +70 -0
- package/templates/.claude/commands/zibby-status.md +54 -0
- package/templates/.claude/commands/zibby-tail.md +53 -0
- package/templates/.claude/commands/zibby-test-debug.md +59 -0
- package/templates/.claude/commands/zibby-test-generate.md +39 -0
- package/templates/.claude/commands/zibby-test-run.md +49 -0
- package/templates/.claude/commands/zibby-test-write.md +46 -0
- package/templates/.claude/commands/zibby-trigger.md +56 -0
- package/{dist/templates/.claude/commands/validate-workflow.md → templates/.claude/commands/zibby-validate-workflow.md} +1 -1
- package/templates/.cursor/rules/zibby.mdc +127 -0
- package/templates/AGENTS.md +248 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<!-- zibby-template-version: 1 -->
|
|
2
|
+
# /zibby-login — authenticate the CLI to Zibby Cloud
|
|
3
|
+
|
|
4
|
+
You are helping the user log in (or switch accounts) on the Zibby CLI.
|
|
5
|
+
|
|
6
|
+
Canonical docs: **https://docs.zibby.app/cli/auth**
|
|
7
|
+
|
|
8
|
+
## What login does
|
|
9
|
+
|
|
10
|
+
`zibby login` opens a browser flow to https://zibby.dev that:
|
|
11
|
+
|
|
12
|
+
1. Authenticates the user via their normal account login (email/password, Google, GitHub, …).
|
|
13
|
+
2. Issues a CLI session token, scoped to the user's default workspace.
|
|
14
|
+
3. Writes the token to `~/.zibby/session.json` (mode `0600`). This is what all subsequent `zibby workflow / app / project / memory` commands authenticate with.
|
|
15
|
+
|
|
16
|
+
Workspaces are switched via `zibby workspace use <slug>` (separate command).
|
|
17
|
+
|
|
18
|
+
## Steps
|
|
19
|
+
|
|
20
|
+
1. **Check whether login is already valid:**
|
|
21
|
+
```
|
|
22
|
+
Bash(zibby status)
|
|
23
|
+
```
|
|
24
|
+
(See `/zibby-status` for the full surface.) If `Authenticated as <email>` and a recent timestamp, login is fresh — skip.
|
|
25
|
+
|
|
26
|
+
2. **Decide: interactive browser flow or API key?**
|
|
27
|
+
- **Browser flow** — default. Run `zibby login`, opens a browser, user clicks "Authorize", token lands on disk. Best for human users on a workstation with a browser.
|
|
28
|
+
- **API key** (PAT) — non-interactive. Set `ZIBBY_API_KEY=zby_<key>` in the env (or `--api-key` flag per-command). Best for CI, headless servers, no-browser environments.
|
|
29
|
+
|
|
30
|
+
3. **Run interactive login:**
|
|
31
|
+
```
|
|
32
|
+
Bash(zibby login)
|
|
33
|
+
```
|
|
34
|
+
The CLI prints a URL + 6-digit code. The user opens the URL, signs in, the CLI's local listener picks up the token and writes it to disk. Usually takes ~10 seconds end to end.
|
|
35
|
+
|
|
36
|
+
4. **If browser-less**, walk the user through API key:
|
|
37
|
+
- Direct them to https://zibby.dev/settings/api-keys
|
|
38
|
+
- "Create a new API key with the scopes you need" — usually `workflows:rw projects:r apps:rw`
|
|
39
|
+
- They copy `zby_xxx`
|
|
40
|
+
- For interactive use: `export ZIBBY_API_KEY=zby_xxx` in their shell
|
|
41
|
+
- For one-off: pass `--api-key zby_xxx` per command
|
|
42
|
+
|
|
43
|
+
5. **Verify:**
|
|
44
|
+
```
|
|
45
|
+
Bash(zibby status)
|
|
46
|
+
```
|
|
47
|
+
Should report email + workspace + token type (`session` or `api-key`).
|
|
48
|
+
|
|
49
|
+
## Switching accounts
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
Bash(zibby logout) # clears ~/.zibby/session.json
|
|
53
|
+
Bash(zibby login) # re-auth as the other account
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
There's no multi-account session; one login at a time. For workspace switching within an account, `zibby workspace use <slug>`.
|
|
57
|
+
|
|
58
|
+
## Common pitfalls
|
|
59
|
+
|
|
60
|
+
- **Headless server, no browser** → the browser flow assumes a local browser can reach the loopback listener. On a remote SSH session, the listener URL won't resolve. Use API key path instead.
|
|
61
|
+
- **Token expired** → session tokens last 30 days. Re-run `zibby login`. CI should use API keys to avoid this.
|
|
62
|
+
- **`ZIBBY_API_KEY` env shadows the session token.** If the user has both, the env wins. Surprise sometimes: `unset ZIBBY_API_KEY` to fall back to the session token.
|
|
63
|
+
- **Wrong workspace** — if the user has multiple workspaces, login lands them on whichever is `default`. Switch with `zibby workspace use <slug>`.
|
|
64
|
+
|
|
65
|
+
## Out of scope here
|
|
66
|
+
|
|
67
|
+
- Multi-factor → handled at https://zibby.dev/security, not from CLI.
|
|
68
|
+
- Org / role management → web UI only.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<!-- zibby-template-version: 1 -->
|
|
2
|
+
# /zibby-mcp-install — wire the Zibby Remote MCP server into the user's IDE agent
|
|
3
|
+
|
|
4
|
+
You are helping the user configure their AI IDE (Claude Code, Cursor, Codex CLI) to talk to Zibby's hosted MCP server.
|
|
5
|
+
|
|
6
|
+
Once installed, the IDE agent can directly trigger workflows, list apps, tail logs, etc. — without shelling out to `zibby`.
|
|
7
|
+
|
|
8
|
+
Canonical docs: **https://docs.zibby.app/cli/mcp**
|
|
9
|
+
|
|
10
|
+
## What gets installed
|
|
11
|
+
|
|
12
|
+
A single MCP server entry pointing at `https://mcp.zibby.app` (or your workspace's tenant URL), authenticated via the user's CLI session token or a PAT.
|
|
13
|
+
|
|
14
|
+
Tool surface (mirrors the CLI):
|
|
15
|
+
- `zibby_workflow_*` — list / deploy / trigger / logs / status
|
|
16
|
+
- `zibby_app_*` — list / deploy / status / logs / destroy / set-auth
|
|
17
|
+
- `zibby_project_*` — list / use
|
|
18
|
+
- `zibby_memory_*` — stats / pull / push
|
|
19
|
+
|
|
20
|
+
The IDE agent picks these up automatically once the MCP entry is configured.
|
|
21
|
+
|
|
22
|
+
## Per-IDE config
|
|
23
|
+
|
|
24
|
+
| IDE | Config file | Format |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| Claude Code | `~/.claude/settings.json` (or project `.claude/settings.json`) | `mcpServers` map |
|
|
27
|
+
| Cursor | `~/.cursor/mcp.json` (or project `.cursor/mcp.json`) | `mcpServers` map |
|
|
28
|
+
| Codex CLI | `~/.codex/config.toml` | `[mcp_servers.zibby]` TOML table |
|
|
29
|
+
| Aider | command-line flag | `--mcp-server https://mcp.zibby.app` |
|
|
30
|
+
|
|
31
|
+
The CLI has a helper that writes the right shape for each:
|
|
32
|
+
```
|
|
33
|
+
Bash(zibby mcp install --ide claude)
|
|
34
|
+
Bash(zibby mcp install --ide cursor)
|
|
35
|
+
Bash(zibby mcp install --ide codex)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Steps
|
|
39
|
+
|
|
40
|
+
1. **Find out which IDE the user is in.** Ask, or infer from active files:
|
|
41
|
+
- `.claude/` in the project → Claude Code
|
|
42
|
+
- `.cursor/` in the project → Cursor
|
|
43
|
+
- `~/.codex/` exists → Codex CLI
|
|
44
|
+
|
|
45
|
+
2. **Pick the scope.** Project (only this repo can use it) or user-wide (every project).
|
|
46
|
+
```
|
|
47
|
+
Bash(zibby mcp install --ide cursor --scope project)
|
|
48
|
+
Bash(zibby mcp install --ide cursor --scope user)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
3. **Pick the auth source.** Either the existing CLI session token (default, reuses `~/.zibby/session.json`), or a long-lived PAT for headless / CI use:
|
|
52
|
+
```
|
|
53
|
+
Bash(zibby mcp install --ide claude) # session-token auth
|
|
54
|
+
Bash(zibby mcp install --ide claude --pat zby_xxx) # PAT auth (recommended for shared configs)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
4. **Run install:**
|
|
58
|
+
```
|
|
59
|
+
Bash(zibby mcp install --ide <ide> --scope <project|user>)
|
|
60
|
+
```
|
|
61
|
+
The CLI patches the config file in-place (idempotent — re-running updates the entry). It prints what it wrote.
|
|
62
|
+
|
|
63
|
+
5. **Reload the IDE.** Claude Code: restart the CLI process. Cursor: `Cmd+Shift+P → "MCP: Reload"`. Codex: `codex reload` or restart.
|
|
64
|
+
|
|
65
|
+
6. **Verify** by asking the IDE agent to "list my Zibby apps" — it should call `zibby_app_list` and return rows.
|
|
66
|
+
|
|
67
|
+
## Manual config (if `zibby mcp install` is unavailable)
|
|
68
|
+
|
|
69
|
+
For Claude Code, add to `.claude/settings.json`:
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"zibby": {
|
|
74
|
+
"url": "https://mcp.zibby.app",
|
|
75
|
+
"headers": { "Authorization": "Bearer zby_xxx" }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
For Codex CLI, add to `~/.codex/config.toml`:
|
|
82
|
+
```toml
|
|
83
|
+
[mcp_servers.zibby]
|
|
84
|
+
url = "https://mcp.zibby.app"
|
|
85
|
+
headers = { Authorization = "Bearer zby_xxx" }
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Common pitfalls
|
|
89
|
+
|
|
90
|
+
- **Session token expires after 30 days** → MCP calls 401 silently. Re-run `zibby login` OR install with `--pat` for non-rotating auth.
|
|
91
|
+
- **Two entries with the same name** → IDEs vary in conflict resolution. Use distinct names (`zibby-prod`, `zibby-staging`) if you have multiple workspaces.
|
|
92
|
+
- **Project + user scope both set** → project wins for that repo, user is fallback elsewhere. Usually fine; mention it if it surprises the user.
|
|
93
|
+
- **Cursor doesn't pick up the config until a reload.** Cmd+Shift+P → MCP: Reload.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!-- zibby-template-version: 4 -->
|
|
2
|
+
# /zibby-memory-cost — show real LLM token spend across past test runs
|
|
3
|
+
|
|
4
|
+
You are helping the user see how many input/output/cache tokens their tests have actually burned, broken down per spec and per domain. This is real measured spend (read off run records in `.zibby/memory/.dolt/`), not an estimate.
|
|
5
|
+
|
|
6
|
+
Canonical docs: **https://docs.zibby.app/tests/memory**
|
|
7
|
+
|
|
8
|
+
## What the command shows
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
Bash(zibby memory cost)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Per-spec and per-domain rollup of:
|
|
15
|
+
- Input tokens
|
|
16
|
+
- Output tokens
|
|
17
|
+
- Cache hit / cache write tokens (when the agent supports prompt caching)
|
|
18
|
+
- Estimated $ cost (uses current public model pricing)
|
|
19
|
+
- Recent-runs trend, so you can see if a spec is getting cheaper or more expensive over time
|
|
20
|
+
|
|
21
|
+
The numbers are pulled from `test_runs` rows in the Dolt DB — every test run records the agent's actual usage on completion.
|
|
22
|
+
|
|
23
|
+
## When to invoke
|
|
24
|
+
|
|
25
|
+
- User asks "how much are my tests costing me?" or "which spec is the expensive one?"
|
|
26
|
+
- After enabling prompt caching to confirm cache hits are landing
|
|
27
|
+
- When deciding whether to swap to a cheaper agent on hot specs (`--agent` per run)
|
|
28
|
+
- When triaging a regression in test runtime — high token counts often correlate with the agent retrying
|
|
29
|
+
|
|
30
|
+
## Caveats
|
|
31
|
+
|
|
32
|
+
- **Only counts what's in local memory.** Runs on machines that haven't pulled from the team remote won't appear. Run `/zibby-memory-pull` first if you want the full team picture.
|
|
33
|
+
- **Pricing is informational.** Public API pricing changes; treat the $ column as a guide, not a bill. The token counts themselves are exact.
|
|
34
|
+
- **Empty if you've never run a test with memory enabled.** Confirm the runs are in there with `/zibby-memory-stats` first.
|
|
35
|
+
|
|
36
|
+
## Related
|
|
37
|
+
|
|
38
|
+
- `/zibby-memory-stats` — what's in the DB at all
|
|
39
|
+
- `/zibby-memory-pull` — refresh from team remote before reading cost
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!-- zibby-template-version: 4 -->
|
|
2
|
+
# /zibby-memory-pull — pull the team's latest test memory from the configured remote
|
|
3
|
+
|
|
4
|
+
You are helping the user fetch the team's latest learnings (selectors, page model, insights, run history) from the project's configured memory remote into local `.zibby/memory/.dolt/`.
|
|
5
|
+
|
|
6
|
+
Canonical docs: **https://docs.zibby.app/tests/memory**
|
|
7
|
+
|
|
8
|
+
## When this is needed (vs. just runs automatically)
|
|
9
|
+
|
|
10
|
+
`zibby test` auto-pulls before every run when a remote is configured, and auto-pushes after every passing run. So most of the time the user doesn't need to invoke pull manually. Manual pull is for:
|
|
11
|
+
|
|
12
|
+
- Fresh clone of the repo — first sync to seed `.zibby/memory/.dolt/` from the remote
|
|
13
|
+
- After a teammate landed a big batch of new learnings and the user wants them before running anything
|
|
14
|
+
- Inspecting team memory (`/zibby-memory-stats`, `/zibby-memory-cost`) without running a test
|
|
15
|
+
- Reconciling after a manual conflict in the Dolt DB
|
|
16
|
+
|
|
17
|
+
## How to run
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Bash(zibby memory pull)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The CLI fetches from whatever remote `zibby memory remote info` reports — BYO S3/GCS/DoltHub URL or the Zibby-hosted backend. No flags.
|
|
24
|
+
|
|
25
|
+
## Pre-flight: is a remote configured?
|
|
26
|
+
|
|
27
|
+
Before suggesting `pull`, check:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Bash(zibby memory remote info)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- **No remote configured** → pull errors out. Tell the user to either:
|
|
34
|
+
- Add their own: `zibby memory remote add aws://my-bucket/team/proj/main`
|
|
35
|
+
- Use the hosted one: `zibby memory remote use --hosted` (requires `zibby login`)
|
|
36
|
+
- See `/zibby-memory-remote-use-hosted` for the hosted path.
|
|
37
|
+
- **Hosted remote, signed out** → `zibby login` first.
|
|
38
|
+
|
|
39
|
+
## After pulling
|
|
40
|
+
|
|
41
|
+
Confirm the pull landed with `/zibby-memory-stats` — row counts should jump (selectors, runs, insights) compared to before.
|
|
42
|
+
|
|
43
|
+
## Related
|
|
44
|
+
|
|
45
|
+
- `zibby memory push` — manual push (auto on passing test, but sometimes you want to share now)
|
|
46
|
+
- `/zibby-memory-stats` — verify what came in
|
|
47
|
+
- `/zibby-memory-remote-use-hosted` — switch to the Zibby-managed S3 backend
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!-- zibby-template-version: 4 -->
|
|
2
|
+
# /zibby-memory-remote-use-hosted — switch this project's memory remote to Zibby-managed S3
|
|
3
|
+
|
|
4
|
+
You are helping the user point their `.zibby/memory/.dolt/` at Zibby's hosted S3 backend, instead of running their own S3 bucket / GCS / DoltHub repo.
|
|
5
|
+
|
|
6
|
+
Canonical docs: **https://docs.zibby.app/tests/memory**
|
|
7
|
+
|
|
8
|
+
## What this does
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
Bash(zibby memory remote use --hosted)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Allocates a tenant-scoped prefix on Zibby-managed S3 for this project (keyed on the projectId in `.zibby.config.mjs`) and writes that as the local Dolt remote. After this, every `zibby test` run auto-pulls before and auto-pushes after — same as a BYO remote, just without the bucket plumbing.
|
|
15
|
+
|
|
16
|
+
## Prerequisite: signed in
|
|
17
|
+
|
|
18
|
+
Hosted remote is **signed-in users only**. Verify:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Bash(zibby status)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
If not signed in, run `zibby login` first. The CLI uses the saved session to derive the tenant prefix; it won't fall back to anonymous.
|
|
25
|
+
|
|
26
|
+
## When to use hosted vs BYO
|
|
27
|
+
|
|
28
|
+
| | Hosted (`--hosted`) | BYO (`zibby memory remote add aws://...`) |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| Setup time | Zero — `--hosted` and you're done | Provision an S3 bucket, IAM, optional KMS |
|
|
31
|
+
| Who can read | Everyone with project access on Zibby | Whoever you grant in IAM |
|
|
32
|
+
| Where data lives | Zibby-managed AWS account | Your account |
|
|
33
|
+
| Compliance / data-residency | Limited regions | Wherever you want |
|
|
34
|
+
| Cost | Included in plan | Your S3 bill |
|
|
35
|
+
|
|
36
|
+
If the user has any data-residency requirement or a regulated workload, prefer BYO. Otherwise hosted is the path of least resistance.
|
|
37
|
+
|
|
38
|
+
## Switching from BYO to hosted
|
|
39
|
+
|
|
40
|
+
`zibby memory remote use --hosted` overwrites the existing remote. If they had a BYO remote and might want to keep its history, run `zibby memory push` against the old remote first so nothing's lost — then switch.
|
|
41
|
+
|
|
42
|
+
## After switching
|
|
43
|
+
|
|
44
|
+
1. `zibby memory pull` — seed `.zibby/memory/.dolt/` from the hosted prefix (no-op the very first time per project)
|
|
45
|
+
2. `/zibby-memory-stats` — confirm
|
|
46
|
+
3. Commit `.zibby.config.mjs` if you set `memorySync.remote: 'hosted'` so teammates auto-wire on next `zibby init`
|
|
47
|
+
|
|
48
|
+
## Reverting
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
Bash(zibby memory remote remove)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Drops the remote — memory becomes local-only again. The data on Zibby's S3 isn't deleted (it's still tenant-scoped), but nothing pushes or pulls until a new remote is configured.
|
|
55
|
+
|
|
56
|
+
## Related
|
|
57
|
+
|
|
58
|
+
- `/zibby-memory-pull` — manual pull (auto on test start)
|
|
59
|
+
- `/zibby-memory-stats` — verify what's in the local DB
|
|
60
|
+
- `zibby memory remote info` — show current remote config
|
|
61
|
+
- `zibby memory remote add <url>` — BYO remote (S3/GCS/DoltHub/file:///)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<!-- zibby-template-version: 4 -->
|
|
2
|
+
# /zibby-memory-stats — inspect the local test memory database
|
|
3
|
+
|
|
4
|
+
You are helping the user see what's in their `.zibby/memory/.dolt/` test-memory DB — row counts per table, last commit, and per-spec breakdown.
|
|
5
|
+
|
|
6
|
+
Canonical docs: **https://docs.zibby.app/tests/memory**
|
|
7
|
+
|
|
8
|
+
## What the command shows
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
Bash(zibby memory stats)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Prints a summary of the local Dolt database:
|
|
15
|
+
- **Test runs** — total runs recorded, pass/fail split, last run timestamp
|
|
16
|
+
- **Selectors** — total cached selectors, top pages by selector count
|
|
17
|
+
- **Page model** — pages mapped, total elements
|
|
18
|
+
- **Navigation** — known transitions
|
|
19
|
+
- **Insights** — count by category (`selector_tip | timing | navigation | workaround | flaky | general`)
|
|
20
|
+
- **Dolt status** — current branch, last commit hash, uncommitted changes
|
|
21
|
+
|
|
22
|
+
## When to invoke
|
|
23
|
+
|
|
24
|
+
- User asks "what does Zibby know about my app?" or "show me what's in test memory"
|
|
25
|
+
- After running a few tests, to confirm the agent is actually persisting learnings
|
|
26
|
+
- Before a `zibby memory compact` to see how much there is to prune
|
|
27
|
+
- Before a `zibby memory remote add` to know what's about to ship to the team
|
|
28
|
+
|
|
29
|
+
## Empty database?
|
|
30
|
+
|
|
31
|
+
If the user just ran `zibby memory init` (or it auto-initialized on first `zibby test`), most counts will be 0. That's fine — selectors and page model populate after the first successful run. Suggest running a test first.
|
|
32
|
+
|
|
33
|
+
## Related commands
|
|
34
|
+
|
|
35
|
+
- `/zibby-memory-cost` — real LLM token spend per spec / per domain
|
|
36
|
+
- `/zibby-memory-pull` — pull team's latest learnings from the configured remote
|
|
37
|
+
- `zibby memory compact` — prune old runs (`--max-runs N`, `--max-age <days>`)
|
|
38
|
+
- `zibby memory reset -f` — wipe the DB (destructive — confirm first)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<!-- zibby-template-version: 1 -->
|
|
2
|
+
# /zibby-set-auth — set, rotate, or disable auth on a Zibby Managed App
|
|
3
|
+
|
|
4
|
+
You are helping the user put auth in front of their app's public URL — or rotate / remove it.
|
|
5
|
+
|
|
6
|
+
Canonical docs: **https://docs.zibby.app/apps/auth**
|
|
7
|
+
|
|
8
|
+
## Why this matters
|
|
9
|
+
|
|
10
|
+
Every Managed App gets a public `https://<id>.apps.zibby.app` URL. Without auth, ANYONE with the URL can hit the app. For tools like n8n / Grafana / Outline that's a real risk — the URL is guessable from the catalog.
|
|
11
|
+
|
|
12
|
+
Zibby fronts the app with a **Caddy auth sidecar** that supports two modes:
|
|
13
|
+
|
|
14
|
+
| Mode | What it does | When to use |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| `basic` | HTTP Basic auth (browser prompt) | Quick personal tools, dashboards you visit yourself |
|
|
17
|
+
| `token` | `Authorization: Bearer <token>` header | API-only apps, scripted callers, webhook receivers |
|
|
18
|
+
| `none` | No auth (raw app) | Apps with their own auth (n8n has built-in login) — `--off` to disable |
|
|
19
|
+
|
|
20
|
+
## Three operations
|
|
21
|
+
|
|
22
|
+
### 1. Set auth (first time)
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Bash(zibby app set-auth <instanceId> --auth-type basic --auth-user admin --auth-password $(openssl rand -hex 16))
|
|
26
|
+
Bash(zibby app set-auth <instanceId> --auth-type token --auth-token $(openssl rand -hex 32))
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The Caddy sidecar updates within ~5s. No app-container restart.
|
|
30
|
+
|
|
31
|
+
### 2. Rotate (change password / token)
|
|
32
|
+
|
|
33
|
+
Same command shape as set. Old credentials stop working immediately when the Caddy reload completes.
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Bash(zibby app set-auth <instanceId> --auth-type basic --auth-user admin --auth-password $(openssl rand -hex 16))
|
|
37
|
+
Bash(zibby app set-auth <instanceId> --auth-type token --auth-token $(openssl rand -hex 32))
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 3. Disable (remove auth — go raw)
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Bash(zibby app set-auth <instanceId> --off)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`--off` short-circuits to `authType=none`. The Caddy sidecar is removed; the app's URL exposes the app directly. Only safe if the app has its own login (e.g. n8n, wordpress, grafana with `GF_AUTH_*` configured).
|
|
47
|
+
|
|
48
|
+
## Steps
|
|
49
|
+
|
|
50
|
+
1. **Identify the instanceId.** `Bash(zibby app list)` if user only has the friendly name.
|
|
51
|
+
|
|
52
|
+
2. **Find the current state:**
|
|
53
|
+
```
|
|
54
|
+
Bash(zibby app status <instanceId>)
|
|
55
|
+
```
|
|
56
|
+
Look at `authType`. If it's already what they want, skip the change.
|
|
57
|
+
|
|
58
|
+
3. **Decide which mode.** Ask the user:
|
|
59
|
+
- "Will you hit this from a browser (basic) or only from scripts / webhooks (token)?"
|
|
60
|
+
- If the answer is "it has its own login" → `--off`, and confirm they trust the app's built-in auth.
|
|
61
|
+
|
|
62
|
+
4. **Generate credentials securely.** For passwords / tokens, use `openssl rand -hex 16` (basic) / `openssl rand -hex 32` (token). NEVER reuse a password the user typed in chat — credentials in chat history leak.
|
|
63
|
+
|
|
64
|
+
5. **Run the command.** ALWAYS pass credentials via env / `$(…)` substitution rather than as literal strings in the command. The CLI also accepts `ZIBBY_APP_AUTH_PASSWORD` / `ZIBBY_APP_AUTH_TOKEN` env vars if the user prefers.
|
|
65
|
+
|
|
66
|
+
6. **Show the user the credentials ONCE.** The CLI prints them on success. Tell the user to save them — they're not recoverable from the backend (only re-rotateable).
|
|
67
|
+
|
|
68
|
+
7. **Verify auth is on:**
|
|
69
|
+
```
|
|
70
|
+
Bash(curl -i https://<id>.apps.zibby.app/) # should be 401 with basic, 401 with token
|
|
71
|
+
Bash(curl -i -u admin:<password> https://<id>.apps.zibby.app/) # should be 200
|
|
72
|
+
Bash(curl -i -H "Authorization: Bearer <token>" https://<id>.apps.zibby.app/) # 200
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## When NOT to rotate
|
|
76
|
+
|
|
77
|
+
- App is being used live — rotation invalidates old creds immediately, mid-session. Coordinate with the user.
|
|
78
|
+
- You don't have a place to put the new creds — losing track of a freshly rotated token locks you out of your own app. Save first.
|
|
79
|
+
|
|
80
|
+
## Common pitfalls
|
|
81
|
+
|
|
82
|
+
- **`--auth-user` must be a single ASCII printable token, 1-64 chars.** Spaces, unicode, control chars all 400.
|
|
83
|
+
- **Forgetting to confirm `--off`** on an app without its own auth → public URL exposed. The CLI will let you do it. The user might regret it.
|
|
84
|
+
- **Bearer-token mode + app has its own login** → users see a confusing 401 from Caddy before the app login page shows. Pick one auth layer, not two.
|
|
85
|
+
- **Reloading Caddy mid-request** can briefly 502 inflight responses. Set / rotate during a quiet window if the app is high-traffic.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<!-- zibby-template-version: 4 -->
|
|
2
|
+
# /zibby-static-ip — set up dedicated outbound static IP for a workflow
|
|
3
|
+
|
|
4
|
+
You are helping the user route a workflow's outbound traffic through a static IP address — needed when the workflow calls APIs that require IP allowlisting (corporate GitLab/GitHub Enterprise, internal SaaS, firewalls).
|
|
5
|
+
|
|
6
|
+
Canonical docs: **https://docs.zibby.app/workflows/egress**
|
|
7
|
+
|
|
8
|
+
> Note: the `--dedicated-ip` flag lives on the legacy alias `zibby deploy <name>`, NOT on `zibby workflow deploy <name>`. The two share a handler, but only `zibby deploy` exposes this flag in `--help`.
|
|
9
|
+
|
|
10
|
+
## What "static IP" means here
|
|
11
|
+
|
|
12
|
+
By default, workflow tasks run on Fargate and their outbound traffic exits via AWS-managed IPs that rotate. With the **dedicated egress** addon enabled, the workflow's outbound traffic is routed through a Zibby-managed proxy whose IP is pinned and customer-allowlistable.
|
|
13
|
+
|
|
14
|
+
Two pieces:
|
|
15
|
+
1. **Account-level addon** — `~$50/mo`, requires Pro subscription. One-time toggle per account.
|
|
16
|
+
2. **Per-workflow opt-in** — once the addon is on, each workflow opts in individually (some workflows might not need it, no point routing them).
|
|
17
|
+
|
|
18
|
+
## Steps
|
|
19
|
+
|
|
20
|
+
1. **Confirm the user understands the cost.** Before any `--dedicated-ip enable`, explicitly say:
|
|
21
|
+
```
|
|
22
|
+
"This will enable a $50/mo dedicated-egress addon on your account. Confirm?"
|
|
23
|
+
```
|
|
24
|
+
If they don't have a Pro subscription, the enable call returns 402 — direct them to https://zibby.dev/billing first.
|
|
25
|
+
|
|
26
|
+
2. **Check current state:**
|
|
27
|
+
```
|
|
28
|
+
Bash(zibby deploy <name> --dedicated-ip status)
|
|
29
|
+
```
|
|
30
|
+
Output tells you: addon active or inactive, this workflow currently using it or not, and the assigned IPs to publish to customers.
|
|
31
|
+
|
|
32
|
+
3. **If addon is inactive — enable it** (only after explicit user confirmation):
|
|
33
|
+
```
|
|
34
|
+
Bash(zibby deploy <name> --dedicated-ip enable)
|
|
35
|
+
```
|
|
36
|
+
This is one-time per account. After this, the addon is active for ALL workflows in the account that opt in.
|
|
37
|
+
|
|
38
|
+
4. **Opt this workflow in:**
|
|
39
|
+
```
|
|
40
|
+
Bash(zibby deploy <name> --dedicated-ip use)
|
|
41
|
+
```
|
|
42
|
+
From now on, every deploy of this workflow + every triggered execution routes outbound through the static IP.
|
|
43
|
+
|
|
44
|
+
5. **Re-deploy the workflow** so the runtime picks up the change:
|
|
45
|
+
```
|
|
46
|
+
Bash(zibby workflow deploy <name>)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
6. **Verify in a node** by adding a quick log:
|
|
50
|
+
```js
|
|
51
|
+
ctx.log(`HTTP_PROXY=${process.env.HTTP_PROXY}`);
|
|
52
|
+
```
|
|
53
|
+
The proxy URL should be set on the node's process. The IP that external services see is the dedicated one.
|
|
54
|
+
|
|
55
|
+
## Reverting
|
|
56
|
+
|
|
57
|
+
- `Bash(zibby deploy <name> --dedicated-ip unuse)` — stop routing this workflow's egress through the static IP. Other opted-in workflows are unaffected.
|
|
58
|
+
- `Bash(zibby deploy <name> --dedicated-ip disable)` — disable the addon entirely (also stops billing).
|
|
59
|
+
|
|
60
|
+
## Tell the user the IPs
|
|
61
|
+
|
|
62
|
+
After `enable`, the assigned outbound IPs are visible in `--dedicated-ip status` output. Surface them clearly so the user can paste into their customer's firewall allowlist:
|
|
63
|
+
```
|
|
64
|
+
Outbound static IPs (allowlist these in the customer's firewall):
|
|
65
|
+
54.252.121.111
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Don't confuse with the inbound static IPs
|
|
69
|
+
|
|
70
|
+
This is OUTBOUND (workflow → external API). There's also an INBOUND static-IP set for `https://logs-stream.zibby.app` (the SSE log endpoint customers tail with `zibby workflow logs -t`). That one is unrelated to this addon — see `https://docs.zibby.app/security/ip-allowlist`.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<!-- zibby-template-version: 1 -->
|
|
2
|
+
# /zibby-status — show current Zibby CLI context: auth, workspace, project
|
|
3
|
+
|
|
4
|
+
You are helping the user understand the CLI's current state — who they're authenticated as, which workspace they're in, which project is selected, and what credentials are active.
|
|
5
|
+
|
|
6
|
+
Canonical docs: **https://docs.zibby.app/cli-reference#status**
|
|
7
|
+
|
|
8
|
+
## What status reports
|
|
9
|
+
|
|
10
|
+
`zibby status` prints:
|
|
11
|
+
|
|
12
|
+
- **Authenticated as** — email + workspace slug + token type (`session` / `api-key`)
|
|
13
|
+
- **Token age** — when it was issued and when it expires (session only)
|
|
14
|
+
- **Default project** — `paths.workspace.defaultProject` from `.zibby.config.mjs` (or unset)
|
|
15
|
+
- **API URL** — usually `https://api-prod.zibby.app`; differs in dev / local
|
|
16
|
+
- **Credentials** — which provider tokens (ANTHROPIC, OPENAI, CURSOR, GEMINI) are configured for local agent runs
|
|
17
|
+
|
|
18
|
+
## Steps
|
|
19
|
+
|
|
20
|
+
1. **Run status:**
|
|
21
|
+
```
|
|
22
|
+
Bash(zibby status)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
2. **Read the result for the user.** Group by section:
|
|
26
|
+
- **Auth** — say "Logged in as `<email>` (workspace `<slug>`)" or "Not authenticated".
|
|
27
|
+
- **Project** — say "Working in project `<id>`" or "No default project set."
|
|
28
|
+
- **Creds** — list the providers with tokens configured. Flag missing critical ones (e.g. "No `ANTHROPIC_API_KEY` — `claude` agent will fail unless you set one").
|
|
29
|
+
|
|
30
|
+
3. **Suggest follow-ups based on state:**
|
|
31
|
+
- Not authenticated → `/zibby-login`
|
|
32
|
+
- Token near expiry → "Run `zibby login` to refresh before the token expires on `<date>`."
|
|
33
|
+
- No default project → "Pick one with `zibby project use <id>`" or `zibby list` to see options.
|
|
34
|
+
- Missing creds for an agent the user uses → walk them through setting it.
|
|
35
|
+
|
|
36
|
+
## When to use
|
|
37
|
+
|
|
38
|
+
- User asks "am I logged in?" → status.
|
|
39
|
+
- User asks "what project am I in?" → status.
|
|
40
|
+
- After every login / workspace switch, to confirm the change landed.
|
|
41
|
+
- Before any cross-account operation that depends on workspace context.
|
|
42
|
+
|
|
43
|
+
## Quiet / scriptable
|
|
44
|
+
|
|
45
|
+
`--quiet` returns JSON for scripts:
|
|
46
|
+
```
|
|
47
|
+
Bash(zibby status --quiet | jq -r .workspace)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Common pitfalls
|
|
51
|
+
|
|
52
|
+
- **Session token + `ZIBBY_API_KEY` both set** → status prints both. The env var wins. Tell the user.
|
|
53
|
+
- **Stale `.zibby/session.json`** → if the file is unreadable (permissions, partial write), status reports "Not authenticated" even when a recent login looked successful. Re-run `zibby login`.
|
|
54
|
+
- **`api-prod.zibby.app` unreachable** — status hits the API to validate the token. Without network, it reports cached info only. Don't conflate "no network" with "logged out".
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<!-- zibby-template-version: 4 -->
|
|
2
|
+
# /zibby-tail — stream live logs from a Zibby workflow
|
|
3
|
+
|
|
4
|
+
You are helping the user tail logs from a workflow execution.
|
|
5
|
+
|
|
6
|
+
`zibby workflow logs <jobId> -t` is the live-streaming variant (like `heroku logs --tail` or `docker compose logs -f`). Without `-t`, you get a one-shot fetch.
|
|
7
|
+
|
|
8
|
+
Canonical docs: **https://docs.zibby.app/workflows/logs**
|
|
9
|
+
|
|
10
|
+
## What `<jobId>` accepts
|
|
11
|
+
|
|
12
|
+
- A **workflow UUID** (`2b1ea07f-...`) → tails ALL currently-active executions of that workflow, plus any new ones triggered while the tail is open. Lines are interleaved by arrival time, prefixed with `(taskId)` so concurrent runs are distinguishable.
|
|
13
|
+
- An **execution ID** (`abc-...`) → tails just that single execution. Closes when the execution drains.
|
|
14
|
+
|
|
15
|
+
## Example flow
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
$ zibby workflow trigger 2b1ea07f-3ede-4bfd-a51d-431f0bab008e
|
|
19
|
+
Job ID: 569ef1ee-15c8-4ee7-af30-933c8bec7ea7
|
|
20
|
+
|
|
21
|
+
$ zibby workflow logs 2b1ea07f-3ede-4bfd-a51d-431f0bab008e -t
|
|
22
|
+
Streaming logs for workflow 2b1ea07f-...
|
|
23
|
+
Press Ctrl+C to stop.
|
|
24
|
+
|
|
25
|
+
┌─ Execution: 569ef1ee...7ea7 (task: 9e61c690)
|
|
26
|
+
└─ Streaming logs...
|
|
27
|
+
|
|
28
|
+
2026-05-04 06:16:27.621 (9e61c690) zibby v0.1.91
|
|
29
|
+
2026-05-04 06:16:27.997 (9e61c690) Workflow: hello-world
|
|
30
|
+
2026-05-04 06:16:33.055 (9e61c690) │ Prompt sent to LLM:
|
|
31
|
+
...
|
|
32
|
+
2026-05-04 06:16:56.389 (9e61c690) ✓ Workflow completed
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Tail behavior worth knowing
|
|
36
|
+
|
|
37
|
+
- **Auto-switch:** when the current execution drains and a new trigger lands, the tail seamlessly picks it up — no need to re-run the command.
|
|
38
|
+
- **Multi-attach:** if you trigger two workflows in parallel, the tail attaches to both. Lines from each are interleaved by timestamp.
|
|
39
|
+
- **Reconnect:** transient network blips reconnect silently. Long quiet windows (3+ min) are kept alive via 5s keepalives.
|
|
40
|
+
|
|
41
|
+
## Steps for this command
|
|
42
|
+
|
|
43
|
+
1. Identify the jobId. If user gives a workflow name (not UUID), look it up via `zibby workflow list` and use the UUID.
|
|
44
|
+
2. **Run in the background** — `-t` is a long-running stream. If you call `Bash` without `run_in_background: true` it'll block the chat for minutes:
|
|
45
|
+
```
|
|
46
|
+
Bash({ command: "zibby workflow logs <jobId> -t", run_in_background: true })
|
|
47
|
+
```
|
|
48
|
+
Then use `BashOutput` (or whatever your background-output tool is) to read new lines as they arrive.
|
|
49
|
+
3. If the user wants a **one-shot snapshot** (no follow), drop the `-t` flag and call Bash normally:
|
|
50
|
+
```
|
|
51
|
+
Bash({ command: "zibby workflow logs <jobId>" })
|
|
52
|
+
```
|
|
53
|
+
4. To stop the live tail: kill the background bash task. The CLI exits cleanly with `Stopped streaming.`
|