use-algokit-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAlgoKit Commands
AlgoKit 命令
Standard commands for Algorand development with AlgoKit CLI.
使用AlgoKit CLI进行Algorand开发的标准命令。
Overview / Core Workflow
概述 / 核心工作流
- Write contract code
- Build:
algokit project run build - Write tests using generated clients
- Test:
algokit project run test - Deploy:
algokit project deploy localnet
- 编写合约代码
- 构建:
algokit project run build - 使用生成的客户端编写测试用例
- 测试:
algokit project run test - 部署:
algokit project deploy localnet
How to proceed
操作步骤
-
Build contracts:bash
algokit project run buildThis compiles contracts via Puya, generates ARC56 specs, and creates typed clients. -
Run tests:bash
algokit project run testExecutes the test suite using Vitest. -
Start localnet (if needed):bash
algokit localnet start -
Deploy to localnet:bash
algokit project deploy localnet -
Check build artifacts:
- — Compiled contracts, ARC56 specs
artifacts/ - Generated client files for TypeScript/Python
-
构建合约:bash
algokit project run build该命令会通过Puya编译合约,生成ARC56规范,并创建类型化客户端。 -
运行测试:bash
algokit project run test使用Vitest执行测试套件。 -
启动localnet(如有需要):bash
algokit localnet start -
部署到localnet:bash
algokit project deploy localnet -
查看构建产物:
- — 编译后的合约、ARC56规范
artifacts/ - 生成的TypeScript/Python客户端文件
Important Rules / Guidelines
重要规则 / 指南
- Always build before testing — Tests use generated clients
- Only deploy when explicitly requested — Don't auto-deploy
- Check localnet status before deployment operations
- Reset localnet if you need a clean state
- 测试前务必先构建 — 测试依赖生成的客户端
- 仅在明确要求时才执行部署 — 不要自动部署
- 部署操作前检查localnet状态
- 如需干净的环境可重置localnet
Common Variations / Edge Cases
常见场景 / 边界情况
| Scenario | Command |
|---|---|
| Start local network | |
| Stop local network | |
| Reset network state | |
| Check network status | |
| Build fails | Check Puya compiler errors, fix contract code |
| Tests fail | Check test assertions, fix contract or test code |
| 场景 | 命令 |
|---|---|
| 启动本地网络 | |
| 停止本地网络 | |
| 重置网络状态 | |
| 查看网络状态 | |
| 构建失败 | 检查Puya编译器错误,修复合约代码 |
| 测试失败 | 检查测试断言,修复合约或测试代码 |
References / Further Reading
参考资料 / 拓展阅读
- Full CLI Reference
- AlgoKit CLI Documentation
- AlgoKit Project Commands
- 完整CLI参考
- AlgoKit CLI 文档
- AlgoKit 项目命令