use-algokit-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AlgoKit Commands

AlgoKit 命令

Standard commands for Algorand development with AlgoKit CLI.
使用AlgoKit CLI进行Algorand开发的标准命令。

Overview / Core Workflow

概述 / 核心工作流

  1. Write contract code
  2. Build:
    algokit project run build
  3. Write tests using generated clients
  4. Test:
    algokit project run test
  5. Deploy:
    algokit project deploy localnet
  1. 编写合约代码
  2. 构建:
    algokit project run build
  3. 使用生成的客户端编写测试用例
  4. 测试:
    algokit project run test
  5. 部署:
    algokit project deploy localnet

How to proceed

操作步骤

  1. Build contracts:
    bash
    algokit project run build
    This compiles contracts via Puya, generates ARC56 specs, and creates typed clients.
  2. Run tests:
    bash
    algokit project run test
    Executes the test suite using Vitest.
  3. Start localnet (if needed):
    bash
    algokit localnet start
  4. Deploy to localnet:
    bash
    algokit project deploy localnet
  5. Check build artifacts:
    • artifacts/
      — Compiled contracts, ARC56 specs
    • Generated client files for TypeScript/Python
  1. 构建合约:
    bash
    algokit project run build
    该命令会通过Puya编译合约,生成ARC56规范,并创建类型化客户端。
  2. 运行测试:
    bash
    algokit project run test
    使用Vitest执行测试套件。
  3. 启动localnet(如有需要):
    bash
    algokit localnet start
  4. 部署到localnet:
    bash
    algokit project deploy localnet
  5. 查看构建产物:
    • artifacts/
      — 编译后的合约、ARC56规范
    • 生成的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

常见场景 / 边界情况

ScenarioCommand
Start local network
algokit localnet start
Stop local network
algokit localnet stop
Reset network state
algokit localnet reset
Check network status
algokit localnet status
Build failsCheck Puya compiler errors, fix contract code
Tests failCheck test assertions, fix contract or test code
场景命令
启动本地网络
algokit localnet start
停止本地网络
algokit localnet stop
重置网络状态
algokit localnet reset
查看网络状态
algokit localnet status
构建失败检查Puya编译器错误,修复合约代码
测试失败检查测试断言,修复合约或测试代码

References / Further Reading

参考资料 / 拓展阅读