npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@schemelisp/wturbo

v1.0.1

Published

Git worktree management with Docker Compose environment isolation

Readme

wturbo

複数ブランチの開発環境を一瞬で切り替える

Git worktreeを使って、ブランチごとに独立した作業ディレクトリを作成・管理するCLIツールです。

こんな時に便利

  • メインブランチで作業中に、緊急のバグ修正が入った
  • 複数の機能ブランチを並行して開発したい
  • PRレビュー用に別ブランチをすぐに確認したい
  • .envなどgitignoreされたファイルも新しい作業環境にコピーしたい

クイックスタート

1. インストール

npm install -g wturbo

2. 設定ファイルを作成

プロジェクトのルートに wturbo.yaml を作成:

base_branch: main

# gitignoreされているファイルを新しいworktreeにコピー
copy_files:
  - .env
  - .env.local

# 大きなディレクトリはコピーせずsymlinkを張る
link_files:
  - node_modules

3. 使う

# 新しいブランチ用のworktreeを作成
wturbo create feature/awesome-feature

# 作業ディレクトリに移動
cd ../worktree-feature-awesome-feature

# 作業完了後、worktreeを削除
wturbo remove feature/awesome-feature

コマンド

wturbo create <branch>

新しいworktreeを作成します。

wturbo create feature/new-feature
wturbo create bugfix/urgent-fix

処理内容:

  1. git worktree add でブランチ用の作業ディレクトリを作成(base_branch からブランチを作成)
  2. copy_files で指定したファイルをコピー
  3. link_files で指定したファイル/ディレクトリにsymlinkを作成(copy_files より優先)
  4. env.file で指定した環境変数ファイルをコピー(env.adjust が設定されている場合はポート等を調整してコピー)
  5. docker_compose_file が設定・存在する場合は worktree にコピーしてポート衝突を自動調整
  6. start_command を実行(設定時のみ)

オプション:

  • -p, --path <path> - worktreeの作成場所を指定(デフォルト: 親ディレクトリに worktree-<branch名> で作成)
  • --no-create-branch - 既存のブランチを使用(新規作成しない)

wturbo remove <branch>

worktreeを削除します。

wturbo remove feature/new-feature

処理内容:

  1. docker_compose_file が worktree に存在する場合は docker compose down を実行(end_command が未設定の場合)
  2. end_command を実行(設定時のみ)
  3. git worktree remove でworktreeを削除

オプション:

  • -f, --force - 未コミットの変更があっても強制削除

wturbo status

現在のworktree一覧を表示します。

wturbo status

出力例:

🌿 Git Worktrees (3 total)
  → main: /Users/me/project
    feature/auth: /Users/me/worktree-feature-auth
    bugfix/login: /Users/me/worktree-bugfix-login

設定ファイル

以下のいずれかのパスに設定ファイルを配置します(優先順位順):

  • wturbo.yaml
  • wturbo.yml
  • .wturbo.yaml
  • .wturbo.yml
  • .wturbo/config.yaml
  • .wturbo/config.yml

基本設定

base_branch: main

ファイルコピー

gitignoreされているファイルや設定ファイルを新しいworktreeにコピー:

copy_files:
  - .env
  - .env.local
  - .claude          # ディレクトリも可
  - config/local.json

シンボリックリンク

重いディレクトリ(node_modules など)はコピーせず、元リポジトリを参照するsymlinkを作成:

link_files:
  - node_modules
  - .cache

同じパスが copy_fileslink_files の両方にある場合、link_files が優先されます。

スクリプト実行

worktree作成時・削除時にスクリプトを実行:

# 作成後に実行(依存関係のインストールなど)
start_command: ./scripts/setup.sh

# 削除前に実行(クリーンアップなど)
end_command: ./scripts/cleanup.sh

フル設定例

base_branch: main
docker_compose_file: ./docker-compose.yml  # 省略するとDockerチェックをスキップ

copy_files:
  - .env
  - .env.local
  - .secrets
  - config/

link_files:
  - node_modules
  - .cache

start_command: npm install && npm run db:migrate
end_command: docker compose down

env:
  file:
    - .env
    - .env.local
  adjust:
    APP_PORT: 1000    # ポート番号に+1000
    DB_PORT: 1000

設定項目一覧

| 項目 | 型 | 説明 | |------|------|------| | base_branch | string | ベースブランチ名(デフォルト: main) | | docker_compose_file | string | Docker Composeファイルのパス(省略または空文字でDockerチェックをスキップ) | | copy_files | string[] | コピーするファイル/ディレクトリ | | link_files | string[] | symlinkを作成するファイル/ディレクトリ(copy_files より優先) | | start_command | string | worktree作成後に実行するコマンド | | end_command | string | worktree削除前に実行するコマンド | | env.file | string[] | 環境変数ファイルのリスト | | env.adjust | object | 環境変数の調整(数値: 加算, 文字列: 置換, null: 削除) |

必要環境

  • Node.js 18+
  • Git

License

MIT