optikit 1.2.5 โ 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/build.md +57 -0
- package/.claude/commands/clean.md +45 -0
- package/.claude/commands/generate.md +64 -0
- package/.claude/commands/rollback.md +67 -0
- package/.claude/commands/run.md +63 -0
- package/.claude/commands/setup.md +69 -0
- package/.claude/commands/sync-docs.md +148 -0
- package/.claude/commands/version.md +63 -0
- package/.claude/settings.local.json +28 -0
- package/.claude-plugin/marketplace.json +36 -0
- package/.claude-plugin/plugin.json +25 -0
- package/.history/README_20260325211923.md +268 -0
- package/.history/README_20260325212116.md +268 -0
- package/.history/README_20260325212234.md +266 -0
- package/.history/README_20260325221838.md +321 -0
- package/.history/README_20260325221920.md +327 -0
- package/.history/README_20260325222245.md +328 -0
- package/.history/README_20260325222247.md +328 -0
- package/.mcp.json +8 -0
- package/CHANGELOG.md +67 -98
- package/CLAUDE.md +57 -206
- package/OPTIKIT_AGENT.md +398 -0
- package/README.md +293 -60
- package/dist/cli.js +75 -244
- package/dist/commands/build/commands.js +146 -0
- package/dist/commands/build/testflight.js +14 -0
- package/dist/commands/clean/commands.js +41 -0
- package/dist/commands/clean/flutter.js +8 -14
- package/dist/commands/clean/ios.js +12 -15
- package/dist/commands/config/aliases.js +122 -0
- package/dist/commands/config/commands.js +49 -0
- package/dist/commands/config/initApp.js +191 -0
- package/dist/commands/config/rollback.js +15 -4
- package/dist/commands/config/upgrade.js +36 -0
- package/dist/commands/mcp/commands.js +21 -0
- package/dist/commands/mcp/server.js +27 -0
- package/dist/commands/mcp/setup.js +62 -0
- package/dist/commands/mcp/tools.js +359 -0
- package/dist/commands/project/commands.js +132 -0
- package/dist/commands/project/devices.js +10 -26
- package/dist/commands/project/doctor.js +58 -0
- package/dist/commands/project/generate.js +183 -30
- package/dist/commands/project/setup.js +10 -28
- package/dist/commands/project/status.js +65 -0
- package/dist/commands/version/bump.js +75 -101
- package/dist/commands/version/commands.js +63 -0
- package/dist/commands/version/update.js +36 -24
- package/dist/constants.js +6 -1
- package/dist/styles.js +42 -5
- package/dist/utils/helpers/error.js +14 -0
- package/dist/utils/helpers/file.js +1 -1
- package/dist/utils/helpers/version.js +2 -1
- package/dist/utils/services/backup.js +12 -1
- package/dist/utils/services/command.js +1 -34
- package/dist/utils/services/exec.js +76 -101
- package/dist/utils/services/logger.js +10 -4
- package/dist/utils/validators/validation.js +24 -12
- package/docs/INSTALLATION.md +72 -0
- package/docs/TROUBLESHOOT.md +140 -0
- package/docs/USAGE.md +185 -0
- package/docs/VERSION_MANAGEMENT.md +177 -0
- package/package.json +7 -11
- package/src/cli.ts +82 -371
- package/src/commands/build/commands.ts +169 -0
- package/src/commands/build/testflight.ts +18 -0
- package/src/commands/clean/commands.ts +43 -0
- package/src/commands/clean/flutter.ts +9 -13
- package/src/commands/clean/ios.ts +13 -13
- package/src/commands/config/aliases.ts +150 -0
- package/src/commands/config/commands.ts +50 -0
- package/src/commands/config/initApp.ts +213 -0
- package/src/commands/config/rollback.ts +16 -4
- package/src/commands/config/upgrade.ts +40 -0
- package/src/commands/mcp/commands.ts +23 -0
- package/src/commands/mcp/server.ts +35 -0
- package/src/commands/mcp/setup.ts +69 -0
- package/src/commands/mcp/tools.ts +365 -0
- package/src/commands/project/commands.ts +132 -0
- package/src/commands/project/devices.ts +11 -24
- package/src/commands/project/doctor.ts +81 -0
- package/src/commands/project/generate.ts +211 -32
- package/src/commands/project/setup.ts +13 -30
- package/src/commands/project/status.ts +72 -0
- package/src/commands/version/bump.ts +98 -110
- package/src/commands/version/commands.ts +76 -0
- package/src/commands/version/update.ts +86 -75
- package/src/constants.ts +7 -1
- package/src/styles.ts +49 -7
- package/src/utils/helpers/error.ts +16 -0
- package/src/utils/helpers/file.ts +1 -1
- package/src/utils/helpers/version.ts +2 -1
- package/src/utils/services/backup.ts +17 -1
- package/src/utils/services/command.ts +1 -58
- package/src/utils/services/exec.ts +92 -117
- package/src/utils/services/logger.ts +12 -4
- package/src/utils/validators/validation.ts +24 -12
- package/CODE_QUALITY.md +0 -398
- package/ENHANCEMENTS.md +0 -310
- package/FEATURE_ENHANCEMENTS.md +0 -435
- package/INSTALLATION.md +0 -118
- package/SAFETY_FEATURES.md +0 -396
- package/TROUBLESHOOT.md +0 -60
- package/USAGE.md +0 -412
- package/VERSION_MANAGEMENT.md +0 -438
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
<h1 align="center">๐ OptiKit CLI</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Build, version, and deploy Flutter apps in one CLI.</strong><br/>
|
|
5
|
+
The command-line toolkit for Flutter & Opticore developers.
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://www.npmjs.com/package/optikit"><img src="https://img.shields.io/npm/v/optikit?style=flat-square&color=cyan&label=npm" alt="npm"/></a>
|
|
10
|
+
<img src="https://img.shields.io/badge/MCP-Supported-orange?style=flat-square" alt="MCP Supported"/>
|
|
11
|
+
<img src="https://img.shields.io/badge/Platform-macOS%20%7C%20Linux%20%7C%20Windows-blue?style=flat-square" alt="Platform"/>
|
|
12
|
+
<a href="https://pub.dev/packages/opticore"><img src="https://img.shields.io/badge/Opticore-pub.dev-teal?style=flat-square" alt="Opticore"/></a>
|
|
13
|
+
<a href="https://www.linkedin.com/in/dev-mahmoud-elshenawy/"><img src="https://img.shields.io/badge/Creator-Mahmoud%20El%20Shenawy-blue?style=flat-square" alt="Creator"/></a>
|
|
14
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow?style=flat-square" alt="License"/></a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<a href="https://www.buymeacoffee.com/m.elshenawy">
|
|
19
|
+
<img src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support%20My%20Work-FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=0D1117" alt="Buy Me A Coffee"/>
|
|
20
|
+
</a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## โก Install & Go
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g optikit
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
You get two commands โ `optikit` (full name) and `ok` (shorthand). Both work identically.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
optikit init # ๐ง Setup OptiKit in your project
|
|
35
|
+
optikit bump patch # ๐ฆ 1.0.0 โ 1.0.1
|
|
36
|
+
optikit apk # ๐๏ธ Build release APK
|
|
37
|
+
optikit tf -o # ๐ TestFlight: bump iOS + build IPA + open
|
|
38
|
+
optikit gen module login -r # ๐งฉ Generate BLoC module with route
|
|
39
|
+
optikit aliases # ๐ See all shortcuts
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
> ๐ก Prefer shorter commands? Use `ok` instead of `optikit` โ every example above works with both.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## ๐ฅ Why OptiKit?
|
|
47
|
+
|
|
48
|
+
| Feature | Description |
|
|
49
|
+
|---------|-------------|
|
|
50
|
+
| ๐ค **Claude Code Plugin** | AI understands your project and acts on it via MCP |
|
|
51
|
+
| โ
**Short aliases** | Every command has a memorable shortcut |
|
|
52
|
+
| โ
**Combo flags** | Clean, bump, build, and open in one command |
|
|
53
|
+
| โ
**Smart versioning** | Dual iOS/Android build numbers handled automatically |
|
|
54
|
+
| โ
**Auto backups** | Version files backed up before every change |
|
|
55
|
+
| โ
**Module scaffolding** | Full BLoC pattern generated in one command |
|
|
56
|
+
| โ
**FVM support** | Built-in Flutter Version Manager integration |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## ๐ Commands at a Glance
|
|
61
|
+
|
|
62
|
+
> Every command has a short alias. Run `optikit aliases` to see the full list in your terminal.
|
|
63
|
+
|
|
64
|
+
### ๐๏ธ Build
|
|
65
|
+
|
|
66
|
+
| Command | Alias | What it does |
|
|
67
|
+
|---------|-------|-------------|
|
|
68
|
+
| `optikit flutter-build-apk` | `apk` | Build release APK |
|
|
69
|
+
| `optikit flutter-build-bundle` | `aab` | Build release AAB |
|
|
70
|
+
| `optikit flutter-build-ios` | `ios` | Build iOS app |
|
|
71
|
+
| `optikit flutter-build-ipa` | `ipa` | Build release IPA |
|
|
72
|
+
| `optikit testflight` | `tf` | Bump iOS build + build IPA |
|
|
73
|
+
|
|
74
|
+
**Combo flags** โ mix and match on any build command:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
optikit apk --clean # ๐งน Clean โ build
|
|
78
|
+
optikit ipa -b patch -o # ๐ฆ Bump โ build โ open output
|
|
79
|
+
optikit ipa --clean -i -o # ๐งน Clean โ bump iOS โ build โ open
|
|
80
|
+
optikit tf -o # ๐ TestFlight โ open output
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### ๐งน Clean
|
|
84
|
+
|
|
85
|
+
| Command | Alias | What it does |
|
|
86
|
+
|---------|-------|-------------|
|
|
87
|
+
| `optikit clean` | `c` | Clean Flutter project |
|
|
88
|
+
| `optikit clean-flutter` | `cf` | Clean Flutter (explicit) |
|
|
89
|
+
| `optikit clean-ios` | `ci` | Clean iOS / CocoaPods |
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
optikit clean -a # Clean all (Flutter + iOS)
|
|
93
|
+
optikit ci -cu # Clean iOS + cache + repo update
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### ๐ฆ Version
|
|
97
|
+
|
|
98
|
+
| Command | Alias | What it does |
|
|
99
|
+
|---------|-------|-------------|
|
|
100
|
+
| `optikit version` | `v` | Show current version |
|
|
101
|
+
| `optikit bump patch` | | Bug fix: 1.0.0 โ 1.0.1 |
|
|
102
|
+
| `optikit bump minor` | | Feature: 1.0.0 โ 1.1.0 |
|
|
103
|
+
| `optikit bump major` | | Breaking: 1.0.0 โ 2.0.0 |
|
|
104
|
+
| `optikit bump-ios` | `bi` | Bump iOS build only |
|
|
105
|
+
| `optikit bump-android` | `ba` | Bump Android build only |
|
|
106
|
+
| `optikit bump-build` | `bb` | Bump both build numbers |
|
|
107
|
+
|
|
108
|
+
> ๐ Deep dive: **[Version Management](docs/VERSION_MANAGEMENT.md)**
|
|
109
|
+
|
|
110
|
+
### ๐งฉ Generate
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
optikit gen module login # Scaffold BLoC module
|
|
114
|
+
optikit gen module login -r # Scaffold + register route
|
|
115
|
+
optikit gen repo user # Generate repository
|
|
116
|
+
optikit route settings # Add route to app_router.dart
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### ๐ฑ Run & Open
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
optikit run # Run app on device
|
|
123
|
+
optikit rs # Interactive device picker
|
|
124
|
+
optikit devs # List connected devices
|
|
125
|
+
optikit xcode # Open in Xcode
|
|
126
|
+
optikit studio # Open in Android Studio
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### ๐ง Tools
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
optikit info # Project status snapshot
|
|
133
|
+
optikit dr # Environment health check
|
|
134
|
+
optikit undo # List/restore backups
|
|
135
|
+
optikit up # Check for CLI updates
|
|
136
|
+
optikit vscode # Setup VS Code settings
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## ๐ฏ Common Workflows
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# ๐ TestFlight upload
|
|
145
|
+
optikit tf -o
|
|
146
|
+
|
|
147
|
+
# ๐ฆ Release APK with version bump
|
|
148
|
+
optikit apk -b patch -o
|
|
149
|
+
|
|
150
|
+
# ๐งน Full clean rebuild
|
|
151
|
+
optikit ipa --clean -o
|
|
152
|
+
|
|
153
|
+
# ๐งฉ New feature module
|
|
154
|
+
optikit gen module user_profile -r
|
|
155
|
+
|
|
156
|
+
# ๐ Check project state
|
|
157
|
+
optikit info
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## โ๏ธ Configuration
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
optikit init # Creates .optikitrc.json
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"backupRetentionCount": 5,
|
|
171
|
+
"useFvmByDefault": true,
|
|
172
|
+
"autoBackup": true
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
| Option | Default | Description |
|
|
177
|
+
|--------|---------|-------------|
|
|
178
|
+
| `backupRetentionCount` | `5` | Number of backups to keep per file |
|
|
179
|
+
| `useFvmByDefault` | `true` | Use FVM for all Flutter commands |
|
|
180
|
+
| `autoBackup` | `true` | Backup files before version changes |
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## ๐พ Backups & Rollback
|
|
185
|
+
|
|
186
|
+
OptiKit **automatically backs up** version files before any modification:
|
|
187
|
+
|
|
188
|
+
| File | Backed up before |
|
|
189
|
+
|------|-----------------|
|
|
190
|
+
| `pubspec.yaml` | Version bumps, clean |
|
|
191
|
+
| `ios/Runner.xcodeproj/project.pbxproj` | Version bumps |
|
|
192
|
+
| `ios/Runner/Info.plist` | Version bumps |
|
|
193
|
+
|
|
194
|
+
Backups are stored in `.optikit-backup/` directories next to the original files with timestamps:
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
your-project/
|
|
198
|
+
โโโ pubspec.yaml
|
|
199
|
+
โโโ .optikit-backup/
|
|
200
|
+
โ โโโ pubspec_2026-03-25T10-30-00-000Z.yaml
|
|
201
|
+
โ โโโ pubspec_2026-03-25T11-15-30-000Z.yaml
|
|
202
|
+
โโโ ios/Runner.xcodeproj/
|
|
203
|
+
โโโ project.pbxproj
|
|
204
|
+
โโโ .optikit-backup/
|
|
205
|
+
โโโ project_2026-03-25T10-30-00-000Z.pbxproj
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Manage backups:**
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
optikit undo # ๐ List all backups
|
|
212
|
+
optikit undo --restore 1 # โป๏ธ Restore backup #1
|
|
213
|
+
optikit undo --before 2026-03-20 # ๐
Filter backups by date
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Old backups are automatically cleaned up (keeps last 5 by default, configurable via `backupRetentionCount`).
|
|
217
|
+
|
|
218
|
+
> ๐ก `.optikit-backup/` is added to `.gitignore` during `optikit init`.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## ๐ค AI-Powered with Claude Code
|
|
223
|
+
|
|
224
|
+
<p align="center">
|
|
225
|
+
<img src="https://img.shields.io/badge/Claude%20Code-Plugin-blueviolet?style=for-the-badge" alt="Claude Code Plugin"/>
|
|
226
|
+
<img src="https://img.shields.io/badge/MCP-Supported-orange?style=for-the-badge" alt="MCP Supported"/>
|
|
227
|
+
<img src="https://img.shields.io/badge/Transport-stdio-green?style=for-the-badge" alt="stdio Transport"/>
|
|
228
|
+
</p>
|
|
229
|
+
|
|
230
|
+
OptiKit ships as a **Claude Code plugin** powered by the **Model Context Protocol (MCP)**. Claude doesn't just run commands โ it **understands your Flutter project** and makes intelligent decisions.
|
|
231
|
+
|
|
232
|
+
### ๐ง How It Works
|
|
233
|
+
|
|
234
|
+
You describe what you need. Claude **picks the right tools automatically**:
|
|
235
|
+
|
|
236
|
+
| You say | Claude does |
|
|
237
|
+
|---------|-----------|
|
|
238
|
+
| *"Fix this build error"* | Runs `clean` โ `build` automatically |
|
|
239
|
+
| *"Prepare a TestFlight build"* | Runs `testflight` (bump iOS + build IPA) |
|
|
240
|
+
| *"Create a login feature"* | Generates BLoC module + registers route |
|
|
241
|
+
| *"We need to release v2.0"* | Bumps major version + builds both platforms |
|
|
242
|
+
| *"What version are we on?"* | Shows version with iOS & Android build numbers |
|
|
243
|
+
| *"Undo the last version bump"* | Lists backups and restores the right one |
|
|
244
|
+
|
|
245
|
+
### โก Setu Seconds
|
|
246
|
+
|
|
247
|
+
**Option 1 โ Plugin Marketplace:**
|
|
248
|
+
```bash
|
|
249
|
+
/plugin marketplace add dev-mahmoud-elshenawy/optikit
|
|
250
|
+
/plugin install optikit
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Option 2 โ One Command:**
|
|
254
|
+
```bash
|
|
255
|
+
optikit setup-claude
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
That's it. All OptiKit tools are instantly available to Claude.
|
|
259
|
+
|
|
260
|
+
### ๐ ๏ธ Available Tool Categories
|
|
261
|
+
|
|
262
|
+
| Category | What Claude can do |
|
|
263
|
+
|----------|--------------------|
|
|
264
|
+
| ๐๏ธ **Build** | Build APK, AAB, iOS, IPA with clean/bump/open combos |
|
|
265
|
+
| ๐งน **Clean** | Fix stale caches, CocoaPods issues, full project cleanup |
|
|
266
|
+
| ๐ฆ **Version** | Bump versions, manage iOS/Android build numbers independently |
|
|
267
|
+
| ๐งฉ **Generate** | Scaffold BLoC modules, repositories, and auto-register routes |
|
|
268
|
+
| ๐ฑ **Run** | Launch app on devices, list connected devices |
|
|
269
|
+
| ๐ง **Diagnostics** | Health checks, project status, backup management |
|
|
270
|
+
| โ๏ธ **Config** | Project setup, VS Code config, upgrade checks |
|
|
271
|
+
|
|
272
|
+
The MCP server runs locally via stdio โ fast, private, no cloud dependency.
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
optikit setup-claude # โ
Register with Claude Code
|
|
276
|
+
optikit setup-claude --uninstall # โ Remove when needed
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## ๐ Documentation
|
|
282
|
+
|
|
283
|
+
| Doc | Description |
|
|
284
|
+
|-----|-------------|
|
|
285
|
+
| ๐ **[Command Reference](docs/USAGE.md)** | All commands, flags, and examples |
|
|
286
|
+
| ๐ฆ **[Version Management](docs/VERSION_MANAGEMENT.md)** | iOS/Android dual build strategy |
|
|
287
|
+
| ๐ง **[Installation Guide](docs/INSTALLATION.md)** | NPM, Homebrew, source install |
|
|
288
|
+
| ๐ **[Troubleshooting](docs/TROUBLESHOOT.md)** | Common issues and quick fixes |
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## โก Supercharge Development with Opticore
|
|
293
|
+
|
|
294
|
+
**OptiKit CLI** is the companion tool for **[Opticore](https://pub.dev/packages/opticore)** โ a lightweight BLoC-based micro-framework for Flutter.
|
|
295
|
+
|
|
296
|
+
| Together they give you | |
|
|
297
|
+
|---|---|
|
|
298
|
+
| ๐งฉ **Module scaffolding** | Generate full BLoC modules that plug directly into Opticore |
|
|
299
|
+
| ๐ฃ๏ธ **Auto-routing** | Register routes in `app_router.dart` with one flag |
|
|
300
|
+
| ๐๏ธ **App initialization** | Scaffold `main.dart`, config, and router for Opticore projects |
|
|
301
|
+
| ๐ฆ **Smart builds** | Build, version, and clean with short commands and combo flags |
|
|
302
|
+
|
|
303
|
+
> ๐ก **Not using Opticore?** No problem โ build, version, clean, and run commands work with **any Flutter project**.
|
|
304
|
+
|
|
305
|
+
๐ฆ **[OptiKit on NPM](https://www.npmjs.com/package/optikit)** | ๐ **[GitHub](https://github.com/dev-mahmoud-elshenawy/optikit)** | ๐ **[Opticore on pub.dev](https://pub.dev/packages/opticore)**
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## ๐ค Created By
|
|
310
|
+
|
|
311
|
+
<div align="center">
|
|
312
|
+
|
|
313
|
+
### Built with โค๏ธ by [Mahmoud El Shenawy](https://github.com/dev-mahmoud-elshenawy)
|
|
314
|
+
|
|
315
|
+
[](https://www.linkedin.com/in/dev-mahmoud-elshenawy)
|
|
316
|
+
[](https://github.com/dev-mahmoud-elshenawy)
|
|
317
|
+
[](https://medium.com/@dev-mahmoud-elshenawy)
|
|
318
|
+
|
|
319
|
+
</div>
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## ๐ License
|
|
324
|
+
|
|
325
|
+
[](./LICENSE)
|
|
326
|
+
|
|
327
|
+
**OptiKit** is open-source under the **[MIT License](./LICENSE)**. Free for personal and commercial use.
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
<h1 align="center">๐ OptiKit CLI</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Build, version, and deploy Flutter apps in one CLI.</strong><br/>
|
|
5
|
+
The command-line toolkit for Flutter & Opticore developers.
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://www.npmjs.com/package/optikit"><img src="https://img.shields.io/npm/v/optikit?style=flat-square&color=cyan&label=npm" alt="npm"/></a>
|
|
10
|
+
<a href="https://flutter.dev"><img src="https://img.shields.io/badge/Flutter-Compatible-02569B?style=flat-square&logo=flutter&logoColor=white" alt="Flutter"/></a>
|
|
11
|
+
<img src="https://img.shields.io/badge/MCP-Supported-orange?style=flat-square" alt="MCP Supported"/>
|
|
12
|
+
<img src="https://img.shields.io/badge/Platform-macOS%20%7C%20Linux%20%7C%20Windows-blue?style=flat-square" alt="Platform"/>
|
|
13
|
+
<a href="https://pub.dev/packages/opticore"><img src="https://img.shields.io/badge/Opticore-pub.dev-teal?style=flat-square" alt="Opticore"/></a>
|
|
14
|
+
<a href="https://www.linkedin.com/in/dev-mahmoud-elshenawy/"><img src="https://img.shields.io/badge/Creator-Mahmoud%20El%20Shenawy-blue?style=flat-square" alt="Creator"/></a>
|
|
15
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow?style=flat-square" alt="License"/></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="https://www.buymeacoffee.com/m.elshenawy">
|
|
20
|
+
<img src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support%20My%20Work-FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=0D1117" alt="Buy Me A Coffee"/>
|
|
21
|
+
</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## โก Install & Go
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install -g optikit
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
You get two commands โ `optikit` (full name) and `ok` (shorthand). Both work identically.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
optikit init # ๐ง Setup OptiKit in your project
|
|
36
|
+
optikit bump patch # ๐ฆ 1.0.0 โ 1.0.1
|
|
37
|
+
optikit apk # ๐๏ธ Build release APK
|
|
38
|
+
optikit tf -o # ๐ TestFlight: bump iOS + build IPA + open
|
|
39
|
+
optikit gen module login -r # ๐งฉ Generate BLoC module with route
|
|
40
|
+
optikit aliases # ๐ See all shortcuts
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
> ๐ก Prefer shorter commands? Use `ok` instead of `optikit` โ every example above works with both.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## ๐ฅ Why OptiKit?
|
|
48
|
+
|
|
49
|
+
| Feature | Description |
|
|
50
|
+
|---------|-------------|
|
|
51
|
+
| ๐ค **Claude Code Plugin** | AI understands your project and acts on it via MCP |
|
|
52
|
+
| โ
**Short aliases** | Every command has a memorable shortcut |
|
|
53
|
+
| โ
**Combo flags** | Clean, bump, build, and open in one command |
|
|
54
|
+
| โ
**Smart versioning** | Dual iOS/Android build numbers handled automatically |
|
|
55
|
+
| โ
**Auto backups** | Version files backed up before every change |
|
|
56
|
+
| โ
**Module scaffolding** | Full BLoC pattern generated in one command |
|
|
57
|
+
| โ
**FVM support** | Built-in Flutter Version Manager integration |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## ๐ Commands at a Glance
|
|
62
|
+
|
|
63
|
+
> Every command has a short alias. Run `optikit aliases` to see the full list in your terminal.
|
|
64
|
+
|
|
65
|
+
### ๐๏ธ Build
|
|
66
|
+
|
|
67
|
+
| Command | Alias | What it does |
|
|
68
|
+
|---------|-------|-------------|
|
|
69
|
+
| `optikit flutter-build-apk` | `apk` | Build release APK |
|
|
70
|
+
| `optikit flutter-build-bundle` | `aab` | Build release AAB |
|
|
71
|
+
| `optikit flutter-build-ios` | `ios` | Build iOS app |
|
|
72
|
+
| `optikit flutter-build-ipa` | `ipa` | Build release IPA |
|
|
73
|
+
| `optikit testflight` | `tf` | Bump iOS build + build IPA |
|
|
74
|
+
|
|
75
|
+
**Combo flags** โ mix and match on any build command:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
optikit apk --clean # ๐งน Clean โ build
|
|
79
|
+
optikit ipa -b patch -o # ๐ฆ Bump โ build โ open output
|
|
80
|
+
optikit ipa --clean -i -o # ๐งน Clean โ bump iOS โ build โ open
|
|
81
|
+
optikit tf -o # ๐ TestFlight โ open output
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### ๐งน Clean
|
|
85
|
+
|
|
86
|
+
| Command | Alias | What it does |
|
|
87
|
+
|---------|-------|-------------|
|
|
88
|
+
| `optikit clean` | `c` | Clean Flutter project |
|
|
89
|
+
| `optikit clean-flutter` | `cf` | Clean Flutter (explicit) |
|
|
90
|
+
| `optikit clean-ios` | `ci` | Clean iOS / CocoaPods |
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
optikit clean -a # Clean all (Flutter + iOS)
|
|
94
|
+
optikit ci -cu # Clean iOS + cache + repo update
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### ๐ฆ Version
|
|
98
|
+
|
|
99
|
+
| Command | Alias | What it does |
|
|
100
|
+
|---------|-------|-------------|
|
|
101
|
+
| `optikit version` | `v` | Show current version |
|
|
102
|
+
| `optikit bump patch` | | Bug fix: 1.0.0 โ 1.0.1 |
|
|
103
|
+
| `optikit bump minor` | | Feature: 1.0.0 โ 1.1.0 |
|
|
104
|
+
| `optikit bump major` | | Breaking: 1.0.0 โ 2.0.0 |
|
|
105
|
+
| `optikit bump-ios` | `bi` | Bump iOS build only |
|
|
106
|
+
| `optikit bump-android` | `ba` | Bump Android build only |
|
|
107
|
+
| `optikit bump-build` | `bb` | Bump both build numbers |
|
|
108
|
+
|
|
109
|
+
> ๐ Deep dive: **[Version Management](docs/VERSION_MANAGEMENT.md)**
|
|
110
|
+
|
|
111
|
+
### ๐งฉ Generate
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
optikit gen module login # Scaffold BLoC module
|
|
115
|
+
optikit gen module login -r # Scaffold + register route
|
|
116
|
+
optikit gen repo user # Generate repository
|
|
117
|
+
optikit route settings # Add route to app_router.dart
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### ๐ฑ Run & Open
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
optikit run # Run app on device
|
|
124
|
+
optikit rs # Interactive device picker
|
|
125
|
+
optikit devs # List connected devices
|
|
126
|
+
optikit xcode # Open in Xcode
|
|
127
|
+
optikit studio # Open in Android Studio
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### ๐ง Tools
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
optikit info # Project status snapshot
|
|
134
|
+
optikit dr # Environment health check
|
|
135
|
+
optikit undo # List/restore backups
|
|
136
|
+
optikit up # Check for CLI updates
|
|
137
|
+
optikit vscode # Setup VS Code settings
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## ๐ฏ Common Workflows
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# ๐ TestFlight upload
|
|
146
|
+
optikit tf -o
|
|
147
|
+
|
|
148
|
+
# ๐ฆ Release APK with version bump
|
|
149
|
+
optikit apk -b patch -o
|
|
150
|
+
|
|
151
|
+
# ๐งน Full clean rebuild
|
|
152
|
+
optikit ipa --clean -o
|
|
153
|
+
|
|
154
|
+
# ๐งฉ New feature module
|
|
155
|
+
optikit gen module user_profile -r
|
|
156
|
+
|
|
157
|
+
# ๐ Check project state
|
|
158
|
+
optikit info
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## โ๏ธ Configuration
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
optikit init # Creates .optikitrc.json
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"backupRetentionCount": 5,
|
|
172
|
+
"useFvmByDefault": true,
|
|
173
|
+
"autoBackup": true
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
| Option | Default | Description |
|
|
178
|
+
|--------|---------|-------------|
|
|
179
|
+
| `backupRetentionCount` | `5` | Number of backups to keep per file |
|
|
180
|
+
| `useFvmByDefault` | `true` | Use FVM for all Flutter commands |
|
|
181
|
+
| `autoBackup` | `true` | Backup files before version changes |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## ๐พ Backups & Rollback
|
|
186
|
+
|
|
187
|
+
OptiKit **automatically backs up** version files before any modification:
|
|
188
|
+
|
|
189
|
+
| File | Backed up before |
|
|
190
|
+
|------|-----------------|
|
|
191
|
+
| `pubspec.yaml` | Version bumps, clean |
|
|
192
|
+
| `ios/Runner.xcodeproj/project.pbxproj` | Version bumps |
|
|
193
|
+
| `ios/Runner/Info.plist` | Version bumps |
|
|
194
|
+
|
|
195
|
+
Backups are stored in `.optikit-backup/` directories next to the original files with timestamps:
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
your-project/
|
|
199
|
+
โโโ pubspec.yaml
|
|
200
|
+
โโโ .optikit-backup/
|
|
201
|
+
โ โโโ pubspec_2026-03-25T10-30-00-000Z.yaml
|
|
202
|
+
โ โโโ pubspec_2026-03-25T11-15-30-000Z.yaml
|
|
203
|
+
โโโ ios/Runner.xcodeproj/
|
|
204
|
+
โโโ project.pbxproj
|
|
205
|
+
โโโ .optikit-backup/
|
|
206
|
+
โโโ project_2026-03-25T10-30-00-000Z.pbxproj
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**Manage backups:**
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
optikit undo # ๐ List all backups
|
|
213
|
+
optikit undo --restore 1 # โป๏ธ Restore backup #1
|
|
214
|
+
optikit undo --before 2026-03-20 # ๐
Filter backups by date
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Old backups are automatically cleaned up (keeps last 5 by default, configurable via `backupRetentionCount`).
|
|
218
|
+
|
|
219
|
+
> ๐ก `.optikit-backup/` is added to `.gitignore` during `optikit init`.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## ๐ค AI-Powered with Claude Code
|
|
224
|
+
|
|
225
|
+
<p align="center">
|
|
226
|
+
<a href="https://github.com/dev-mahmoud-elshenawy/optikit"><img src="https://img.shields.io/badge/Claude%20Code-Plugin-blueviolet?style=for-the-badge" alt="Claude Code Plugin"/></a>
|
|
227
|
+
<img src="https://img.shields.io/badge/MCP-Supported-orange?style=for-the-badge" alt="MCP Supported"/>
|
|
228
|
+
<img src="https://img.shields.io/badge/Transport-stdio-green?style=for-the-badge" alt="stdio Transport"/>
|
|
229
|
+
</p>
|
|
230
|
+
|
|
231
|
+
OptiKit ships as a **Claude Code plugin** powered by the **Model Context Protocol (MCP)**. Claude doesn't just run commands โ it **understands your Flutter project** and makes intelligent decisions.
|
|
232
|
+
|
|
233
|
+
### ๐ง How It Works
|
|
234
|
+
|
|
235
|
+
You describe what you need. Claude **picks the right tools automatically**:
|
|
236
|
+
|
|
237
|
+
| You say | Claude does |
|
|
238
|
+
|---------|-----------|
|
|
239
|
+
| *"Fix this build error"* | Runs `clean` โ `build` automatically |
|
|
240
|
+
| *"Prepare a TestFlight build"* | Runs `testflight` (bump iOS + build IPA) |
|
|
241
|
+
| *"Create a login feature"* | Generates BLoC module + registers route |
|
|
242
|
+
| *"We need to release v2.0"* | Bumps major version + builds both platforms |
|
|
243
|
+
| *"What version are we on?"* | Shows version with iOS & Android build numbers |
|
|
244
|
+
| *"Undo the last version bump"* | Lists backups and restores the right one |
|
|
245
|
+
|
|
246
|
+
### โก Setup Seconds
|
|
247
|
+
|
|
248
|
+
**Option 1 โ Plugin Marketplace:**
|
|
249
|
+
```bash
|
|
250
|
+
/plugin marketplace add dev-mahmoud-elshenawy/optikit
|
|
251
|
+
/plugin install optikit
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**Option 2 โ One Command:**
|
|
255
|
+
```bash
|
|
256
|
+
optikit setup-claude
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
That's it. All OptiKit tools are instantly available to Claude.
|
|
260
|
+
|
|
261
|
+
### ๐ ๏ธ Available Tool Categories
|
|
262
|
+
|
|
263
|
+
| Category | What Claude can do |
|
|
264
|
+
|----------|--------------------|
|
|
265
|
+
| ๐๏ธ **Build** | Build APK, AAB, iOS, IPA with clean/bump/open combos |
|
|
266
|
+
| ๐งน **Clean** | Fix stale caches, CocoaPods issues, full project cleanup |
|
|
267
|
+
| ๐ฆ **Version** | Bump versions, manage iOS/Android build numbers independently |
|
|
268
|
+
| ๐งฉ **Generate** | Scaffold BLoC modules, repositories, and auto-register routes |
|
|
269
|
+
| ๐ฑ **Run** | Launch app on devices, list connected devices |
|
|
270
|
+
| ๐ง **Diagnostics** | Health checks, project status, backup management |
|
|
271
|
+
| โ๏ธ **Config** | Project setup, VS Code config, upgrade checks |
|
|
272
|
+
|
|
273
|
+
The MCP server runs locally via stdio โ fast, private, no cloud dependency.
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
optikit setup-claude # โ
Register with Claude Code
|
|
277
|
+
optikit setup-claude --uninstall # โ Remove when needed
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## ๐ Documentation
|
|
283
|
+
|
|
284
|
+
| Doc | Description |
|
|
285
|
+
|-----|-------------|
|
|
286
|
+
| ๐ **[Command Reference](docs/USAGE.md)** | All commands, flags, and examples |
|
|
287
|
+
| ๐ฆ **[Version Management](docs/VERSION_MANAGEMENT.md)** | iOS/Android dual build strategy |
|
|
288
|
+
| ๐ง **[Installation Guide](docs/INSTALLATION.md)** | NPM, Homebrew, source install |
|
|
289
|
+
| ๐ **[Troubleshooting](docs/TROUBLESHOOT.md)** | Common issues and quick fixes |
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## โก Supercharge Development with Opticore
|
|
294
|
+
|
|
295
|
+
**OptiKit CLI** is the companion tool for **[Opticore](https://pub.dev/packages/opticore)** โ a lightweight BLoC-based micro-framework for Flutter.
|
|
296
|
+
|
|
297
|
+
| Together they give you | |
|
|
298
|
+
|---|---|
|
|
299
|
+
| ๐งฉ **Module scaffolding** | Generate full BLoC modules that plug directly into Opticore |
|
|
300
|
+
| ๐ฃ๏ธ **Auto-routing** | Register routes in `app_router.dart` with one flag |
|
|
301
|
+
| ๐๏ธ **App initialization** | Scaffold `main.dart`, config, and router for Opticore projects |
|
|
302
|
+
| ๐ฆ **Smart builds** | Build, version, and clean with short commands and combo flags |
|
|
303
|
+
|
|
304
|
+
> ๐ก **Not using Opticore?** No problem โ build, version, clean, and run commands work with **any Flutter project**.
|
|
305
|
+
|
|
306
|
+
๐ฆ **[OptiKit on NPM](https://www.npmjs.com/package/optikit)** | ๐ **[GitHub](https://github.com/dev-mahmoud-elshenawy/optikit)** | ๐ **[Opticore on pub.dev](https://pub.dev/packages/opticore)**
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## ๐ค Created By
|
|
311
|
+
|
|
312
|
+
<div align="center">
|
|
313
|
+
|
|
314
|
+
### Built with โค๏ธ by [Mahmoud El Shenawy](https://github.com/dev-mahmoud-elshenawy)
|
|
315
|
+
|
|
316
|
+
[](https://www.linkedin.com/in/dev-mahmoud-elshenawy)
|
|
317
|
+
[](https://github.com/dev-mahmoud-elshenawy)
|
|
318
|
+
[](https://medium.com/@dev-mahmoud-elshenawy)
|
|
319
|
+
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## ๐ License
|
|
325
|
+
|
|
326
|
+
[](./LICENSE)
|
|
327
|
+
|
|
328
|
+
**OptiKit** is open-source under the **[MIT License](./LICENSE)**. Free for personal and commercial use.
|