bnbagent-studio 0.0.1__tar.gz

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 (90) hide show
  1. bnbagent_studio-0.0.1/.gitignore +36 -0
  2. bnbagent_studio-0.0.1/DISCLAIMER.md +51 -0
  3. bnbagent_studio-0.0.1/PKG-INFO +339 -0
  4. bnbagent_studio-0.0.1/README.md +313 -0
  5. bnbagent_studio-0.0.1/bag/__init__.py +6 -0
  6. bnbagent_studio-0.0.1/bag/cli/__init__.py +0 -0
  7. bnbagent_studio-0.0.1/bag/cli/__main__.py +200 -0
  8. bnbagent_studio-0.0.1/bag/cli/_agentcore_name.py +30 -0
  9. bnbagent_studio-0.0.1/bag/cli/_deploy/__init__.py +26 -0
  10. bnbagent_studio-0.0.1/bag/cli/_deploy/aws_targets.py +71 -0
  11. bnbagent_studio-0.0.1/bag/cli/_deploy/checks/__init__.py +11 -0
  12. bnbagent_studio-0.0.1/bag/cli/_deploy/checks/_wallet.py +130 -0
  13. bnbagent_studio-0.0.1/bag/cli/_deploy/checks/blocked.py +124 -0
  14. bnbagent_studio-0.0.1/bag/cli/_deploy/checks/critical.py +759 -0
  15. bnbagent_studio-0.0.1/bag/cli/_deploy/checks/info.py +157 -0
  16. bnbagent_studio-0.0.1/bag/cli/_deploy/checks/service_preflight.py +138 -0
  17. bnbagent_studio-0.0.1/bag/cli/_deploy/checks/types.py +85 -0
  18. bnbagent_studio-0.0.1/bag/cli/_deploy/checks/warning.py +535 -0
  19. bnbagent_studio-0.0.1/bag/cli/_deploy/destroy.py +356 -0
  20. bnbagent_studio-0.0.1/bag/cli/_deploy/fixes.py +204 -0
  21. bnbagent_studio-0.0.1/bag/cli/_deploy/logs.py +320 -0
  22. bnbagent_studio-0.0.1/bag/cli/_deploy/manifest.py +176 -0
  23. bnbagent_studio-0.0.1/bag/cli/_deploy/package.py +190 -0
  24. bnbagent_studio-0.0.1/bag/cli/_deploy/prepare.py +84 -0
  25. bnbagent_studio-0.0.1/bag/cli/_deploy/status.py +240 -0
  26. bnbagent_studio-0.0.1/bag/cli/_deploy/verify.py +346 -0
  27. bnbagent_studio-0.0.1/bag/cli/_dev_probe.py +25 -0
  28. bnbagent_studio-0.0.1/bag/cli/_import_scan.py +35 -0
  29. bnbagent_studio-0.0.1/bag/cli/_pieverse_helpers.py +270 -0
  30. bnbagent_studio-0.0.1/bag/cli/_wheels.py +56 -0
  31. bnbagent_studio-0.0.1/bag/cli/agents.py +645 -0
  32. bnbagent_studio-0.0.1/bag/cli/audit.py +165 -0
  33. bnbagent_studio-0.0.1/bag/cli/budget.py +221 -0
  34. bnbagent_studio-0.0.1/bag/cli/bundle.py +643 -0
  35. bnbagent_studio-0.0.1/bag/cli/config.py +352 -0
  36. bnbagent_studio-0.0.1/bag/cli/deploy.py +1973 -0
  37. bnbagent_studio-0.0.1/bag/cli/dev.py +941 -0
  38. bnbagent_studio-0.0.1/bag/cli/doctor.py +1204 -0
  39. bnbagent_studio-0.0.1/bag/cli/env_cli.py +156 -0
  40. bnbagent_studio-0.0.1/bag/cli/erc8004.py +236 -0
  41. bnbagent_studio-0.0.1/bag/cli/erc8183.py +457 -0
  42. bnbagent_studio-0.0.1/bag/cli/init.py +2796 -0
  43. bnbagent_studio-0.0.1/bag/cli/install.py +57 -0
  44. bnbagent_studio-0.0.1/bag/cli/llm.py +1243 -0
  45. bnbagent_studio-0.0.1/bag/cli/mcp_cli.py +65 -0
  46. bnbagent_studio-0.0.1/bag/cli/preflight.py +203 -0
  47. bnbagent_studio-0.0.1/bag/cli/recipe.py +182 -0
  48. bnbagent_studio-0.0.1/bag/cli/scan.py +275 -0
  49. bnbagent_studio-0.0.1/bag/cli/skills.py +496 -0
  50. bnbagent_studio-0.0.1/bag/cli/wallet.py +449 -0
  51. bnbagent_studio-0.0.1/bag/cli/x402.py +326 -0
  52. bnbagent_studio-0.0.1/bag/mcp/__init__.py +0 -0
  53. bnbagent_studio-0.0.1/bag/mcp/server.py +123 -0
  54. bnbagent_studio-0.0.1/bag/recipes/8183-buyer/code/{{PKG}}/tools/erc8183_buyer.py.tmpl +72 -0
  55. bnbagent_studio-0.0.1/bag/recipes/8183-buyer/recipe.toml +22 -0
  56. bnbagent_studio-0.0.1/bag/recipes/8183-service/code/{{PKG}}/agent_client.py.tmpl +197 -0
  57. bnbagent_studio-0.0.1/bag/recipes/8183-service/code/{{PKG}}/service.py.tmpl +685 -0
  58. bnbagent_studio-0.0.1/bag/recipes/8183-service/recipe.toml +66 -0
  59. bnbagent_studio-0.0.1/bag/recipes/__init__.py +0 -0
  60. bnbagent_studio-0.0.1/bag/recipes/agent/code/{{PKG}}/signing.py.tmpl +199 -0
  61. bnbagent_studio-0.0.1/bag/recipes/agent/recipe.toml +57 -0
  62. bnbagent_studio-0.0.1/bag/recipes/deps.py +73 -0
  63. bnbagent_studio-0.0.1/bag/recipes/frameworks/adk/code/{{PKG}}/tools.py.tmpl +57 -0
  64. bnbagent_studio-0.0.1/bag/recipes/frameworks/adk/recipe.toml +15 -0
  65. bnbagent_studio-0.0.1/bag/recipes/loader.py +242 -0
  66. bnbagent_studio-0.0.1/bag/recipes/providers/pieverse-llm/code/adk/{{PKG}}/managed_model.py.tmpl +153 -0
  67. bnbagent_studio-0.0.1/bag/recipes/providers/pieverse-llm/recipe.toml +16 -0
  68. bnbagent_studio-0.0.1/bag/recipes/providers/pieverse-llm/skills/funding-pieverse-llm.md +202 -0
  69. bnbagent_studio-0.0.1/bag/recipes/runtimes/agentcore/code/{{PKG}}/.bedrock_agentcore.yaml.tmpl +52 -0
  70. bnbagent_studio-0.0.1/bag/recipes/runtimes/agentcore/code/{{PKG}}/main.py.tmpl +315 -0
  71. bnbagent_studio-0.0.1/bag/recipes/runtimes/agentcore/recipe.toml +21 -0
  72. bnbagent_studio-0.0.1/bag/recipes/tools-adk/code/{{PKG}}/chain_tools.py.tmpl +50 -0
  73. bnbagent_studio-0.0.1/bag/recipes/tools-adk/recipe.toml +10 -0
  74. bnbagent_studio-0.0.1/bag/recipes/wallet/recipe.toml +16 -0
  75. bnbagent_studio-0.0.1/bag/recipes/x402-buyer/code/{{PKG}}/tools/x402_buyer.py.tmpl +48 -0
  76. bnbagent_studio-0.0.1/bag/recipes/x402-buyer/recipe.toml +18 -0
  77. bnbagent_studio-0.0.1/bag/skills_installer.py +322 -0
  78. bnbagent_studio-0.0.1/bag/utils/__init__.py +1 -0
  79. bnbagent_studio-0.0.1/bag/utils/env_file.py +79 -0
  80. bnbagent_studio-0.0.1/pyproject.toml +62 -0
  81. bnbagent_studio-0.0.1/skills/bnbagent-studio-adding-to-project.md +193 -0
  82. bnbagent_studio-0.0.1/skills/bnbagent-studio-buying-via-8183.md +213 -0
  83. bnbagent_studio-0.0.1/skills/bnbagent-studio-deploying-service-to-ec2.md +711 -0
  84. bnbagent_studio-0.0.1/skills/bnbagent-studio-extending-signing.md +225 -0
  85. bnbagent_studio-0.0.1/skills/bnbagent-studio-operating.md +172 -0
  86. bnbagent_studio-0.0.1/skills/bnbagent-studio-scaffolding-agent.md +412 -0
  87. bnbagent_studio-0.0.1/skills/bnbagent-studio-selling-via-8183.md +206 -0
  88. bnbagent_studio-0.0.1/skills/bnbagent-studio-use-aws-agentcore.md +199 -0
  89. bnbagent_studio-0.0.1/skills/bnbagent-studio-wiring-llm-tools.md +323 -0
  90. bnbagent_studio-0.0.1/skills/bnbagent-studio.md +83 -0
