|
1 | | -# Developer Tools |
| 1 | +# DevTools - Swiss Army Knife for Git-based Development |
2 | 2 |
|
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. |
4 | 4 |
|
5 | | -Based on [Dozzle](https://dozzle.dev) - a lightweight, web-based Docker log viewer. |
| 5 | +## Services |
6 | 6 |
|
7 | | -## Features |
| 7 | +This repository contains independent tools that can be used separately: |
8 | 8 |
|
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/` | |
16 | 13 |
|
17 | | -## Quick Start |
| 14 | +## DevTools Runtime Container |
18 | 15 |
|
19 | | -### 1. Configure |
| 16 | +Interactive container with Git, Python 3.12, and shell utilities for Git-based development workflows. |
20 | 17 |
|
21 | | -```bash |
22 | | -cp .env.example .env |
23 | | -``` |
24 | | - |
25 | | -Edit `.env` to customize settings (optional). |
| 18 | +### Features |
26 | 19 |
|
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 |
28 | 26 |
|
29 | | -**Windows (PowerShell):** |
| 27 | +### Quick Start |
30 | 28 |
|
31 | 29 | ```powershell |
32 | | -.\scripts\dozzle.ps1 start |
33 | | -``` |
| 30 | +# Build the container |
| 31 | +.\devtools.ps1 build |
34 | 32 |
|
35 | | -**Linux/macOS:** |
| 33 | +# Start interactive shell in current directory |
| 34 | +.\devtools.ps1 shell |
36 | 35 |
|
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 |
40 | 38 | ``` |
41 | 39 |
|
42 | | -**Or directly with Docker Compose:** |
| 40 | +### Commands |
43 | 41 |
|
44 | | -```bash |
45 | | -docker compose up -d |
46 | | -``` |
| 42 | +#### Runtime Container |
47 | 43 |
|
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 | |
49 | 49 |
|
50 | | -Open [http://localhost:9999](http://localhost:9999) in your browser. |
| 50 | +#### Git Tools |
51 | 51 |
|
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) | |
53 | 63 |
|
54 | | -Management scripts are available for Windows and Linux/macOS: |
| 64 | +#### GitHub Tools |
55 | 65 |
|
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 | |
66 | 72 |
|
67 | | -**Windows:** |
| 73 | +### Tool Details |
68 | 74 |
|
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 |
71 | 94 | ``` |
72 | 95 |
|
73 | | -**Linux/macOS:** |
| 96 | +#### GitHub Management Tools |
74 | 97 |
|
75 | 98 | ```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 |
77 | 117 | ``` |
78 | 118 |
|
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 |
80 | 151 |
|
81 | | -All settings are configured via environment variables in `.env`: |
| 152 | +```bash |
| 153 | +# Repository statistics |
| 154 | +./devtools.sh stats |
82 | 155 |
|
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 |
91 | 158 |
|
92 | | -See [.env.example](.env.example) for all options. |
| 159 | +# Generate changelog |
| 160 | +./devtools.sh run "git-changelog.py -o CHANGELOG.md" |
93 | 161 |
|
94 | | -## Authentication (Optional) |
| 162 | +# Interactive release |
| 163 | +./devtools.sh release release |
95 | 164 |
|
96 | | -To enable user authentication: |
| 165 | +# Migrate to LFS |
| 166 | +./devtools.sh lfs-migrate --dry-run |
| 167 | +./devtools.sh lfs-migrate --push |
| 168 | +``` |
97 | 169 |
|
98 | | -1. Generate a password hash: |
| 170 | +--- |
99 | 171 |
|
100 | | - ```bash |
101 | | - docker run -it --rm amir20/dozzle generate admin --password YourPassword --email admin@example.com |
102 | | - ``` |
| 172 | +## Dozzle - Container Monitor |
103 | 173 |
|
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. |
105 | 175 |
|
106 | | - ```bash |
107 | | - cp data/users.yml.example data/users.yml |
108 | | - # Add the generated hash to users.yml |
109 | | - ``` |
| 176 | +### Quick Start |
110 | 177 |
|
111 | | -3. Enable authentication in `.env`: |
| 178 | +```bash |
| 179 | +cd services/dozzle |
| 180 | +cp .env.example .env |
| 181 | +./scripts/dozzle.sh start |
| 182 | +``` |
112 | 183 |
|
113 | | - ```bash |
114 | | - DOZZLE_AUTH_PROVIDER=simple |
115 | | - ``` |
| 184 | +--- |
116 | 185 |
|
117 | | -4. Uncomment the data volume in `docker-compose.yml` |
| 186 | +## Project Structure |
118 | 187 |
|
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 | +``` |
120 | 226 |
|
121 | | -- Docker Desktop (Windows/macOS) or Docker Engine (Linux) |
122 | | -- Docker Compose v2+ |
| 227 | +## Adding New Tools |
123 | 228 |
|
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` |
125 | 234 |
|
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) |
130 | 240 |
|
131 | 241 | ## License |
132 | 242 |
|
|
0 commit comments