intro.mdx 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. ---
  2. sidebar_position: 1
  3. ---
  4. # 💻 OpenHands
  5. OpenHands 是一个**自主 AI 软件工程师**,能够执行复杂的工程任务,并在软件开发项目中积极与用户合作。
  6. 这个项目是完全开源的,所以你可以随意使用和修改它。
  7. :::tip
  8. 在 [GitHub](https://github.com/All-Hands-AI/OpenHands) 上探索 OpenHands 的代码库或加入我们的社区!
  9. <a href="https://github.com/All-Hands-AI/OpenHands/graphs/contributors">
  10. <img
  11. src="https://img.shields.io/github/contributors/All-Hands-AI/OpenHands?style=for-the-badge"
  12. alt="Contributors"
  13. />
  14. </a>
  15. <a href="https://github.com/All-Hands-AI/OpenHands/network/members">
  16. <img
  17. src="https://img.shields.io/github/forks/All-Hands-AI/OpenHands?style=for-the-badge"
  18. alt="Forks"
  19. />
  20. </a>
  21. <a href="https://github.com/All-Hands-AI/OpenHands/stargazers">
  22. <img
  23. src="https://img.shields.io/github/stars/All-Hands-AI/OpenHands?style=for-the-badge"
  24. alt="Stargazers"
  25. />
  26. </a>
  27. <a href="https://github.com/All-Hands-AI/OpenHands/issues">
  28. <img
  29. src="https://img.shields.io/github/issues/All-Hands-AI/OpenHands?style=for-the-badge"
  30. alt="Issues"
  31. />
  32. </a>
  33. <br></br>
  34. <a href="https://github.com/All-Hands-AI/OpenHands/blob/main/LICENSE">
  35. <img
  36. src="https://img.shields.io/github/license/All-Hands-AI/OpenHands?style=for-the-badge"
  37. alt="MIT License"
  38. />
  39. </a>
  40. <br></br>
  41. <a href="https://join.slack.com/t/openhands-ai/shared_invite/zt-2wkh4pklz-w~h_DVDtEe9H5kyQlcNxVw">
  42. <img
  43. src="https://img.shields.io/badge/Slack-Join%20Us-red?logo=slack&logoColor=white&style=for-the-badge"
  44. alt="Join our Slack community"
  45. />
  46. </a>
  47. <a href="https://discord.gg/ESHStjSjD4">
  48. <img
  49. src="https://img.shields.io/badge/Discord-Join%20Us-purple?logo=discord&logoColor=white&style=for-the-badge"
  50. alt="Join our Discord community"
  51. />
  52. </a>
  53. :::
  54. ## 🛠️ 入门指南
  55. 运行 OpenHands 最简单的方法是在 Docker 容器中。它在 Docker 的最新版本 `26.0.0` 上运行效果最佳。
  56. 你必须使用 Linux、Mac OS 或 Windows 上的 WSL。
  57. 要在 Docker 容器中启动 OpenHands,请在终端中运行以下命令:
  58. :::warning
  59. 运行以下命令时,`./workspace` 中的文件可能会被修改或删除。
  60. :::
  61. ```bash
  62. WORKSPACE_BASE=$(pwd)/workspace
  63. docker run -it \
  64. --pull=always \
  65. -e SANDBOX_USER_ID=$(id -u) \
  66. -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
  67. -v $WORKSPACE_BASE:/opt/workspace_base \
  68. -v /var/run/docker.sock:/var/run/docker.sock \
  69. -p 3000:3000 \
  70. --add-host host.docker.internal:host-gateway \
  71. --name openhands-app-$(date +%Y%m%d%H%M%S) \
  72. ghcr.io/all-hands-ai/openhands:main
  73. ```
  74. 你会发现 OpenHands 在 [http://localhost:3000](http://localhost:3000) 运行,并可以访问 `./workspace`。要让 OpenHands 操作你的代码,请将代码放在 `./workspace` 中。
  75. OpenHands 只会访问这个工作区文件夹。它在一个安全的 docker 沙盒中运行,不会影响你系统的其他部分。
  76. :::tip
  77. 如果你想使用**(不稳定!)**最新版本,可以使用 `ghcr.io/all-hands-ai/openhands:main` 作为镜像(最后一行)。
  78. :::
  79. 有关开发工作流程,请参阅 [Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md)。
  80. 遇到问题了吗?查看我们的 [故障排除指南](https://docs.all-hands.dev/modules/usage/troubleshooting)。
  81. :::warning
  82. OpenHands 目前正在开发中,但你已经可以运行 alpha 版本来查看端到端系统的运作情况。
  83. :::
  84. [contributors-shield]: https://img.shields.io/github/contributors/All-Hands-AI/OpenHands?style=for-the-badge
  85. [contributors-url]: https://github.com/All-Hands-AI/OpenHands/graphs/contributors
  86. [forks-shield]: https://img.shields.io/github/forks/All-Hands-AI/OpenHands?style=for-the-badge
  87. [forks-url]: https://github.com/All-Hands-AI/OpenHands/network/members
  88. [stars-shield]: https://img.shields.io/github/stars/All-Hands-AI/OpenHands?style=for-the-badge
  89. [stars-url]: https://github.com/All-Hands-AI/OpenHands/stargazers
  90. [issues-shield]: https://img.shields.io/github/issues/All-Hands-AI/OpenHands?style=for-the-badge
  91. [issues-url]: https://github.com/All-Hands-AI/OpenHands/issues
  92. [license-shield]: https://img.shields.io/github/license/All-Hands-AI/OpenHands?style=for-the-badge
  93. [license-url]: https://github.com/All-Hands-AI/OpenHands/blob/main/LICENSE