@tencent-ai/agent-sdk 0.3.99 → 0.3.100
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.
- package/cli/CHANGELOG.md +26 -0
- package/cli/dist/codebuddy-headless.js +53 -53
- package/cli/dist/web-ui/assets/index-BoMlEqUE.js +439 -0
- package/cli/dist/web-ui/assets/index-Dt1puyHn.css +32 -0
- package/cli/dist/web-ui/docs/cn/cli/acp.md +152 -0
- package/cli/dist/web-ui/docs/cn/cli/agent-teams.md +327 -0
- package/cli/dist/web-ui/docs/cn/cli/bash-sandboxing.md +290 -0
- package/cli/dist/web-ui/docs/cn/cli/best-practices.md +554 -0
- package/cli/dist/web-ui/docs/cn/cli/channels-reference.md +293 -0
- package/cli/dist/web-ui/docs/cn/cli/channels.md +215 -0
- package/cli/dist/web-ui/docs/cn/cli/checkpointing.md +51 -0
- package/cli/dist/web-ui/docs/cn/cli/cli-reference.md +187 -0
- package/cli/dist/web-ui/docs/cn/cli/common-workflows.md +1013 -0
- package/cli/dist/web-ui/docs/cn/cli/costs.md +174 -0
- package/cli/dist/web-ui/docs/cn/cli/devcontainer.md +553 -0
- package/cli/dist/web-ui/docs/cn/cli/env-vars.md +326 -0
- package/cli/dist/web-ui/docs/cn/cli/gitlab-ci-cd.md +357 -0
- package/cli/dist/web-ui/docs/cn/cli/headless.md +258 -0
- package/cli/dist/web-ui/docs/cn/cli/hooks-guide.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/hooks.md +805 -0
- package/cli/dist/web-ui/docs/cn/cli/iam.md +530 -0
- package/cli/dist/web-ui/docs/cn/cli/ide-integrations.md +92 -0
- package/cli/dist/web-ui/docs/cn/cli/installation.md +291 -0
- package/cli/dist/web-ui/docs/cn/cli/interactive-mode.md +233 -0
- package/cli/dist/web-ui/docs/cn/cli/mcp.md +739 -0
- package/cli/dist/web-ui/docs/cn/cli/memory.md +436 -0
- package/cli/dist/web-ui/docs/cn/cli/models.md +356 -0
- package/cli/dist/web-ui/docs/cn/cli/overview.md +100 -0
- package/cli/dist/web-ui/docs/cn/cli/plugin-marketplaces.md +533 -0
- package/cli/dist/web-ui/docs/cn/cli/plugins-reference.md +774 -0
- package/cli/dist/web-ui/docs/cn/cli/plugins.md +689 -0
- package/cli/dist/web-ui/docs/cn/cli/quickstart.md +249 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/README.md +199 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.10.0.md +23 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.10.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.11.0.md +24 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.12.0.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.13.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.14.0.md +22 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.14.1.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.15.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.15.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.16.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.17.0.md +29 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.18.0.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.19.0.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.19.1.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.19.2.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.20.0.md +23 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.20.1.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.21.0.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.22.0.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.3.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.4.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.5.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.24.0.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.25.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.25.1.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.26.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.0.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.1.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.2.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.3.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.28.0.md +26 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.28.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.29.0.md +35 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.3.1.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.30.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.30.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.31.0.md +51 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.31.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.31.2.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.32.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.33.0.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.33.1.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.36.3.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.0.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.1.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.10.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.11.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.12.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.13.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.14.md +24 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.15.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.16.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.17.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.18.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.19.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.2.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.20.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.3.md +22 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.4.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.5.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.6.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.7.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.8.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.9.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.38.0.md +22 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.38.1.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.38.2.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.39.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.4.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.40.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.40.1.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.0.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.1.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.3.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.4.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.5.md +10 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.6.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.7.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.8.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.42.0.md +39 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.42.1.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.42.3.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.43.0.md +27 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.43.1.md +27 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.44.0.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.44.1.md +22 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.45.0.md +34 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.45.1.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.46.0.md +12 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.47.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.48.0.md +32 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.48.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.0.md +26 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.1.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.2.md +39 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.3.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.5.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.6.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.7.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.5.0.md +24 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.0.md +25 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.1.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.2.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.3.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.4.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.5.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.6.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.7.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.51.0.md +24 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.51.1.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.51.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.0.md +30 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.1.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.2.md +12 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.3.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.4.md +27 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.5.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.6.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.53.0.md +29 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.54.0.md +26 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.55.0.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.55.1.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.56.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.56.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.57.0.md +32 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.57.1.md +10 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.58.0.md +34 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.59.0.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.6.0.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.6.1.md +10 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.60.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.0.md +29 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.2.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.3.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.62.0.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.62.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.2.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.3.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.4.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.5.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.64.0.md +37 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.64.1.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.64.2.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.65.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.65.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.66.0.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.66.1.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.66.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.67.0.md +33 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.7.0.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.1.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.3.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.4.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.5.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.6.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.9.0.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/remote-control.md +247 -0
- package/cli/dist/web-ui/docs/cn/cli/sandboxing.md +316 -0
- package/cli/dist/web-ui/docs/cn/cli/scheduled-tasks.md +161 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-custom-tools.md +1195 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-demos.md +347 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-hooks.md +803 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-mcp.md +643 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-permissions.md +501 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-python.md +783 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-sessions.md +332 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-typescript.md +759 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk.md +1105 -0
- package/cli/dist/web-ui/docs/cn/cli/security.md +387 -0
- package/cli/dist/web-ui/docs/cn/cli/settings.md +602 -0
- package/cli/dist/web-ui/docs/cn/cli/skills.md +448 -0
- package/cli/dist/web-ui/docs/cn/cli/slash-commands.md +397 -0
- package/cli/dist/web-ui/docs/cn/cli/statusline.md +525 -0
- package/cli/dist/web-ui/docs/cn/cli/sub-agents.md +634 -0
- package/cli/dist/web-ui/docs/cn/cli/terminal-config.md +77 -0
- package/cli/dist/web-ui/docs/cn/cli/tools-reference.md +99 -0
- package/cli/dist/web-ui/docs/cn/cli/troubleshooting.md +190 -0
- package/cli/dist/web-ui/docs/cn/cli/web-ui.md +164 -0
- package/cli/dist/web-ui/docs/cn/cli/wecom-bot-setup.md +274 -0
- package/cli/dist/web-ui/docs/cn/cli/worktree.md +660 -0
- package/cli/dist/web-ui/docs/en/cli/acp.md +126 -0
- package/cli/dist/web-ui/docs/en/cli/agent-teams.md +327 -0
- package/cli/dist/web-ui/docs/en/cli/bash-sandboxing.md +357 -0
- package/cli/dist/web-ui/docs/en/cli/best-practices.md +554 -0
- package/cli/dist/web-ui/docs/en/cli/channels-reference.md +293 -0
- package/cli/dist/web-ui/docs/en/cli/channels.md +215 -0
- package/cli/dist/web-ui/docs/en/cli/checkpointing.md +53 -0
- package/cli/dist/web-ui/docs/en/cli/cli-reference.md +187 -0
- package/cli/dist/web-ui/docs/en/cli/common-workflows.md +1011 -0
- package/cli/dist/web-ui/docs/en/cli/costs.md +174 -0
- package/cli/dist/web-ui/docs/en/cli/devcontainer.md +553 -0
- package/cli/dist/web-ui/docs/en/cli/env-vars.md +326 -0
- package/cli/dist/web-ui/docs/en/cli/gitlab-ci-cd.md +357 -0
- package/cli/dist/web-ui/docs/en/cli/headless.md +258 -0
- package/cli/dist/web-ui/docs/en/cli/hooks-guide.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/hooks.md +801 -0
- package/cli/dist/web-ui/docs/en/cli/iam.md +526 -0
- package/cli/dist/web-ui/docs/en/cli/ide-integrations.md +92 -0
- package/cli/dist/web-ui/docs/en/cli/installation.md +266 -0
- package/cli/dist/web-ui/docs/en/cli/interactive-mode.md +233 -0
- package/cli/dist/web-ui/docs/en/cli/mcp.md +739 -0
- package/cli/dist/web-ui/docs/en/cli/memory.md +436 -0
- package/cli/dist/web-ui/docs/en/cli/models.md +355 -0
- package/cli/dist/web-ui/docs/en/cli/overview.md +100 -0
- package/cli/dist/web-ui/docs/en/cli/plugin-marketplaces.md +534 -0
- package/cli/dist/web-ui/docs/en/cli/plugins-reference.md +774 -0
- package/cli/dist/web-ui/docs/en/cli/plugins.md +688 -0
- package/cli/dist/web-ui/docs/en/cli/quickstart.md +249 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/README.md +193 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.10.0.md +23 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.10.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.11.0.md +24 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.12.0.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.13.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.14.0.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.14.1.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.15.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.15.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.16.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.17.0.md +29 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.18.0.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.19.0.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.19.1.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.19.2.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.20.0.md +23 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.20.1.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.21.0.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.22.0.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.0.md +41 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.3.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.4.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.5.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.24.0.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.25.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.25.1.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.26.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.0.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.1.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.2.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.3.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.28.0.md +26 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.28.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.29.0.md +35 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.3.1.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.30.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.30.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.31.0.md +51 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.31.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.31.2.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.32.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.33.0.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.33.1.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.34.0.md +27 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.34.1.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.35.0.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.0.md +23 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.2.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.3.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.0.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.1.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.10.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.11.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.12.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.13.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.14.md +24 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.15.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.16.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.17.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.18.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.19.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.2.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.20.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.3.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.4.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.5.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.6.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.7.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.8.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.9.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.38.0.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.38.1.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.38.2.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.39.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.4.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.40.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.40.1.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.0.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.1.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.3.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.4.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.5.md +10 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.6.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.7.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.8.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.42.0.md +39 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.42.1.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.42.3.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.43.0.md +27 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.43.1.md +27 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.44.0.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.44.1.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.45.0.md +34 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.45.1.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.46.0.md +12 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.47.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.48.0.md +32 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.48.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.0.md +26 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.1.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.2.md +39 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.3.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.5.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.6.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.7.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.5.0.md +24 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.0.md +25 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.1.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.2.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.3.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.4.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.5.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.6.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.7.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.51.0.md +24 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.51.1.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.51.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.0.md +30 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.1.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.2.md +12 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.3.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.4.md +27 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.5.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.6.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.53.0.md +29 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.54.0.md +26 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.55.0.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.55.1.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.56.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.56.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.57.0.md +32 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.57.1.md +10 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.58.0.md +34 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.59.0.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.6.0.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.6.1.md +10 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.60.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.0.md +29 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.2.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.3.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.62.0.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.62.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.2.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.3.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.4.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.5.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.64.0.md +37 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.64.1.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.64.2.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.65.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.65.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.66.0.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.66.1.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.66.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.67.0.md +33 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.7.0.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.1.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.3.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.4.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.5.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.6.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.9.0.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/remote-control.md +247 -0
- package/cli/dist/web-ui/docs/en/cli/sandboxing.md +316 -0
- package/cli/dist/web-ui/docs/en/cli/scheduled-tasks.md +160 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-custom-tools.md +1131 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-demos.md +347 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-hooks.md +813 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-mcp.md +645 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-permissions.md +461 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-python.md +797 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-sessions.md +340 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-typescript.md +770 -0
- package/cli/dist/web-ui/docs/en/cli/sdk.md +1103 -0
- package/cli/dist/web-ui/docs/en/cli/security.md +388 -0
- package/cli/dist/web-ui/docs/en/cli/settings.md +602 -0
- package/cli/dist/web-ui/docs/en/cli/skills.md +448 -0
- package/cli/dist/web-ui/docs/en/cli/slash-commands.md +397 -0
- package/cli/dist/web-ui/docs/en/cli/statusline.md +525 -0
- package/cli/dist/web-ui/docs/en/cli/sub-agents.md +621 -0
- package/cli/dist/web-ui/docs/en/cli/terminal-config.md +77 -0
- package/cli/dist/web-ui/docs/en/cli/tools-reference.md +99 -0
- package/cli/dist/web-ui/docs/en/cli/troubleshooting.md +190 -0
- package/cli/dist/web-ui/docs/en/cli/web-ui.md +164 -0
- package/cli/dist/web-ui/docs/en/cli/wecom-bot-setup.md +274 -0
- package/cli/dist/web-ui/docs/en/cli/worktree.md +660 -0
- package/cli/dist/web-ui/docs/search-index-en.json +1 -0
- package/cli/dist/web-ui/docs/search-index-zh.json +1 -0
- package/cli/dist/web-ui/docs/sidebar-en.json +1 -0
- package/cli/dist/web-ui/docs/sidebar-zh.json +1 -0
- package/cli/dist/web-ui/index.html +2 -2
- package/cli/package.json +1 -1
- package/cli/product.cloudhosted.json +2 -2
- package/cli/product.internal.json +2 -2
- package/cli/product.ioa.json +2 -2
- package/cli/product.json +3 -3
- package/cli/product.selfhosted.json +2 -2
- package/package.json +1 -1
- package/cli/dist/web-ui/assets/index-BPT-qRRx.js +0 -411
- package/cli/dist/web-ui/assets/index-f_ibHSHw.css +0 -32
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
# Git Worktree Support
|
|
2
|
+
|
|
3
|
+
> Run CodeBuddy in isolated workspaces for parallel development and safe isolation.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Git worktree allows you to have multiple working directories simultaneously within the same repository, each checked out to a different branch. CodeBuddy Code leverages this feature to provide:
|
|
8
|
+
|
|
9
|
+
- **Parallel development**: Perform experimental development without affecting the main workspace
|
|
10
|
+
- **Safe isolation**: All AI changes are made in a separate directory
|
|
11
|
+
- **Zero storage overhead**: Worktrees share Git objects without duplicating the entire repository
|
|
12
|
+
- **Sub-agent isolation**: Multiple AI sub-agents can work in parallel in independent worktrees
|
|
13
|
+
- **tmux integration**: Optionally run in a dedicated tmux session
|
|
14
|
+
- **Non-Git support**: SVN, Perforce, and other projects can also use worktree isolation via WorktreeCreate/WorktreeRemove hooks
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Create a worktree with an auto-generated name
|
|
20
|
+
codebuddy --worktree
|
|
21
|
+
|
|
22
|
+
# Create a worktree with a specific name
|
|
23
|
+
codebuddy --worktree feature-auth
|
|
24
|
+
|
|
25
|
+
# Create a worktree based on a specific branch
|
|
26
|
+
codebuddy --worktree --worktree-branch origin/develop # Based on remote develop branch
|
|
27
|
+
codebuddy --worktree --worktree-branch feature/foo # Based on local feature/foo branch
|
|
28
|
+
|
|
29
|
+
# Run in a tmux session (recommended for long-running tasks)
|
|
30
|
+
codebuddy --worktree --tmux
|
|
31
|
+
|
|
32
|
+
# Create a worktree based on a PR/MR (for code review)
|
|
33
|
+
codebuddy --worktree "#123" # GitHub PR number
|
|
34
|
+
codebuddy --worktree "https://github.com/owner/repo/pull/123" # GitHub PR URL
|
|
35
|
+
codebuddy --worktree "https://gitlab.com/owner/repo/-/merge_requests/456" # GitLab MR URL
|
|
36
|
+
codebuddy --worktree "https://cnb.woa.com/owner/repo/-/pulls/789" # CNB PR URL
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Creating Within a Session
|
|
40
|
+
|
|
41
|
+
After starting a CodeBuddy Code session, you can create a worktree via natural language:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
> start a worktree
|
|
45
|
+
> work in a worktree
|
|
46
|
+
> 启动 worktree
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The AI will automatically invoke the `EnterWorktree` tool to create an isolated working directory and switch to it.
|
|
50
|
+
|
|
51
|
+
> **Note**: This is only triggered when "worktree" is explicitly mentioned. Saying "create a branch for me" or "fix this bug" will not automatically create a worktree.
|
|
52
|
+
|
|
53
|
+
## CLI Parameters
|
|
54
|
+
|
|
55
|
+
| Parameter | Description | Example |
|
|
56
|
+
|:----------|:------------|:--------|
|
|
57
|
+
| `--worktree [name]` | Create and enter a worktree | `--worktree` or `--worktree my-feature` |
|
|
58
|
+
| `--worktree-branch <branch>` | Specify the base branch (requires `--worktree`) | `--worktree-branch origin/develop` or `--worktree-branch feature/foo` |
|
|
59
|
+
| `--tmux` | Run in a tmux session (requires tmux installed) | `--worktree --tmux` |
|
|
60
|
+
| `--tmux-classic` | Use classic tmux mode (without popup) | `--worktree --tmux --tmux-classic` |
|
|
61
|
+
|
|
62
|
+
## Workflow
|
|
63
|
+
|
|
64
|
+
### Creating a Worktree
|
|
65
|
+
|
|
66
|
+
When starting with the `--worktree` parameter:
|
|
67
|
+
|
|
68
|
+
1. CodeBuddy creates a new worktree under the `.codebuddy/worktrees/` directory
|
|
69
|
+
2. Determines the base branch:
|
|
70
|
+
- If `--worktree-branch origin/xxx` is specified, uses the remote branch `origin/xxx`
|
|
71
|
+
- If `--worktree-branch xxx` is specified, uses the local branch `xxx`
|
|
72
|
+
- If not specified, defaults to the remote default branch (usually `origin/main` or `origin/master`)
|
|
73
|
+
3. Automatically creates a corresponding branch (e.g., `worktree-feature-auth`)
|
|
74
|
+
4. Switches the working directory to the worktree
|
|
75
|
+
5. Runs initialization (copies settings, creates symlinks, copies `.worktreeinclude` files, etc.)
|
|
76
|
+
|
|
77
|
+
**Behavior when the branch does not exist**:
|
|
78
|
+
- If the specified branch (remote or local) does not exist, a warning is printed and the creation falls back to the remote default branch
|
|
79
|
+
- The startup process is not interrupted
|
|
80
|
+
|
|
81
|
+
### Options on Exit
|
|
82
|
+
|
|
83
|
+
When you exit a worktree session, CodeBuddy detects changes and offers options:
|
|
84
|
+
|
|
85
|
+
- **Keep Worktree**: Preserve all changes and the branch for later continuation
|
|
86
|
+
- **Remove Worktree**: Clean up the worktree and associated branch
|
|
87
|
+
- **Keep but exit tmux**: (tmux mode) Preserve the worktree but close the tmux session
|
|
88
|
+
|
|
89
|
+
### Change Detection
|
|
90
|
+
|
|
91
|
+
Before exiting, CodeBuddy checks for:
|
|
92
|
+
|
|
93
|
+
- Uncommitted file changes
|
|
94
|
+
- Unpushed commits
|
|
95
|
+
|
|
96
|
+
If no changes are detected, the worktree is automatically cleaned up.
|
|
97
|
+
|
|
98
|
+
## Configuration
|
|
99
|
+
|
|
100
|
+
Configure worktree behavior in `settings.json`:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"worktree": {
|
|
105
|
+
"symlinkDirectories": ["node_modules", ".next", ".cache", "dist"]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Configuration Options
|
|
111
|
+
|
|
112
|
+
| Option | Description | Default |
|
|
113
|
+
|:-------|:------------|:--------|
|
|
114
|
+
| `symlinkDirectories` | Directories to symlink from the main repository to the worktree | `[]` |
|
|
115
|
+
|
|
116
|
+
Symlinked directories avoid redundant dependency installation in each worktree, saving time and disk space.
|
|
117
|
+
|
|
118
|
+
### Syncing Local Ignored Files (.worktreeinclude)
|
|
119
|
+
|
|
120
|
+
Local configuration files like `.env.local` and `.env.development` are typically excluded by `.gitignore`, but new worktrees need them to function properly.
|
|
121
|
+
|
|
122
|
+
**Solution**: Create a `.worktreeinclude` file in the repository root listing files to copy (uses the same syntax as `.gitignore`):
|
|
123
|
+
|
|
124
|
+
```gitignore
|
|
125
|
+
# .worktreeinclude
|
|
126
|
+
# List local files to copy to new worktrees
|
|
127
|
+
|
|
128
|
+
# Environment variables
|
|
129
|
+
.env.local
|
|
130
|
+
.env.development.local
|
|
131
|
+
.env.test.local
|
|
132
|
+
|
|
133
|
+
# Local IDE configuration
|
|
134
|
+
.vscode/settings.json
|
|
135
|
+
|
|
136
|
+
# Local certificates or keys (if any)
|
|
137
|
+
certs/localhost.pem
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
These files are automatically copied from the main repository root each time a new worktree is created. **Files are not re-copied when reusing an existing worktree**.
|
|
141
|
+
|
|
142
|
+
> **Tip**: `.worktreeinclude` should be committed to Git so all team members benefit.
|
|
143
|
+
|
|
144
|
+
## Hook-based Worktree
|
|
145
|
+
|
|
146
|
+
By default, the worktree feature relies on the built-in `git worktree` command. For projects using SVN, Perforce, or those without version control, you can use worktree isolation by configuring **WorktreeCreate / WorktreeRemove hooks**.
|
|
147
|
+
|
|
148
|
+
### Decision Priority
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
1. WorktreeCreate hook configured? → Use hook to create (takes priority even in a Git repo)
|
|
152
|
+
2. In a Git repository? → Use git worktree
|
|
153
|
+
3. Neither? → Error with a prompt to configure hooks
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Core rules**:
|
|
157
|
+
- **Hooks take priority over Git**: Once a WorktreeCreate hook is configured, all worktree operations go through the hook, even in a Git repository
|
|
158
|
+
- **No fallback on failure**: If the WorktreeCreate hook fails, it does not fall back to `git worktree` — it errors immediately
|
|
159
|
+
- **Removal failure does not block exit**: A WorktreeRemove hook failure only logs a warning and does not prevent the exit process
|
|
160
|
+
|
|
161
|
+
### Configuration
|
|
162
|
+
|
|
163
|
+
Configure in `.codebuddy/settings.json` (project-level) or `~/.codebuddy/settings.json` (global):
|
|
164
|
+
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"hooks": {
|
|
168
|
+
"WorktreeCreate": [
|
|
169
|
+
{
|
|
170
|
+
"hooks": [
|
|
171
|
+
{
|
|
172
|
+
"type": "command",
|
|
173
|
+
"command": "bash ~/.codebuddy/hooks/worktree-create.sh"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"WorktreeRemove": [
|
|
179
|
+
{
|
|
180
|
+
"hooks": [
|
|
181
|
+
{
|
|
182
|
+
"type": "command",
|
|
183
|
+
"command": "bash ~/.codebuddy/hooks/worktree-remove.sh"
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
The two hooks are configured independently — you can configure only WorktreeCreate without WorktreeRemove (in which case the worktree will not be automatically cleaned up on exit, and a prompt will ask you to manually delete the directory).
|
|
193
|
+
|
|
194
|
+
### Input Data (stdin)
|
|
195
|
+
|
|
196
|
+
Hook scripts receive JSON-formatted context data via **stdin**.
|
|
197
|
+
|
|
198
|
+
**WorktreeCreate input**:
|
|
199
|
+
|
|
200
|
+
```json
|
|
201
|
+
{
|
|
202
|
+
"hook_event_name": "WorktreeCreate",
|
|
203
|
+
"session_id": "abc123def456",
|
|
204
|
+
"cwd": "/Users/user/project",
|
|
205
|
+
"transcript_path": "/Users/user/.codebuddy/sessions/abc123/transcript.md",
|
|
206
|
+
"name": "feature-auth"
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
| Field | Description |
|
|
211
|
+
|:------|:------------|
|
|
212
|
+
| `name` | Worktree name (user-specified or auto-generated) |
|
|
213
|
+
| `cwd` | Current working directory |
|
|
214
|
+
| `session_id` | Current session ID |
|
|
215
|
+
| `transcript_path` | Path to the conversation transcript file |
|
|
216
|
+
|
|
217
|
+
**WorktreeRemove input**:
|
|
218
|
+
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"hook_event_name": "WorktreeRemove",
|
|
222
|
+
"session_id": "abc123def456",
|
|
223
|
+
"cwd": "/Users/user/project",
|
|
224
|
+
"transcript_path": "/Users/user/.codebuddy/sessions/abc123/transcript.md",
|
|
225
|
+
"worktree_path": "/tmp/codebuddy-worktrees/feature-auth"
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
| Field | Description |
|
|
230
|
+
|:------|:------------|
|
|
231
|
+
| `worktree_path` | Absolute path of the worktree to be removed |
|
|
232
|
+
|
|
233
|
+
### Output and Exit Code
|
|
234
|
+
|
|
235
|
+
**WorktreeCreate**:
|
|
236
|
+
|
|
237
|
+
- **stdout**: Must output the **absolute path** of the created worktree (the last non-empty line is used)
|
|
238
|
+
- **stderr**: Logs can be written here without affecting path parsing
|
|
239
|
+
- **exit code 0**: Success — the path in stdout is parsed
|
|
240
|
+
- **exit code non-0**: Creation failed — errors out and exits (no fallback to `git worktree`)
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Correct example: logs to stderr, path to stdout
|
|
244
|
+
echo "Initializing SVN checkout..." >&2
|
|
245
|
+
echo "/home/user/.codebuddy/worktrees/feature-auth"
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**WorktreeRemove**:
|
|
249
|
+
|
|
250
|
+
- No decision control: any exit code does not prevent the exit process
|
|
251
|
+
- Failure only logs a warning
|
|
252
|
+
|
|
253
|
+
### Exit Behavior Difference
|
|
254
|
+
|
|
255
|
+
Unlike Git worktrees, hook-based worktrees **always show the keep/remove menu** on exit without change detection (since non-Git projects don't have `git status`).
|
|
256
|
+
|
|
257
|
+
### Hook Script Templates
|
|
258
|
+
|
|
259
|
+
**WorktreeCreate** (`~/.codebuddy/hooks/worktree-create.sh`):
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
#!/bin/bash
|
|
263
|
+
set -e
|
|
264
|
+
|
|
265
|
+
INPUT=$(cat)
|
|
266
|
+
NAME=$(echo "$INPUT" | jq -r '.name')
|
|
267
|
+
CWD=$(echo "$INPUT" | jq -r '.cwd')
|
|
268
|
+
|
|
269
|
+
WORKTREE_PATH="$HOME/.codebuddy/worktrees/$NAME"
|
|
270
|
+
mkdir -p "$WORKTREE_PATH"
|
|
271
|
+
|
|
272
|
+
# Add VCS initialization logic here (SVN checkout, P4 sync, directory copy, etc.)
|
|
273
|
+
cp -r "$CWD"/* "$WORKTREE_PATH/" 2>/dev/null || true
|
|
274
|
+
|
|
275
|
+
# Output the absolute path to stdout on the last line (required)
|
|
276
|
+
echo "$WORKTREE_PATH"
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
**WorktreeRemove** (`~/.codebuddy/hooks/worktree-remove.sh`):
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
#!/bin/bash
|
|
283
|
+
|
|
284
|
+
INPUT=$(cat)
|
|
285
|
+
WORKTREE_PATH=$(echo "$INPUT" | jq -r '.worktree_path')
|
|
286
|
+
|
|
287
|
+
# Safety check: ensure path is within the expected directory
|
|
288
|
+
if [[ "$WORKTREE_PATH" != "$HOME/.codebuddy/worktrees/"* ]]; then
|
|
289
|
+
echo "Refusing to remove path outside worktrees directory: $WORKTREE_PATH" >&2
|
|
290
|
+
exit 1
|
|
291
|
+
fi
|
|
292
|
+
|
|
293
|
+
rm -rf "$WORKTREE_PATH"
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
> **Tip**: The scripts depend on `jq` for JSON parsing. macOS: `brew install jq`, Linux: `apt install jq`.
|
|
297
|
+
|
|
298
|
+
### Real-world Examples
|
|
299
|
+
|
|
300
|
+
**SVN project**:
|
|
301
|
+
|
|
302
|
+
```json
|
|
303
|
+
{
|
|
304
|
+
"hooks": {
|
|
305
|
+
"WorktreeCreate": [
|
|
306
|
+
{
|
|
307
|
+
"hooks": [
|
|
308
|
+
{
|
|
309
|
+
"type": "command",
|
|
310
|
+
"command": "bash -c 'INPUT=$(cat); NAME=$(echo $INPUT | jq -r .name); DIR=\"$HOME/.codebuddy/worktrees/$NAME\"; svn checkout https://svn.example.com/repo/trunk \"$DIR\" >&2 && echo \"$DIR\"'"
|
|
311
|
+
}
|
|
312
|
+
]
|
|
313
|
+
}
|
|
314
|
+
],
|
|
315
|
+
"WorktreeRemove": [
|
|
316
|
+
{
|
|
317
|
+
"hooks": [
|
|
318
|
+
{
|
|
319
|
+
"type": "command",
|
|
320
|
+
"command": "bash -c 'cat | jq -r .worktree_path | xargs rm -rf'"
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
**Non-VCS project (directory copy)**:
|
|
330
|
+
|
|
331
|
+
```json
|
|
332
|
+
{
|
|
333
|
+
"hooks": {
|
|
334
|
+
"WorktreeCreate": [
|
|
335
|
+
{
|
|
336
|
+
"hooks": [
|
|
337
|
+
{
|
|
338
|
+
"type": "command",
|
|
339
|
+
"command": "bash -c 'INPUT=$(cat); NAME=$(echo $INPUT | jq -r .name); CWD=$(echo $INPUT | jq -r .cwd); DIR=\"$HOME/.codebuddy/worktrees/$NAME\"; cp -r \"$CWD\" \"$DIR\" && echo \"$DIR\"'"
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
"WorktreeRemove": [
|
|
345
|
+
{
|
|
346
|
+
"hooks": [
|
|
347
|
+
{
|
|
348
|
+
"type": "command",
|
|
349
|
+
"command": "bash -c 'cat | jq -r .worktree_path | xargs rm -rf'"
|
|
350
|
+
}
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
## tmux Integration
|
|
359
|
+
|
|
360
|
+
Use the `--tmux` parameter to run CodeBuddy in a dedicated tmux session:
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
# Basic usage
|
|
364
|
+
codebuddy --worktree --tmux
|
|
365
|
+
|
|
366
|
+
# Use classic mode (without popup)
|
|
367
|
+
codebuddy --worktree --tmux --tmux-classic
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### tmux Requirements
|
|
371
|
+
|
|
372
|
+
- tmux version 3.2 or higher (for popup support)
|
|
373
|
+
- Automatically falls back to classic mode if the version is lower
|
|
374
|
+
|
|
375
|
+
### Exiting a tmux Session
|
|
376
|
+
|
|
377
|
+
- Press `Ctrl+D` or type `/exit` to quit CodeBuddy
|
|
378
|
+
- The tmux session will be preserved or closed based on your choice
|
|
379
|
+
|
|
380
|
+
## Directory Structure
|
|
381
|
+
|
|
382
|
+
```
|
|
383
|
+
your-repo/
|
|
384
|
+
├── .codebuddy/
|
|
385
|
+
│ └── worktrees/
|
|
386
|
+
│ ├── feature-auth/ # worktree directory
|
|
387
|
+
│ │ ├── node_modules -> ../../node_modules # symlink
|
|
388
|
+
│ │ └── ...
|
|
389
|
+
│ └── fix-bug-123/
|
|
390
|
+
├── .worktreeinclude # defines local files to copy (recommended to commit)
|
|
391
|
+
└── ...
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
## Manual Worktree Management
|
|
395
|
+
|
|
396
|
+
CodeBuddy Code automatically handles worktree cleanup when a session exits. However, sometimes you need to manage worktrees outside of a session — for example, cleaning up leftover worktrees or having more flexible control over branches and directory locations.
|
|
397
|
+
|
|
398
|
+
### Cleaning Up Worktrees Outside a Session
|
|
399
|
+
|
|
400
|
+
Use Git commands directly:
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
# List all current worktrees
|
|
404
|
+
git worktree list
|
|
405
|
+
|
|
406
|
+
# Remove a specific worktree (when there are no uncommitted changes)
|
|
407
|
+
git worktree remove .codebuddy/worktrees/feature-auth
|
|
408
|
+
|
|
409
|
+
# Force remove (when there are uncommitted changes)
|
|
410
|
+
git worktree remove --force .codebuddy/worktrees/feature-auth
|
|
411
|
+
|
|
412
|
+
# Also delete the corresponding branch
|
|
413
|
+
git branch -D worktree-feature-auth
|
|
414
|
+
|
|
415
|
+
# Prune stale worktree references (directory deleted but Git still tracks it)
|
|
416
|
+
git worktree prune
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
### Creating Worktrees Directly with Git
|
|
420
|
+
|
|
421
|
+
Sometimes you need to check out an existing branch, or place the worktree outside the repository directory. You can bypass CodeBuddy Code and create worktrees directly with Git, then start a session inside:
|
|
422
|
+
|
|
423
|
+
```bash
|
|
424
|
+
# Create a new branch and worktree (outside the repository)
|
|
425
|
+
git worktree add ../project-feature-a -b feature-a
|
|
426
|
+
|
|
427
|
+
# Check out an existing branch
|
|
428
|
+
git worktree add ../project-bugfix bugfix-123
|
|
429
|
+
|
|
430
|
+
# Enter the worktree and start CodeBuddy Code
|
|
431
|
+
cd ../project-feature-a && codebuddy
|
|
432
|
+
|
|
433
|
+
# Clean up when done
|
|
434
|
+
git worktree remove ../project-feature-a
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
This approach is suitable for scenarios where you need to place the worktree in a specific location or reuse an existing branch.
|
|
438
|
+
|
|
439
|
+
## Sub-agent Isolation
|
|
440
|
+
|
|
441
|
+
When having CodeBuddy Code launch multiple sub-agents to work in parallel, each sub-agent can run in an independent worktree to avoid file conflicts.
|
|
442
|
+
|
|
443
|
+
### What is `isolation: worktree`
|
|
444
|
+
|
|
445
|
+
Adding `isolation: worktree` to a custom Agent's frontmatter means that each time the `Task` tool launches this Agent, the system automatically creates an independent worktree for it instead of running directly in the main repository directory.
|
|
446
|
+
|
|
447
|
+
This means:
|
|
448
|
+
- Multiple sub-agents can modify files with the same name simultaneously without affecting each other
|
|
449
|
+
- The main repository directory stays clean — sub-agents' temporary changes do not pollute it
|
|
450
|
+
- After a sub-agent finishes, the worktree is kept or removed as needed
|
|
451
|
+
|
|
452
|
+
### Creating an Isolated Custom Agent
|
|
453
|
+
|
|
454
|
+
Create a Markdown file in the `.codebuddy/agents/` directory:
|
|
455
|
+
|
|
456
|
+
```markdown
|
|
457
|
+
|
|
458
|
+
You are running in an isolated git worktree.
|
|
459
|
+
Focus on completing the task assigned to you, and report results when done.
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### How It Works
|
|
463
|
+
|
|
464
|
+
When the main Agent launches this Agent using the `Task` tool, an independent worktree is automatically created for it. Multiple sub-agents can work simultaneously, even modifying the same files without conflicts.
|
|
465
|
+
|
|
466
|
+
After a sub-agent finishes:
|
|
467
|
+
- **No changes**: The worktree is automatically deleted
|
|
468
|
+
- **Has changes**: The worktree is preserved, and the main Agent receives the worktree location information
|
|
469
|
+
|
|
470
|
+
### Verifying Isolation
|
|
471
|
+
|
|
472
|
+
```
|
|
473
|
+
> Use the isolated-worker agent to create test.txt in the current directory with the content "hello"
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
Check the result:
|
|
477
|
+
|
|
478
|
+
```bash
|
|
479
|
+
# The file does not exist in the main repository
|
|
480
|
+
ls test.txt
|
|
481
|
+
# → No such file or directory ✓
|
|
482
|
+
|
|
483
|
+
# The file is in the sub-agent's worktree
|
|
484
|
+
ls .codebuddy/worktrees/agent-xxx/test.txt
|
|
485
|
+
# → exists ✓
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
## Typical Use Cases
|
|
489
|
+
|
|
490
|
+
### Scenario 1: Developing Based on a Specific Branch
|
|
491
|
+
|
|
492
|
+
**Problem**: You need to develop a new feature on the develop branch rather than the main branch.
|
|
493
|
+
|
|
494
|
+
**Solution**:
|
|
495
|
+
|
|
496
|
+
```bash
|
|
497
|
+
# Create a worktree based on remote develop branch
|
|
498
|
+
codebuddy --worktree feature-xxx --worktree-branch origin/develop
|
|
499
|
+
|
|
500
|
+
# Create based on a local branch (preserving local unpushed commits)
|
|
501
|
+
codebuddy --worktree feature-yyy --worktree-branch my-local-branch
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
### Scenario 2: Handling Urgent Bugs in Parallel
|
|
505
|
+
|
|
506
|
+
**Problem**: You're in the middle of developing a new feature with half-written code, and an urgent bug needs fixing.
|
|
507
|
+
|
|
508
|
+
**Solution**:
|
|
509
|
+
|
|
510
|
+
```bash
|
|
511
|
+
# Terminal 1: Continue developing the new feature
|
|
512
|
+
codebuddy --worktree feature-payment
|
|
513
|
+
|
|
514
|
+
# Terminal 2: Fix the bug separately, without interference
|
|
515
|
+
codebuddy --worktree hotfix-login-crash
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
Both worktrees are open simultaneously without affecting each other. Once the bug is fixed and a PR is submitted, switch back to feature development.
|
|
519
|
+
|
|
520
|
+
### Scenario 3: High-Risk Refactoring
|
|
521
|
+
|
|
522
|
+
**Problem**: You want to attempt a large-scale refactor but aren't sure if it will succeed, and you don't want to pollute the main repository.
|
|
523
|
+
|
|
524
|
+
**Solution**:
|
|
525
|
+
|
|
526
|
+
```bash
|
|
527
|
+
codebuddy --worktree refactor-esm
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
In the session:
|
|
531
|
+
```
|
|
532
|
+
> Help me migrate the src/core directory from CommonJS to ESM
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
Result:
|
|
536
|
+
- **Success**: Commit, push PR, merge
|
|
537
|
+
- **Failure**: Choose "Remove worktree" on exit — all changes are discarded with one click
|
|
538
|
+
|
|
539
|
+
### Scenario 4: Reviewing a PR
|
|
540
|
+
|
|
541
|
+
**Problem**: You want to run a colleague's PR code locally without polluting your working directory.
|
|
542
|
+
|
|
543
|
+
**Solution**:
|
|
544
|
+
|
|
545
|
+
```bash
|
|
546
|
+
codebuddy --worktree "#456"
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
In the session:
|
|
550
|
+
```
|
|
551
|
+
> Help me review what this PR changed and check for potential issues
|
|
552
|
+
> Run the tests
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
Exit when done — the worktree is automatically cleaned up.
|
|
556
|
+
|
|
557
|
+
### Scenario 5: Parallel Tasks
|
|
558
|
+
|
|
559
|
+
**Problem**: You have multiple independent tasks (writing docs, adding tests, developing a new API) and want to work on them separately.
|
|
560
|
+
|
|
561
|
+
**Solution**:
|
|
562
|
+
|
|
563
|
+
```bash
|
|
564
|
+
codebuddy --worktree task-docs --tmux
|
|
565
|
+
codebuddy --worktree task-tests --tmux
|
|
566
|
+
codebuddy --worktree task-new-api --tmux
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
Each worktree lets the AI focus on one thing, with tmux enabling true parallel work.
|
|
570
|
+
|
|
571
|
+
### Scenario 6: Sub-agent Collaboration
|
|
572
|
+
|
|
573
|
+
**Problem**: A large task requires multiple AI agents to process different modules in parallel.
|
|
574
|
+
|
|
575
|
+
**Solution**:
|
|
576
|
+
|
|
577
|
+
First create an isolated Agent (see the "Sub-agent Isolation" section above), then:
|
|
578
|
+
|
|
579
|
+
```
|
|
580
|
+
> Use three parallel api-worker sub-agents:
|
|
581
|
+
The first handles the src/api/user/ directory
|
|
582
|
+
The second handles the src/api/order/ directory
|
|
583
|
+
The third handles the src/api/product/ directory
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
Three sub-agents each work in independent worktrees — even if they modify shared files, there are no conflicts.
|
|
587
|
+
|
|
588
|
+
## FAQ
|
|
589
|
+
|
|
590
|
+
**Q: Should I pass a remote or local branch to `--worktree-branch`?**
|
|
591
|
+
|
|
592
|
+
They are strictly distinct:
|
|
593
|
+
- `--worktree-branch origin/xxx` → Uses the remote branch (fetches the latest code first)
|
|
594
|
+
- `--worktree-branch xxx` → Uses the local branch (preserves local unpushed commits)
|
|
595
|
+
|
|
596
|
+
If the specified branch does not exist, a warning is printed and the creation falls back to the remote default branch without interrupting startup.
|
|
597
|
+
|
|
598
|
+
**Q: Will worktrees take up a lot of disk space?**
|
|
599
|
+
|
|
600
|
+
No. All worktrees share the Git object database and only need to store the working files themselves. With `symlinkDirectories` configured, large directories are also shared, resulting in virtually no extra space usage.
|
|
601
|
+
|
|
602
|
+
**Q: When reusing an existing worktree, will files like .env.local be re-copied?**
|
|
603
|
+
|
|
604
|
+
No. When reusing, the existing directory is entered directly, skipping initialization. To sync new configurations, remove the worktree and recreate it:
|
|
605
|
+
|
|
606
|
+
```bash
|
|
607
|
+
git worktree remove --force .codebuddy/worktrees/my-feature
|
|
608
|
+
git branch -D worktree-my-feature
|
|
609
|
+
codebuddy --worktree my-feature
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
**Q: Will commits in a worktree affect the main repository?**
|
|
613
|
+
|
|
614
|
+
No. A worktree has its own branch, and commits are only made on that branch. To merge into the main branch, follow the normal PR process or manually run `git merge`.
|
|
615
|
+
|
|
616
|
+
**Q: What if the worktree creation was interrupted, leaving an incomplete directory?**
|
|
617
|
+
|
|
618
|
+
```bash
|
|
619
|
+
git worktree remove --force .codebuddy/worktrees/<name>
|
|
620
|
+
git branch -D worktree-<name>
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
Then recreate it.
|
|
624
|
+
|
|
625
|
+
**Q: symlinkDirectories is configured but not working?**
|
|
626
|
+
|
|
627
|
+
Reusing an existing worktree does not re-run initialization. Remove the old worktree and recreate it.
|
|
628
|
+
|
|
629
|
+
**Q: Is sub-agent isolation a security sandbox?**
|
|
630
|
+
|
|
631
|
+
No. Sub-agents are isolated at the file level, but they have the same permissions as the main Agent and can theoretically access files outside the worktree. This feature is designed to prevent **file conflicts** between multiple Agents, not to enforce security restrictions.
|
|
632
|
+
|
|
633
|
+
**Q: Can I still use Git Worktree after configuring a WorktreeCreate hook?**
|
|
634
|
+
|
|
635
|
+
No, they cannot be used simultaneously. Hooks take priority over Git — once a WorktreeCreate hook is configured, all worktree operations go through the hook, even in a Git repository. To revert to using `git worktree`, remove the WorktreeCreate configuration from `settings.json`.
|
|
636
|
+
|
|
637
|
+
**Q: What happens if I configure WorktreeCreate but not WorktreeRemove?**
|
|
638
|
+
|
|
639
|
+
Creation works normally, but the worktree will not be automatically cleaned up on exit. The system will prompt you with the location of the worktree directory, which you need to manually delete.
|
|
640
|
+
|
|
641
|
+
**Q: What should I do if the hook script fails?**
|
|
642
|
+
|
|
643
|
+
A WorktreeCreate failure will error out immediately without falling back to `git worktree` — check the script's stderr output to diagnose the problem. A WorktreeRemove failure only logs a warning and does not affect the exit process.
|
|
644
|
+
|
|
645
|
+
**Q: Why is there no automatic cleanup when exiting a hook-based worktree in a non-Git project?**
|
|
646
|
+
|
|
647
|
+
Hook-based worktrees always show the keep/remove menu on exit without performing change detection (since non-Git projects don't have `git status`). You need to manually choose whether to delete it.
|
|
648
|
+
|
|
649
|
+
## Important Notes
|
|
650
|
+
|
|
651
|
+
- **Git repository or hook required**: `--worktree` requires a Git repository or a configured WorktreeCreate hook (non-Git projects like SVN and Perforce can use hooks)
|
|
652
|
+
- **Branch naming**: Automatically created branches are prefixed with `worktree-`
|
|
653
|
+
- **Cleanup**: Long-unused worktrees are not automatically cleaned up — they need to be manually deleted or cleaned using the `/rewind` command
|
|
654
|
+
- **Symlinks**: Some tools may not support symlinked directories — configure based on your project's needs
|
|
655
|
+
|
|
656
|
+
## Related Documentation
|
|
657
|
+
|
|
658
|
+
- [CLI Reference](./cli-reference.md) - Complete command-line parameter reference
|
|
659
|
+
- [Hooks Reference](./hooks.md) - Detailed Hook system documentation
|
|
660
|
+
- [Settings Configuration](./settings.md) - Configuration file reference
|