@@ -0,0 +1,36 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+
8
+ # Virtual envs
9
+ .venv/
10
+ .venv-*/
11
+ venv/
12
+
13
+ # Tooling caches
14
+ .pytest_cache/
15
+ .ruff_cache/
16
+ .mypy_cache/
17
+ .coverage
18
+
19
+ # OS / editor
20
+ .DS_Store
21
+ .vscode/
22
+ .idea/
23
+
24
+ # Local scratch
25
+ scratch/
26
+
27
+ # Project secrets
28
+ .env
29
+ .env.local
30
+
31
+ # Wallet keystores (never commit, even encrypted)
32
+ .studio/wallets/
33
+ *.keystore.json
34
+
35
+ # Audit log (per-project; ADR #37 T37.9)
36
+ .studio/audit-log.jsonl
@@ -0,0 +1,51 @@
1
+ <!-- Synced copy of the repo-root DISCLAIMER.md — edit that one, then re-copy. -->
2
+
3
+ # Disclaimer
4
+
5
+ **bnbagent-studio** is open-source software provided under the
6
+ [Apache-2.0 license](https://github.com/bnb-chain/bnbagent-studio/blob/main/LICENSE)
7
+ **"AS IS", without warranty of any kind** (see Sections 7–8 of the license).
8
+ This file spells out what that means for the parts of the project that touch
9
+ your cloud account and your funds.
10
+
11
+ ## AWS permissions and resources
12
+
13
+ Deploying the two-layer seller provisions resources **in your own AWS
14
+ account**: Bedrock AgentCore and Secrets Manager for the Agent (Layer A),
15
+ and — if you follow the EC2 runbook — an IAM role, security group and EC2
16
+ instance for the Service (Layer B).
17
+
18
+ The IAM policy documents this project publishes —
19
+ [least-privilege-iam.md](https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/guides/least-privilege-iam.md)
20
+ and
21
+ [iam-policies.md](https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/guides/iam-policies.md)
22
+ — are **reference configurations**, provided AS IS. They are a best effort at
23
+ a least-privilege setup, but **you** apply them, **you** own the credentials,
24
+ and **you** remain solely responsible for:
25
+
26
+ - reviewing and scoping every policy before applying it to your account;
27
+ - the conduct of any identity that holds these permissions;
28
+ - all resulting AWS costs; and
29
+ - the security posture and operation of the deployed resources.
30
+
31
+ Before granting any permission, read the official AWS guidance:
32
+
33
+ - [AWS IAM best practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)
34
+ - [AWS Well-Architected Framework — security pillar](https://docs.aws.amazon.com/wellarchitected/latest/framework/security.html)
35
+
36
+ ## Wallet keys and on-chain funds
37
+
38
+ The software manages wallet keys and on-chain funds. Private keys live only in
39
+ environments you control — which also means only **you** can protect them.
40
+ Start on testnet, fund mainnet wallets only with amounts you can afford to
41
+ lose, and use the software at your own risk. Nothing in this project is
42
+ financial advice.
43
+
44
+ ## No liability
45
+
46
+ To the maximum extent permitted by law, the authors and contributors accept no
47
+ liability for damages of any kind arising from the use of this software —
48
+ including, without limitation, lost funds, compromised credentials, unexpected
49
+ cloud charges, or security incidents in your AWS account. The
50
+ [Apache-2.0 license](https://github.com/bnb-chain/bnbagent-studio/blob/main/LICENSE)
51
+ is the authoritative statement of the terms.
@@ -0,0 +1,339 @@
1
+ Metadata-Version: 2.4
2
+ Name: bnbagent-studio
3
+ Version: 0.0.1
4
+ Summary: The `bag` CLI to scaffold and deploy a two-layer bnbagent-sdk seller on BNB Chain.
5
+ Project-URL: Homepage, https://github.com/bnb-chain/bnbagent-studio
6
+ Project-URL: Repository, https://github.com/bnb-chain/bnbagent-studio
7
+ Author: BNB Chain Studio
8
+ License-Expression: Apache-2.0
9
+ Keywords: agent,blockchain,bnb,cli,erc-8004,erc-8183,x402
10
+ Classifier: Environment :: Console
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Python: >=3.10
17
+ Requires-Dist: bnbagent-studio-core==0.0.1
18
+ Requires-Dist: boto3>=1.34
19
+ Requires-Dist: fastapi>=0.110
20
+ Requires-Dist: mcp>=1.0
21
+ Requires-Dist: python-dotenv>=1.0
22
+ Requires-Dist: rich>=13.0
23
+ Requires-Dist: tomlkit>=0.13
24
+ Requires-Dist: uvicorn>=0.30
25
+ Description-Content-Type: text/markdown
26
+
27
+ # bnbagent-studio
28
+
29
+ **`bag`** — the developer CLI, read-only MCP server, scaffolding recipes, and
30
+ bundled IDE skills for **vibe-coding a two-layer blockchain seller** on BNB
31
+ Chain: an Agent that earns $U by selling services over ERC-8004 (identity) +
32
+ ERC-8183 (commerce) + x402 (payments), built on the `bnbagent` SDK.
33
+
34
+ You drive most of it **in natural language from Claude Code (or Cursor)** — the
35
+ bundled skills teach your AI tool how to scaffold, run, and deploy the agent for
36
+ you. It is also a complete CLI you can run by hand.
37
+
38
+ ## ✨ Highlights
39
+
40
+ - **Vibe-code a BNB Chain seller from your IDE** — install the skills, then ask
41
+ Claude Code to "create a BNB seller agent on testnet" and it drives the CLI
42
+ for you.
43
+ - **Two-layer, key-isolated deploy** — a private, invoke-only **Agent** (the
44
+ sole key-holder/signer, on AWS Bedrock AgentCore) and a public, **keyless
45
+ Service** (no key, no LLM, never signs).
46
+ - **Read-only MCP** — 15 chain-query tools for your IDE, with **no signing and
47
+ no on-chain state change** by design.
48
+ - **Keys never leave your machine** — the encrypted keystore lives at your
49
+ workspace root, outside any deploy artifact; only your own Agent ever reads
50
+ it.
51
+ - **Jump-ship friendly** — emitted project code is yours to edit, fork, or
52
+ migrate; no closed-source SaaS lock-in.
53
+ - **$0 to start** — the default Pieverse LLM provider activates with a
54
+ zero-deposit API key; testnet funds and your own LLM key are optional.
55
+
56
+ > ⚠️ **This project is under active development** and may introduce breaking
57
+ > changes between releases. It manages wallet keys and on-chain funds: start on
58
+ > **testnet**, and use it at your own risk.
59
+
60
+ > ⚠️ **Deploying provisions AWS resources in your own account**, under IAM
61
+ > policies you review and apply yourself. The published policy documents
62
+ > ([least-privilege guide](https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/guides/least-privilege-iam.md),
63
+ > [policy JSON](https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/guides/iam-policies.md))
64
+ > are **reference configurations provided AS IS** — you remain responsible for
65
+ > scoping, costs, and security. Full terms:
66
+ > [DISCLAIMER.md](https://github.com/bnb-chain/bnbagent-studio/blob/main/DISCLAIMER.md)
67
+ > (also shipped in this package as `bag/DISCLAIMER.md`).
68
+
69
+ ## Overview
70
+
71
+ `bnbagent-studio` scaffolds and deploys a **two-layer seller** on BNB Chain:
72
+
73
+ - **Layer A — the Agent** (deployed invoke-only to AWS Bedrock AgentCore): the
74
+ value (LLM, memory, tools) **and** the sole key-holder/signer. It is invoked
75
+ on an action envelope — `quote` / `fulfill` / `settle`. All signing is fixed
76
+ entrypoint code, never an LLM-callable tool.
77
+ - **Layer B — the ERC-8183 Service** (deployed to EC2): a public, long-running,
78
+ **keyless** container — a funded-job poller plus a `/apex/negotiate` ingress.
79
+ It holds no key, runs no LLM, and never signs; it delegates every signing op
80
+ to the Agent.
81
+
82
+ This package is the **dev-time tool**. It imports as `bag` and depends on
83
+ **[`bnbagent-studio-core`](https://pypi.org/project/bnbagent-studio-core/)**
84
+ (import `bnbagent_studio_core`), the agent-runtime library that runs inside the
85
+ deployed Agent — installing this package auto-pulls core. Both sit on top of the
86
+ [`bnbagent`](https://pypi.org/project/bnbagent/) SDK protocol layer.
87
+
88
+ v1 is **seller-only**. Buyer product flows, KMS/remote signing, and multi-chain
89
+ support are on the [roadmap](https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/roadmap.md)
90
+ for a later release.
91
+
92
+ ## Installation
93
+
94
+ ```bash
95
+ uv tool install bnbagent-studio # machine-wide CLI (recommended)
96
+ # or
97
+ pip install bnbagent-studio # into the active environment
98
+ # or
99
+ uvx bnbagent-studio init my-agent # one-shot, no install
100
+ ```
101
+
102
+ Installing `bnbagent-studio` pulls in `bnbagent-studio-core` automatically.
103
+ Verify:
104
+
105
+ ```bash
106
+ bag --version
107
+ bag --help # lists every command group
108
+ ```
109
+
110
+ ### Requirements
111
+
112
+ - **Python ≥ 3.10**.
113
+ - **Claude Code or Cursor** — required to use the bundled skills (the
114
+ natural-language workflow). The CLI works without them.
115
+ - **The native AgentCore CLI** — `bag init` / `bag dev` / `bag deploy agent`
116
+ shell out to it. Install with `npm install -g @aws/agentcore` (**Node ≥ 20**).
117
+ Make sure the npm CLI wins on `PATH` over any Python
118
+ `bedrock-agentcore-starter-toolkit` shim (`which -a agentcore`,
119
+ `node --version`).
120
+ - An **AWS account** is needed only when you deploy — never for local
121
+ development.
122
+
123
+ ## 🚀 Getting started
124
+
125
+ This is the canonical, beginner-friendly path: **install → install skills →
126
+ drive from your IDE → run both layers locally → deploy.** You mostly talk to
127
+ Claude Code in plain language; the studio runs the CLI for you. The full,
128
+ deepest version of this walkthrough is in the
129
+ [User Guide](https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/guides/user-guide.md).
130
+
131
+ ### What to prepare
132
+
133
+ - Python ≥ 3.10 and Claude Code (or Cursor).
134
+ - The native AgentCore CLI (`npm install -g @aws/agentcore`, Node ≥ 20).
135
+ - **A wallet password you choose.** `bag` creates a *local* encrypted keystore;
136
+ the password lives only in your shell env as `WALLET_PASSWORD` and is never
137
+ written to disk.
138
+ - **Optional:** testnet funds (tBNB + $U from a faucet) and your own LLM API
139
+ key. Neither is required to start — the default **Pieverse** LLM provider
140
+ activates with a **$0 deposit**.
141
+
142
+ ### 1. Install the CLI
143
+
144
+ ```bash
145
+ uv tool install bnbagent-studio # or: pip install bnbagent-studio
146
+ bag --version # confirm it's on PATH
147
+ ```
148
+
149
+ ### 2. Install the skills into your IDE
150
+
151
+ Claude Code doesn't know the studio exists until you install the skills.
152
+
153
+ ```bash
154
+ bag skills install
155
+ # On a TTY: auto-detects Claude Code / Cursor, lets you pick scope (user/project),
156
+ # and installs 10 skills, e.g.:
157
+ # claude-code [user]: installed=10 target=~/.claude/skills
158
+ ```
159
+
160
+ Non-interactive (CI) form:
161
+
162
+ ```bash
163
+ bag skills install --target both --scope user # Claude Code + Cursor, machine-wide
164
+ bag skills install --target cursor --scope project # Cursor only, this workspace
165
+ ```
166
+
167
+ **Then reload your IDE window** so it picks up the skills. (Remove them later
168
+ with `bag skills uninstall`.)
169
+
170
+ ### 3. Drive it in natural language from Claude Code
171
+
172
+ Open Claude Code where you want the project to live, and just say what you want.
173
+ Concrete prompts that work:
174
+
175
+ > "Create a new BNB seller agent named weather-seller on testnet that sells
176
+ > weather forecasts."
177
+
178
+ > "Start my agent and verify it works."
179
+
180
+ > "Is my wallet funded? What's my $U balance?"
181
+
182
+ > "Register my agent on chain so others can find it."
183
+
184
+ The skills tell Claude Code how to chain the CLI for you — it runs `bag init`,
185
+ sets up the per-layer virtualenvs, runs `bag wallet new` (prompting you for
186
+ `WALLET_PASSWORD`), runs `bag doctor`, and edits your project files. It stops to
187
+ ask you for the wallet password, for confirmation before any real on-chain
188
+ transaction, and for a faucet step if your wallet has 0 tBNB.
189
+
190
+ `bag init` emits a thin workspace root plus two independent sub-projects:
191
+ `app/agent/` (Layer A — the Agent and sole signer) and `app/service/` (Layer B
192
+ — the keyless Service). The encrypted keystore is written to the **workspace
193
+ root** `.studio/wallets/`, deliberately outside the deploy code location.
194
+
195
+ > Prefer to do it by hand? `bag init weather-seller` runs the same onboarding on
196
+ > an interactive terminal — it prompts once for the wallet password, creates the
197
+ > keystore, zero-deposit activates Pieverse, and prints testnet faucet URLs. For
198
+ > a non-Pieverse provider, set the key afterward, e.g.
199
+ > `echo "OPENROUTER_API_KEY=sk-or-..." >> weather-seller/app/agent/.env.local`.
200
+
201
+ ### 4. Run both layers locally
202
+
203
+ ```bash
204
+ bag dev # from the workspace root (or app/agent/)
205
+ ```
206
+
207
+ `bag dev` mirrors the two-artifact deploy and **launches both layers by
208
+ default**:
209
+
210
+ - **Agent** on `:8080` — Layer A, the sole signer, runs the LLM
211
+ (`POST /invocations`).
212
+ - **keyless Service** on `:8003` — Layer B, public `/apex/negotiate` +
213
+ funded-job poller.
214
+
215
+ They're wired over `STUDIO_AGENT_LOCAL_URL` and share `STORAGE_LOCAL_PATH` for
216
+ deliverable handoff. Useful flags: `--agent-only` / `--service-only`,
217
+ `--port` / `--service-port`.
218
+
219
+ Health check the Service: `curl localhost:8003/apex/health` →
220
+ `{"status":"ok","keyless":true}`. Then exercise the full negotiate path:
221
+
222
+ ```bash
223
+ curl -X POST http://localhost:8003/apex/negotiate \
224
+ -H 'Content-Type: application/json' \
225
+ -d '{"task_description": "5-day forecast for Singapore",
226
+ "terms": {"deliverables": "JSON forecast", "quality_standards": "hourly granularity"}}'
227
+ # → the Service relays the Agent's signed offer
228
+ # (the Agent prices, clamps to [min_price, max_price], then EIP-191 signs)
229
+ ```
230
+
231
+ ### 5. Deploy
232
+
233
+ When you're ready, ask Claude Code to deploy, or run it yourself. Deploy is
234
+ **two-artifact**: the Agent goes to AWS Bedrock AgentCore (invoke-only), the
235
+ keyless Service goes to an EC2 systemd host.
236
+
237
+ ```bash
238
+ agentcore configure # once — writes agentcore/agentcore.json
239
+ bag deploy agent # pushes secrets to AWS Secrets Manager, then delegates
240
+ # to `agentcore deploy`; captures the runtime ARN
241
+ bag deploy status # what still needs deploying
242
+ bag deploy verify --endpoint <service-url> # probe + reconcile your ERC-8004 record
243
+ ```
244
+
245
+ By default (`--secrets-mode secretsmanager`) the encrypted keystore is injected
246
+ into the Agent via AWS Secrets Manager (`WALLET_KEYSTORE_JSON`) and is **never**
247
+ bundled into the code package. The keyless Service never holds the key. For the
248
+ EC2 Service deploy steps, ask Claude Code to load the
249
+ `bnbagent-studio-deploying-service-to-ec2` skill.
250
+
251
+ For the complete walkthrough — IDE/skill scopes, per-project MCP wiring, the
252
+ manual two-terminal run, and the deploy details — see the
253
+ [User Guide](https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/guides/user-guide.md).
254
+
255
+ ## Direct CLI use
256
+
257
+ `bag` is also a full CLI you can run by hand. `bag --help` shows the complete
258
+ surface, and `bag <group> --help` lists a group's subcommands. The command
259
+ groups:
260
+
261
+ | Group | What it does |
262
+ |---|---|
263
+ | `init` | Scaffold a two-layer agent project (`app/agent/` + `app/service/`) + onboarding |
264
+ | `skills` | Install / remove the IDE skills (`install` / `uninstall` / `list`; `--target` / `--scope`) |
265
+ | `install` / `uninstall` | Deprecated aliases of `bag skills install` / `bag skills uninstall` |
266
+ | `dev` | Run BOTH layers locally (Agent :8080 + keyless Service :8003) |
267
+ | `doctor` | Diagnose project + environment readiness across both sub-projects |
268
+ | `wallet` | Local keystore: `new` / `show` / `list` / `sign` / `balance` / `policy` |
269
+ | `erc8004` | Identity: `register` / `show` / `resolve` / `update-endpoint` |
270
+ | `erc8183` | Commerce: `publish` / `list` / `buy` / `status` / `submit` / `fetch` / `settle` |
271
+ | `x402` | x402 payment client helpers (`quote` / `buy`) |
272
+ | `llm` | LLM provider helpers (`test` / `activate` / `status` / `topup` / `usage` / `list-models` / `rotate` / `allocate` / `auto-renew`) |
273
+ | `deploy` | Two-layer deploy flow (`prepare` / `agent` / `package` / `verify` / `status` / `destroy` / `logs` / `fix-gitignore` / `fix-a2a-disable`) |
274
+ | `mcp` | Run the read-only MCP server (`bag mcp serve` / `bag mcp tools`) |
275
+ | `bundle` | Pack an agent project + local wheels into an offline-installable tarball |
276
+ | `scan` | Detect project framework + manifest (read-only) |
277
+ | `recipe` | Emit / re-emit a single recipe layer |
278
+ | `config` | Read / write `studio.toml` (`show` / `get` / `set` / `list-keys`) |
279
+ | `env` | Edit `.env.local` idempotently (`set` / `get`) |
280
+ | `agents` | Local agent project registry (`~/.bnbagent-studio/projects.toml`) |
281
+ | `budget` | Opt-in auto-topup policy for the Pieverse LLM |
282
+ | `audit` | View the on-chain action audit log |
283
+
284
+ ### `bag dev` — the local two-service mirror
285
+
286
+ `bag dev` runs from the workspace root (or `app/agent/`) and **launches both
287
+ layers by default**:
288
+
289
+ - **Agent** on `:8080` — Layer A, the sole signer, runs the LLM (`POST /invocations`).
290
+ - **keyless Service** on `:8003` — Layer B, public `/apex/negotiate` + funded-job poller.
291
+
292
+ Flags: `--agent-only` / `--service-only`, `--port` / `--service-port`,
293
+ `--reload`.
294
+
295
+ ## 🔌 MCP server
296
+
297
+ `bag mcp serve` runs a read-only MCP server over stdio — this is what an IDE
298
+ launches. It exposes **15 read-only chain tools**:
299
+
300
+ - **Wallet & balances** — `wallet_info`, `wallet_list`, `wallet_address`,
301
+ `balance_native`, `balance_u`
302
+ - **Network & tx** — `network_info`, `tx_status`, `block_info`,
303
+ `contract_call_view`
304
+ - **ERC-8004 identity** — `agent_info`, `agent_by_address`
305
+ - **ERC-8183 commerce** — `job_status`, `job_list`, `job_count`
306
+ - **LLM usage** — `pieverse_usage`
307
+
308
+ Read-only by design: **no signing, no on-chain state change.** List the tools
309
+ with `bag mcp tools`. Wire one MCP entry per project so your AI tool reads the
310
+ right keystore + `studio.toml` — see the
311
+ [User Guide](https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/guides/user-guide.md#4-install-the-mcp-server).
312
+ Only **stdio** transport is supported in v1.
313
+
314
+ ## Relationship to `bnbagent-studio-core`
315
+
316
+ This distribution ships, under the `bag` import package: `bag/cli`, `bag/mcp`,
317
+ `bag/recipes`, `bag/utils`, `bag/skills_installer.py`, and the bundled
318
+ `skills/`.
319
+
320
+ It depends on the runtime library
321
+ **[`bnbagent-studio-core`](https://pypi.org/project/bnbagent-studio-core/)**
322
+ (import `bnbagent_studio_core`), which `pip install bnbagent-studio` pulls in
323
+ automatically.
324
+
325
+ A *deployed* Agent does **not** install this CLI — it depends only on
326
+ `bnbagent-studio-core`. `bnbagent-studio` is the dev-time tool you use to
327
+ scaffold, develop, and deploy; core is the library that runs in production.
328
+
329
+ ## 📚 Further reading
330
+
331
+ - [Main repository](https://github.com/bnb-chain/bnbagent-studio)
332
+ - [User Guide](https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/guides/user-guide.md) — full install → skills → Claude Code → `bag dev` walkthrough
333
+ - [CLI / recipe / MCP reference](https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/reference.md)
334
+ - [Architecture](https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/design/architecture.md)
335
+ - [Roadmap](https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/roadmap.md) — what's shipped and what's deferred
336
+
337
+ ## License
338
+
339
+ Apache-2.0.