← 返回
未分类 中文

Worktree Manager

Manage Docker-based dev instances and git worktrees. Handles app container lifecycle, database seeding, and proxy route activation. Requires mysql-manager an...
管理基于 Docker 的开发实例及 git worktree,处理应用容器生命周期、数据库种子数据和代理路由激活,需要 mysql‑manager 等依赖。
pereirajair pereirajair 来源
未分类 clawhub v1.0.3 1 版本 100000 Key: 无需
★ 0
Stars
📥 316
下载
💾 1
安装
1
版本
#latest

概述

Worktree Manager

Manages Docker app instances and git worktrees for local development.

Each instance gets its own docker-compose stack (backend + frontend), isolated git branch, and .env.worktree- file. MySQL and nginx-proxy are managed separately by their own plugins.

Prerequisites

Start these first (order matters):

  1. proxy-manager start — creates the shared Docker network (nginx-proxy_net)
  2. mysql-manager start — starts the shared MySQL container

Architecture

project/
├── docker-compose.yml        # app stack template (backend + frontend)
├── run.sh                    # this plugin's entry point (copy to project root)
├── .env.base                 # main instance env
├── .env.worktree-<name>      # per-worktree env (gitignored)
└── .worktrees/
    └── <name>/               # git worktree (gitignored)
  • main.env.base, project root
  • worktree.env.worktree-, checked out at .worktrees/
  • URLs: http://.frontend.localhost / http://.backend.localhost

Commands

All commands run from the project root:

./run.sh list                        # show all instances + mysql/proxy status
./run.sh start [main|<name>]         # seed db, start containers, connect proxy
./run.sh stop  [main|<name>]         # stop containers (db persists)
./run.sh restart [main|<name>]       # stop then start
./run.sh logs  [main|<name>]         # follow container logs
./run.sh create-worktree <name>      # git worktree + branch + env file
./run.sh remove-worktree <name>      # stop containers + drop db + remove worktree

How to Execute Tasks

Full environment setup (first time)

proxy-manager/run.sh start        # network + nginx-proxy
mysql-manager/run.sh start        # MySQL
./run.sh start main               # main app instance

Create a new worktree and start it

  1. ./run.sh create-worktree — creates branch worktree/, dir .worktrees/, env file
  2. ./run.sh start — seeds db from main snapshot, starts containers, activates proxy route
  3. URLs reported at the end

Stop an instance

./run.sh stop <name>

Remove a worktree (destructive — always confirm first)

Confirm with user: "Remove worktree ''? Deletes containers, database, git worktree (branch worktree/), and .env.worktree-."

./run.sh remove-worktree <name>

List all instances

./run.sh list

What start Does

  1. Checks MySQL container is running (exits with error if not)
  2. CREATE DATABASE IF NOT EXISTS for the instance
  3. For non-main instances: dumps codai_main → instance db
  4. docker compose up --build -d
  5. docker network connect — proxy to instance network (activates routes)

Rules

  • Always check ./run.sh list before starting — it shows MySQL/proxy status.
  • Always confirm before remove-worktree — it is irreversible.
  • After start, print the frontend and backend URLs.
  • If ./run.sh is not executable: chmod +x run.sh
  • .env.worktree-* files and .worktrees/ dir must be gitignored.

Configuration

VariableDefaultPurpose
------------------------------------------------------------------------
MYSQL_CONTAINERcodai_dbMySQL container name
MYSQL_ROOT_PASSsecretMySQL root password
MYSQL_MAIN_DBcodai_mainSource DB for snapshots
PROXY_CONTAINERcodai_nginx_proxynginx-proxy container name
PROJECT_PREFIXcodai-devDocker Compose project prefix

Related Plugins

  • proxy-manager — nginx-proxy lifecycle and network management (start first)
  • mysql-manager — MySQL lifecycle and database admin (start second)

版本历史

共 1 个版本

  • v1.0.3 当前
    2026-05-12 05:19 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

Phpmyadmin Manager

pereirajair
管理 phpMyAdmin Docker容器,用于本地开发环境。提供位于 http://localhost:8081 的 MySQL Web UI,需具备 mysql‑manager 与 proxy‑man...
★ 0 📥 464
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 198 📥 68,268
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,141