Skip to content

Commit 0399aa5

Browse files
committed
feat: Add scripts for Git commit message rewriting, repository splitting, and statistics
- Introduced `git-rewrite-commits.py` for cleaning up commit messages based on configurable patterns. - Added `git-split-repo.py` to extract subdirectories from a monorepo into separate repositories with full history. - Implemented `git-stats.sh` to display comprehensive statistics about the Git repository. - Created `help-devtools` script for a command reference of various DevTools scripts. - Added configuration files and documentation for the Dozzle container monitor, including environment variables and management scripts.
1 parent 298e8d5 commit 0399aa5

26 files changed

+5120
-125
lines changed

README.md

Lines changed: 194 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,242 @@
1-
# Developer Tools
1+
# DevTools - Swiss Army Knife for Git-based Development
22

3-
Real-time Docker container log viewer and management tool for developers using Docker Desktop.
3+
A collection of Docker-based developer tools for Git workflows and development automation. All tools run in isolated containers for platform independence.
44

5-
Based on [Dozzle](https://dozzle.dev) - a lightweight, web-based Docker log viewer.
5+
## Services
66

7-
## Features
7+
This repository contains independent tools that can be used separately:
88

9-
- **Real-time log streaming** - View container logs as they happen
10-
- **Container management** - Start, stop, and restart containers from the UI
11-
- **Shell access** - Execute commands directly in containers
12-
- **SQL queries** - Query JSON logs using SQL syntax (DuckDB in browser)
13-
- **Multi-container view** - Monitor multiple containers simultaneously
14-
- **Search & filter** - Find specific log entries quickly
15-
- **Dark/Light mode** - Comfortable viewing in any environment
9+
| Service | Description | Location |
10+
|---------|-------------|----------|
11+
| **DevTools** | Git & Python runtime container | `./devtools.sh` |
12+
| **Dozzle** | Docker container log viewer | `services/dozzle/` |
1613

17-
## Quick Start
14+
## DevTools Runtime Container
1815

19-
### 1. Configure
16+
Interactive container with Git, Python 3.12, and shell utilities for Git-based development workflows.
2017

21-
```bash
22-
cp .env.example .env
23-
```
24-
25-
Edit `.env` to customize settings (optional).
18+
### Features
2619

27-
### 2. Start
20+
- **Git Tools** - Advanced Git commands, statistics, history rewriting, and automation
21+
- **GitHub Tools** - Repository management, topics, archiving, and workflow triggers
22+
- **Python Environment** - Full Python 3.12 with common libraries (GitPython, Click, Rich, etc.)
23+
- **Shell Utilities** - curl, jq, yq, git-filter-repo, GitHub CLI, and more
24+
- **Platform Independent** - Runs identically on Windows, macOS, and Linux
25+
- **Auto-configured** - Git credentials from host, helpful aliases pre-installed
2826

29-
**Windows (PowerShell):**
27+
### Quick Start
3028

3129
```powershell
32-
.\scripts\dozzle.ps1 start
33-
```
30+
# Build the container
31+
.\devtools.ps1 build
3432
35-
**Linux/macOS:**
33+
# Start interactive shell in current directory
34+
.\devtools.ps1 shell
3635
37-
```bash
38-
chmod +x scripts/dozzle.sh
39-
./scripts/dozzle.sh start
36+
# Start shell in a specific project
37+
.\devtools.ps1 shell C:\Projects\MyApp
4038
```
4139

42-
**Or directly with Docker Compose:**
40+
### Commands
4341

44-
```bash
45-
docker compose up -d
46-
```
42+
#### Runtime Container
4743

48-
### 3. Access
44+
| Command | Description |
45+
|---------|-------------|
46+
| `shell [PATH]` | Start interactive DevTools shell |
47+
| `run <script>` | Run a script in the container |
48+
| `build` | Build/rebuild DevTools container |
4949

50-
Open [http://localhost:9999](http://localhost:9999) in your browser.
50+
#### Git Tools
5151

52-
## Scripts
52+
| Command | Description |
53+
|---------|-------------|
54+
| `stats [PATH]` | Show repository statistics |
55+
| `cleanup [PATH]` | Clean up branches and cache |
56+
| `changelog` | Generate changelog from commits |
57+
| `release` | Manage semantic versioning releases |
58+
| `lfs-migrate` | Migrate repository to Git LFS |
59+
| `history-clean` | Remove large files from git history |
60+
| `branch-rename` | Rename git branches (local + remote) |
61+
| `split-repo` | Split monorepo into separate repos |
62+
| `rewrite-commits` | Rewrite commit messages (pattern-based) |
5363

54-
Management scripts are available for Windows and Linux/macOS:
64+
#### GitHub Tools
5565

56-
| Command | Description |
57-
| --------- | ------------------------- |
58-
| `start` | Start Dozzle container |
59-
| `stop` | Stop and remove container |
60-
| `restart` | Restart container |
61-
| `status` | Show container status |
62-
| `logs` | Follow container logs |
63-
| `pull` | Pull latest image |
64-
| `open` | Open web UI in browser |
65-
| `help` | Show available commands |
66+
| Command | Description |
67+
|---------|-------------|
68+
| `gh-create` | Create GitHub repository |
69+
| `gh-topics` | Manage repository topics |
70+
| `gh-archive` | Archive repositories by criteria |
71+
| `gh-workflow` | Trigger GitHub Actions workflows |
6672

67-
**Windows:**
73+
### Tool Details
6874

69-
```powershell
70-
.\scripts\dozzle.ps1 <command>
75+
#### Git History Tools
76+
77+
```bash
78+
# Remove large files from history (requires git-filter-repo)
79+
./devtools.sh history-clean --analyze # Show large files
80+
./devtools.sh history-clean -s 50M --dry-run # Preview cleanup
81+
82+
# Rename branches (master → main)
83+
./devtools.sh branch-rename --master-to-main # Full migration
84+
./devtools.sh branch-rename old-name new-name # Custom rename
85+
86+
# Split monorepo into separate repos
87+
./devtools.sh split-repo dir1,dir2 -o myorg # Split to GitHub
88+
./devtools.sh split-repo services/api --submodule # Keep as submodule
89+
90+
# Rewrite commit messages (remove AI attributions, etc.)
91+
./devtools.sh rewrite-commits --preset claude --dry-run
92+
./devtools.sh rewrite-commits --preset ai-all
93+
./devtools.sh rewrite-commits -p "TICKET-\d+:\s*" # Custom pattern
7194
```
7295

73-
**Linux/macOS:**
96+
#### GitHub Management Tools
7497

7598
```bash
76-
./scripts/dozzle.sh <command>
99+
# Create repository
100+
./devtools.sh gh-create myrepo --public --init
101+
./devtools.sh gh-create -o myorg myrepo -t "python,cli" --license MIT
102+
103+
# Manage topics across repos
104+
./devtools.sh gh-topics -o myorg --analyze # Topic statistics
105+
./devtools.sh gh-topics -o myorg --add python,api # Add to all repos
106+
./devtools.sh gh-topics myorg/repo --sync cli,tool # Ensure topics exist
107+
108+
# Archive inactive repositories
109+
./devtools.sh gh-archive -o myorg --inactive 365 --dry-run
110+
./devtools.sh gh-archive -o myorg --empty # Archive empty repos
111+
./devtools.sh gh-archive myorg/old-repo # Archive single repo
112+
113+
# Trigger GitHub Actions
114+
./devtools.sh gh-workflow myorg/repo --list # List workflows
115+
./devtools.sh gh-workflow myorg/repo ci.yml # Trigger workflow
116+
./devtools.sh gh-workflow myorg/repo deploy.yml -i env=prod --wait
77117
```
78118

79-
## Configuration
119+
### Inside the Container
120+
121+
**Shell Scripts:**
122+
- `git-stats.sh` - Comprehensive repository statistics
123+
- `git-cleanup.sh` - Clean up merged/stale branches
124+
- `git-lfs-migrate.sh` - LFS migration with 100+ file patterns
125+
- `git-history-clean.sh` - Remove large files from history
126+
- `git-branch-rename.sh` - Rename branches with remote sync
127+
- `gh-create-repo.sh` - Create GitHub repositories
128+
- `gh-trigger-workflow.sh` - Trigger GitHub Actions
129+
- `help-devtools` - Show all available commands
130+
131+
**Python Tools:**
132+
- `git-changelog.py` - Generate changelog from commits
133+
- `git-release.py` - Semantic versioning release manager
134+
- `git-split-repo.py` - Split monorepo into separate repos
135+
- `git-rewrite-commits.py` - Pattern-based commit message rewriting
136+
- `gh-topic-manager.py` - Manage repository topics
137+
- `gh-archive-repos.py` - Archive repositories by criteria
138+
139+
**Pre-configured Git Aliases:**
140+
| Alias | Command |
141+
|-------|---------|
142+
| `git st` | `status -sb` |
143+
| `git lg` | Log graph (20 commits) |
144+
| `git lga` | Full log graph, all branches |
145+
| `git branches` | List branches by date |
146+
| `git last` | Show last commit |
147+
| `git undo` | Soft reset last commit |
148+
| `git amend` | Amend last commit |
149+
150+
### Examples
80151

81-
All settings are configured via environment variables in `.env`:
152+
```bash
153+
# Repository statistics
154+
./devtools.sh stats
82155

83-
| Variable | Default | Description |
84-
| ----------------------- | ----------- | ------------------------ |
85-
| `DOZZLE_PORT` | `9999` | Web UI port |
86-
| `DOZZLE_HOSTNAME` | `localhost` | Display name in UI |
87-
| `DOZZLE_ENABLE_ACTIONS` | `true` | Allow start/stop/restart |
88-
| `DOZZLE_ENABLE_SHELL` | `true` | Allow shell access |
89-
| `DOZZLE_NO_ANALYTICS` | `true` | Disable usage tracking |
90-
| `DOZZLE_AUTH_PROVIDER` | `none` | Authentication mode |
156+
# Clean up branches (preview)
157+
./devtools.sh cleanup --dry-run
91158

92-
See [.env.example](.env.example) for all options.
159+
# Generate changelog
160+
./devtools.sh run "git-changelog.py -o CHANGELOG.md"
93161

94-
## Authentication (Optional)
162+
# Interactive release
163+
./devtools.sh release release
95164

96-
To enable user authentication:
165+
# Migrate to LFS
166+
./devtools.sh lfs-migrate --dry-run
167+
./devtools.sh lfs-migrate --push
168+
```
97169

98-
1. Generate a password hash:
170+
---
99171

100-
```bash
101-
docker run -it --rm amir20/dozzle generate admin --password YourPassword --email admin@example.com
102-
```
172+
## Dozzle - Container Monitor
103173

104-
2. Copy and edit the users file:
174+
Independent Docker container log viewer. See [services/dozzle/README.md](services/dozzle/README.md) for details.
105175

106-
```bash
107-
cp data/users.yml.example data/users.yml
108-
# Add the generated hash to users.yml
109-
```
176+
### Quick Start
110177

111-
3. Enable authentication in `.env`:
178+
```bash
179+
cd services/dozzle
180+
cp .env.example .env
181+
./scripts/dozzle.sh start
182+
```
112183

113-
```bash
114-
DOZZLE_AUTH_PROVIDER=simple
115-
```
184+
---
116185

117-
4. Uncomment the data volume in `docker-compose.yml`
186+
## Project Structure
118187

119-
## Requirements
188+
```
189+
DeveloperTools/
190+
├── devtools.sh # DevTools CLI (Linux/macOS)
191+
├── devtools.ps1 # DevTools CLI (Windows)
192+
193+
├── services/
194+
│ ├── devtools/ # DevTools Runtime Container
195+
│ │ ├── Dockerfile
196+
│ │ ├── entrypoint.sh
197+
│ │ ├── requirements.txt
198+
│ │ └── scripts/
199+
│ │ ├── git-stats.sh
200+
│ │ ├── git-cleanup.sh
201+
│ │ ├── git-changelog.py
202+
│ │ ├── git-release.py
203+
│ │ ├── git-lfs-migrate.sh
204+
│ │ ├── git-history-clean.sh
205+
│ │ ├── git-branch-rename.sh
206+
│ │ ├── git-split-repo.py
207+
│ │ ├── git-rewrite-commits.py
208+
│ │ ├── gh-create-repo.sh
209+
│ │ ├── gh-topic-manager.py
210+
│ │ ├── gh-archive-repos.py
211+
│ │ ├── gh-trigger-workflow.sh
212+
│ │ └── help-devtools
213+
│ │
214+
│ └── dozzle/ # Container Monitor (independent)
215+
│ ├── docker-compose.yml
216+
│ ├── .env.example
217+
│ ├── README.md
218+
│ ├── data/
219+
│ │ └── users.yml.example
220+
│ └── scripts/
221+
│ ├── dozzle.sh
222+
│ └── dozzle.ps1
223+
224+
└── .github/ # CI/CD workflows
225+
```
120226

121-
- Docker Desktop (Windows/macOS) or Docker Engine (Linux)
122-
- Docker Compose v2+
227+
## Adding New Tools
123228

124-
## Documentation
229+
1. Add scripts to `services/devtools/scripts/`
230+
2. Make them executable in the Dockerfile
231+
3. Add Python dependencies to `requirements.txt`
232+
4. Update `help-devtools` with new commands
233+
5. Add CLI integration to `devtools.sh` and `devtools.ps1`
125234

126-
- [Dozzle Documentation](https://dozzle.dev)
127-
- [Container Actions](https://dozzle.dev/guide/actions)
128-
- [Shell Access](https://dozzle.dev/guide/shell)
129-
- [Authentication](https://dozzle.dev/guide/authentication)
235+
## Requirements
236+
237+
- Docker Desktop (Windows/macOS) or Docker Engine (Linux)
238+
- Docker Compose v2+ (for Dozzle)
239+
- GitHub CLI (`gh`) for GitHub tools (installed in container)
130240

131241
## License
132242

0 commit comments

Comments
 (0)