Loading...
Loading...
Compare original and translation side by side
Quick reference: The general aixyz skill lives at skills.sh/agentlyhq/aixyz. Consult it for full CLI flags and advanced topics. This guide focuses on the path that matters most to openclaw users.
快速参考: 通用aixyz skill地址为 skills.sh/agentlyhq/aixyz。你可以查阅该页面获取完整的CLI参数和高级主题内容,本指南仅聚焦于openclaw用户最关心的操作路径。
undefinedundefined
Verify:
```bash
bun --version # should print 1.3 or higherWhy Bun? The aixyz build pipeline uses Bun's native build API and plugin system — this is a hard architectural requirement, not a preference. The CLI () cannot run on Node. Bun also includes a built-in test runner, which means no extra test framework is needed. Curious about the full rationale? Read Why Bun.@aixyz/cli
验证安装:
```bash
bun --version # 输出应为1.3或更高版本为什么使用Bun? aixyz构建流水线使用Bun原生构建API和插件系统——这是硬性架构要求,而非偏好选择。CLI工具()无法在Node环境下运行。Bun还内置了测试运行器,无需额外安装测试框架。想要了解完整的设计逻辑,可以阅读为什么选择Bun。@aixyz/cli
undefinedundefined
This creates:
Open `.env.local` and add your LLM provider's API key. The default scaffold uses `@ai-sdk/openai`, so add:
If you prefer a different provider (Anthropic, Google, Amazon Bedrock, etc.), swap the `@ai-sdk/*` adapter in `package.json` and `app/agent.ts`, then set the corresponding env var instead. See [ai-sdk.dev](https://ai-sdk.dev) for the full list of providers.
Run locally to test:
```bash
bun run dev
执行后会生成以下目录结构:
打开`.env.local`文件,添加你的LLM服务提供商的API密钥。默认项目骨架使用`@ai-sdk/openai`,所以添加以下内容:
如果你偏好其他提供商(Anthropic、Google、Amazon Bedrock等),可以替换`package.json`和`app/agent.ts`中的`@ai-sdk/*`适配器,然后设置对应的环境变量即可。你可以访问[ai-sdk.dev](https://ai-sdk.dev)查看完整的支持提供商列表。
本地运行测试:
```bash
bun run dev
---
---bun run build.vercel/outputOPENAI_API_KEYhttps://my-agent.vercel.appbun run build.vercel/outputOPENAI_API_KEYhttps://my-agent.vercel.app| Platform | Free tier | Notes |
|---|---|---|
| Railway | 5 USD/month credit | Easiest Docker-free deploy |
| Render | Generous free tier | Sleeps after inactivity |
| Fly.io | Free allowance | More control, steeper learning curve |
OPENAI_API_KEY🔒 Least-privilege rule: When exposing the agent process, only open the port the agent listens on (default). Do not grant the process broader network, IAM, or filesystem access than it needs to serve HTTP requests.3000
undefined🔒 最小权限原则: 暴露Agent服务时,仅开放Agent监听的端口(默认3000)。不要为进程授予超出服务HTTP请求所需的网络、IAM或文件系统权限。
undefined
> ⚠️ **Security warning:** Local tunnels are fine for short-lived testing but should **never** be used for a production agent. Anyone who discovers the URL can send requests to your machine. Always use a proper hosting provider for live traffic.
---
> ⚠️ **安全警告:** 本地隧道仅适合短期测试,**绝对不要**用于生产环境Agent。任何发现URL的人都可以向你的机器发送请求,生产流量请始终使用正规的托管服务商。
---use-agentlyuse-agentlyuse-agentlyaixyz erc-8004 register🔐 Private key security — read this carefully:
- Never share your private key with anyone. Anyone who has it controls your funds.
- Never commit it to git or paste it in public channels (Discord, Slack, GitHub, etc.).
- Write it down offline and store it somewhere safe (e.g., a password manager).
- For a production agent that earns significant income, consider a hardware wallet (Ledger, Trezor).
use-agentlyaixyz erc-8004 register🔐 私钥安全注意事项 — 请仔细阅读:
- 永远不要把你的私钥分享给任何人,任何持有私钥的人都可以控制你的资产。
- 永远不要把私钥提交到git,也不要粘贴到公开渠道(Discord、Slack、GitHub等)。
- 离线记录私钥,存储在安全的地方(比如密码管理器)。
- 对于能获得可观收入的生产环境Agent,建议使用硬件钱包(Ledger、Trezor)。
0x…0x…Your wallet address is your "bank account number." You share it publicly. Your private key / seed phrase is your password — never share it, never commit it to code.
你的钱包地址就是你的"银行账号",可以公开分享。你的私钥/助记词是你的密码 — 永远不要分享,永远不要提交到代码中。
| Network | Coin needed | Where to get it |
|---|---|---|
| Ethereum mainnet | ETH | Coinbase, Binance, Kraken |
| BNB Smart Chain | BNB | Binance |
| Base | ETH | Coinbase (Base is a Coinbase L2) |
| Polygon | POL | Coinbase, Binance |
No crypto yet? You can still build and run your agent locally and on Vercel without registration. Register once you are ready to be publicly discoverable.
| 网络 | 需要的代币 | 获取地址 |
|---|---|---|
| Ethereum mainnet | ETH | Coinbase, Binance, Kraken |
| BNB Smart Chain | BNB | Binance |
| Base | ETH | Coinbase (Base是Coinbase推出的L2网络) |
| Polygon | POL | Coinbase, Binance |
还没有加密货币? 你仍然可以在本地和Vercel上构建运行Agent,无需注册。等你准备好公开让用户发现时再注册即可。
undefinedundefined
The CLI will ask for (or accept as flags):
| Prompt | Flag | What to enter |
| ------------------ | --------------- | -------------------------------------------------- |
| Agent URL | `--url` | Your deployed URL from Step 3 |
| Chain | `--chain` | `base` (recommended), `ethereum`, `bsc`, `polygon` |
| Wallet private key | `--private-key` | The key from your wallet (never share this) |
| Trust mechanisms | `--trust` | Accept the default |
| Broadcast | `--broadcast` | Pass this flag to actually submit on-chain |
See all flags:
```bash
aixyz erc-8004 register --help
CLI会要求你输入(或通过flag传入)以下内容:
| 提示项 | 参数名 | 输入内容 |
| ---------------- | --------------- | ----------------------------------------- |
| Agent URL | `--url` | 你在步骤3中获得的部署URL |
| 链 | `--chain` | `base` (推荐), `ethereum`, `bsc`, `polygon` |
| 钱包私钥 | `--private-key` | 你的钱包私钥(永远不要分享) |
| 信任机制 | `--trust` | 接受默认值即可 |
| 广播交易 | `--broadcast` | 传入该参数才会真实提交链上交易 |
查看所有可用参数:
```bash
aixyz erc-8004 register --helpacceptsapp/agent.tsimport type { Accepts } from "aixyz/accepts";
// Gate the /agent endpoint — callers pay $0.005 per request
export const accepts: Accepts = { scheme: "exact", price: "$0.005" };aixyz.config.tsexport default {
name: "my-agent",
// ...
x402: {
payTo: "0xYourWalletAddress", // ← paste your address from Step 4
},
} satisfies AixyzConfig;bunx create-aixyz-app my-agent --yes --pay-to 0xYourWalletAddressPayments flow directly to your wallet — no platform takes a cut.
app/agent.tsacceptsimport type { Accepts } from "aixyz/accepts";
// 对/agent端点进行收费 — 调用者每次请求支付0.005美元
export const accepts: Accepts = { scheme: "exact", price: "$0.005" };aixyz.config.tsexport default {
name: "my-agent",
// ...
x402: {
payTo: "0xYourWalletAddress", // ← 粘贴你在步骤4中获得的地址
},
} satisfies AixyzConfig;bunx create-aixyz-app my-agent --yes --pay-to 0xYourWalletAddress付款会直接进入你的钱包,平台不会抽取任何分成。
bun run devOPENAI_API_KEYaixyz.config.tsnamedescriptionpayToacceptsbun run devOPENAI_API_KEYaixyz.config.tsnamedescriptionpayToacceptsRegistration is only half the work. Getting on-chain doesn't automatically bring users. You need to actively promote your agent.
注册只是一半的工作,上链并不会自动带来用户,你需要主动推广你的Agent。
descriptionaixyz.config.tsapp/icon.pngaixyz.config.tsdescriptionapp/icon.png/.well-known/agent-card.json/.well-known/agent-card.json$0.001$0.01$0.001$0.01aixyz erc-8004 update --helpaixyz erc-8004 update --helpsource ~/.bashrcsource ~/.zshrcsource ~/.bashrcsource ~/.zshrc.env.local.env.localbun run buildbun run buildpayToaixyz.config.tsaixyz.config.tspayTo