Commit Duck is a terminal application that lets you raise a duck for each Git repository.
As you make commits, your duck evolves. You can check its status anytime with the duck status command.
-
Repository-based Growth
Each repository stores its own state in.duck/state.properties.
You can raise a different duck in each project. -
Automatic Tracking
A post-commit hook runs in the background on everygit commit, automatically updating the commit count. -
Global Execution
Once installed, you can use theduckcommand from any directory. -
Simple Commands
duck install… Install the hook in the current repositoryduck status… Show the current evolution stateduck refresh… Recalculate and update the total commit countduck help… Show the list of commands
-
10 Evolution Stages
- 0–2: 🥚 Egg
- 3–5: 🐣 Cracked Egg
- 6–9: 🐣 Hatching
- 10–14: 🦆 Duckling
- 15–24: 💕 Matching
- 25–39: 💒 Married
- 40–59: 🍼 Nesting
- 60–79: 🤒 Sickly
- 80–99: � Injured
- 100+: ☠️ Deceased
- Java 17+ is required
gitcommand must be available
The easiest way:
curl -fsSL https://raw.githubusercontent.com/kumoshitaakira/Commit-Duck/main/install.sh | bashor
wget -qO- https://raw.githubusercontent.com/kumoshitaakira/Commit-Duck/main/install.sh | bashThis will automatically:
- Clone the repository
- Set up the environment and build
- Install globally
- Set up your PATH
git clone https://github.com/your-username/Commit-Duck.git
cd Commit-DuckGlobal install (default, recommended):
./setup.shLocal install:
./setup.sh localFor global install, your PATH will be set automatically and you can use the duck command right away.
In any Git repository, run:
duck installNow, your duck will grow automatically with each commit in that repository.
Commit Duck provides a comprehensive update feature, updating everything below:
- Java source code (full recompile)
- ASCII art files (all resource files)
- Config files
- Execution scripts
- Dependencies
cd /path/to/Commit-Duck
./update.shcurl -fsSL https://raw.githubusercontent.com/kumoshitaakira/Commit-Duck/main/install.sh | bashIf an existing install is detected, it will run in update mode automatically.
update.sh performs the following:
- Update source code: Pull latest changes from Git
- Clean build: Delete all build files and rebuild
- Resolve dependencies: Get the latest libraries
- Resource check: Ensure ASCII art files exist
- Update files: Update JAR and scripts
- Detailed report: Show file sizes and changes
Quick setup (recommended):
./setup.shManual setup:
macOS/Linux:
chmod +x duck gradlew
./gradlew build installDist
./duck installWindows (PowerShell/CMD):
gradlew.bat build installDist
duck.bat installThis will:
- Check your environment (Java 17+, Git)
- Automatically build the Java project
- Set up a post-commit hook to update the commit count on every
git commit
./duck statusIf you see your current commit count and duck evolution state, setup was successful!
Just develop and commit as usual.
duck statusduck refreshduck helpHere is a typical directory/file structure for this tool.
Commit-Duck/
├─ README.md
├─ build.gradle # Gradle build config
├─ settings.gradle # Gradle project config
├─ duck # Command for macOS/Linux (shell script entry)
├─ duck.bat # Command for Windows (batch entry)
└─ src/
├─ main/ # Main source code
│ ├─ DuckCli.java # CLI entry point / command dispatcher
│ ├─ DuckState.java # State (commit count/stage) management
│ ├─ Evolution.java # Commit count → evolution stage logic
│ └─ GitUtils.java # Git utilities (get commit count, etc.)
└─ test/ # Test code
├─ DuckCliTest.java # CLI tests
├─ DuckStateTest.java # State management tests
├─ EvolutionTest.java # Evolution logic tests
└─ GitUtilsTest.java # Git utility tests
# Build the project
./gradlew build
# Create executable distribution
./gradlew installDist
# Run tests
./gradlew test
# Clean build
./gradlew clean build installDistComplete setup (recommended):
# 1. Build the project
./gradlew build
# 2. Create executable distribution
./gradlew installDist
# 3. Use duck commands
./duck install
./duck statusOr use automatic setup:
./setup.shJava class files are generated in build/classes/java/main. The duck / duck.bat scripts call these classes via the java command.
- Creates
.duck/state.propertiesin the root of each repository - Stores the following inside:
commits: Current commit countstage: Evolution stage (EGG / DUCKLING / TEEN / ADULT / LEGEND)
Example:
commits=12
stage=TEEN- Run
git commit - The
post-commithook callsduck refresh - Get total commit count with
git rev-list --count HEAD - Save to
.duck/state.properties - When
duck statusis run, read the file and show ASCII art
User → git commit → git hook → .duck/state.properties → duck status
- Each repository has its own independent duck.
- It is recommended to add the
.duckdirectory to.gitignore. - Requires a working
gitcommand. - Java 17+ is required (Gradle toolchain is set).
Enjoy hacking with your Commit Duck! 🦆
Commit Duck は、Git リポジトリごとにアヒルを育てるターミナルアプリです。
コミットを重ねるとアヒルが進化し、duck status コマンドでいつでも確認できます。
-
リポジトリ単位で成長
各リポジトリの.duck/state.propertiesに独立して状態を保存。
複数プロジェクトで、それぞれのアヒルを育てられます。 -
自動計測
通常のgit commit時に post-commit hook が裏で走り、コミット数を自動で更新。 -
グローバル実行
一度インストールすれば、どのディレクトリからでもduckコマンドが使用可能。 -
簡単な操作
duck install… 現在のリポジトリに hook をインストールduck status… 現在の進化状態を表示duck refresh… 現在のコミット総数を再計算して更新duck help… コマンド一覧を表示
-
10 段階の進化
- 0–2: 🥚 Egg
- 3–5: 🐣 Cracked Egg
- 6–9: 🐣 Hatching
- 10–14: 🦆 Duckling
- 15–24: 💕 Matching
- 25–39: 💒 Married
- 40–59: 🍼 Nesting
- 60–79: 🤒 Sickly
- 80–99: � Injured
- 100+: ☠️ Deceased
- Java 17+ が必要です
gitコマンドが利用可能な環境
最も簡単な方法:
curl -fsSL https://raw.githubusercontent.com/kumoshitaakira/Commit-Duck/main/install.sh | bashまたは
wget -qO- https://raw.githubusercontent.com/kumoshitaakira/Commit-Duck/main/install.sh | bashこれだけで以下が自動実行されます:
- リポジトリのクローン
- 環境構築とビルド
- グローバルインストール
- PATH 設定
git clone https://github.com/your-username/Commit-Duck.git
cd Commit-Duckグローバルインストール(デフォルト・推奨):
./setup.shローカルインストール:
./setup.sh localグローバルインストールの場合、PATH 設定も自動で行われ、すぐに duck コマンドが使用可能になります。
任意の Git リポジトリで以下を実行:
duck installこれで、そのリポジトリでコミット時に自動的にアヒルが成長します。
Commit Duck は包括的なアップデート機能を提供し、以下をすべて更新します:
- Java ソースコード(完全再コンパイル)
- アスキーアートファイル(全リソースファイル)
- 設定ファイル
- 実行スクリプト
- 依存関係
cd /path/to/Commit-Duck
./update.shcurl -fsSL https://raw.githubusercontent.com/kumoshitaakira/Commit-Duck/main/install.sh | bash既存のインストールが検出された場合、自動的にアップデートモードで実行されます。
update.sh は以下の処理を実行します:
- ソースコードの更新: Git から最新の変更を取得
- クリーンビルド: 既存のビルドファイルをすべて削除してから再ビルド
- 依存関係の解決: 最新の依存ライブラリを取得
- リソース検証: アスキーアートファイルの存在確認
- ファイル更新: JAR ファイルと実行スクリプトを更新
- 詳細レポート: ファイルサイズや更新内容の変化を表示
簡単セットアップ(推奨):
./setup.sh手動セットアップ:
macOS/Linux:
chmod +x duck gradlew
./gradlew build installDist
./duck installWindows (PowerShell/CMD):
gradlew.bat build installDist
duck.bat installこれにより以下が実行されます:
- 環境チェック(Java 17+、Git)
- Java プロジェクトが自動的にビルドされます
git commitのたびにコミット数を更新する post-commit hook が設定されます
./duck status現在のコミット数とアヒルの進化状態が表示されれば成功です!
普段通りに開発・コミットしてください。
duck statusduck refreshduck help本ツールの典型的なディレクトリ・ファイル構成例です。
Commit-Duck/
├─ README.md
├─ build.gradle # Gradleビルド設定
├─ settings.gradle # Gradleプロジェクト設定
├─ duck # macOS/Linux用コマンド(シェルスクリプト)
├─ duck.bat # Windows用コマンド(バッチファイル)
└─ src/
├─ main/ # メインソースコード
│ ├─ DuckCli.java # CLIエントリポイント/コマンド分岐
│ ├─ DuckState.java # 状態(コミット数/進化段階)管理
│ ├─ Evolution.java # コミット数→進化段階ロジック
│ └─ GitUtils.java # Gitユーティリティ(コミット数取得等)
└─ test/ # テストコード
├─ DuckCliTest.java # CLIテスト
├─ DuckStateTest.java # 状態管理テスト
├─ EvolutionTest.java # 進化ロジックテスト
└─ GitUtilsTest.java # Gitユーティリティテスト
# ビルド
./gradlew build
# 実行可能ディストリビューション作成
./gradlew installDist
# テスト実行
./gradlew test
# クリーンビルド
./gradlew clean build installDist完全なセットアップ(推奨):
# 1. プロジェクトをビルド
./gradlew build
# 2. 実行可能ディストリビューションを作成
./gradlew installDist
# 3. duckコマンドを使用
./duck install
./duck statusまたは、自動セットアップを使用:
./setup.shJavaクラスファイルは build/classes/java/main に生成されます。duck / duck.bat スクリプトがこれらのクラスを java コマンド経由で呼び出します。
- 各リポジトリ直下に
.duck/state.propertiesを作成 - 以下の情報を保存:
commits: 現在のコミット数stage: 進化段階(EGG / DUCKLING / TEEN / ADULT / LEGEND)
例:
commits=12
stage=TEENgit commit実行- post-commit hook が
duck refreshを呼び出し git rev-list --count HEADでコミット数取得.duck/state.propertiesに保存duck status実行時にファイルを読み込みアスキーアート表示
ユーザー → git commit → git hook → .duck/state.properties → duck status
- 各リポジトリごとに独立したアヒルが存在します
.duckディレクトリは.gitignoreへの追加を推奨しますgitコマンドが利用可能な環境が必要です- Java 17+ が必要です(Gradle toolchain 設定済み)
ターミナルダックと一緒に楽しい開発を!🦆