๐ ๏ธ dig_cli
A powerful Flutter CLI tool to automate building, cleaning, and packaging your projects.
Overview
dig_cli is a robust command-line interface designed to streamline your Flutter workflow. It automates common tasks such as creating timestamped APKs/AABs, performing deep system-specific cleaning, and packaging your project for sharing or deployment.
It features:
- Beautiful interactive menu
- Dynamic version checking from
pubspec.yaml - Update notifications
๐ Features
- Interactive Menu: Easy navigation; run the tool without commands for a guided experience.
- Build APK/AAB: Release builds with automatic
ProjectName-YYYY-MM-DD-HH-MMnaming. - Deep Clean: Removes Flutter, Gradle, Xcode, and Pods caches on macOS, Windows, and Linux.
- Create Clean ZIP: Packages your project into a ZIP file, excluding files from
.gitignore. - Smart Menu Logic: Hides build options if not in a buildable Flutter project.
- Dynamic Versioning: Reads version from
pubspec.yaml. - Auto Update Check: Checks for new versions on pub.dev and provides update option.
๐ฆ Installation
dart pub global activate dig_cli
After installation, use dig as the command.
โ๏ธ Usage
Interactive Menu (Recommended)
dig
Direct Commands
- Build APK:
dig create apk - Build AAB:
dig create bundle - Clean Project:
dig clean - Create ZIP:
dig zip - Show Version:
dig --version
๐ฅ๏ธ Interactive Menu Example
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DIG CLI TOOL v1.1.0 โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ 1. ๐ Build APK โ
โ 2. ๐ฆ Build AAB โ
โ 3. ๐งน Clean Project โ
โ 4. ๐ค Create Project ZIP โ
โ 5. โจ Update to v1.2.0 โ
โ 0. ๐ช Exit โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Build and update options are shown dynamically based on project status and version availability.
๐งช Examples
# Launch the interactive menu for guided actions
dig
# Build an APK with a custom name and output to the Downloads folder
dig create apk --name MyApp --output ~/Downloads
# Deep clean the project's build artifacts
dig clean
# Create a clean, shareable ZIP file of the project on the Desktop
dig zip
โ๏ธ Options
| Option | Alias | Description |
|---|---|---|
--help |
-h |
Show help (when used with a command) |
--version |
-v |
Show the tool's version |
--output <dir> |
-o |
Specify output directory (default: Desktop) |
--name <prefix> |
-n |
Custom name prefix for build/zip output file |
๐ฅ๏ธ Platform-specific Setup
macOS & Linux (Ubuntu)
By default, use dig_cli in your terminal. If you prefer a shorter command, you can set up an alias:
# Add this to ~/.zshrc, ~/.bashrc, or ~/.zshenv
alias myflutter="dig_cli"
- You can use any alias name you like. After adding the alias and restarting your terminal (or running
source ~/.zshrcorsource ~/.bashrc), you can use your chosen alias (e.g.,myflutter) instead ofdig_cliin all commands.
Windows
PowerShell
Add the following line to your PowerShell profile (you can find your profile path with $PROFILE):
Set-Alias myflutter dig_cli
- Restart PowerShell or run the above command in your current session to use your alias (e.g.,
myflutter).
Command Prompt (cmd.exe)
You can create a simple batch file to act as an alias:
- Open Notepad and add the following line:
@echo off dig_cli %* - Save the file as
myflutter.batin a directory included in your system's PATH (e.g.,C:\Windows). - Now you can use
myflutterinstead ofdig_cliin Command Prompt.
๐ Links
๐ค Contributing
- Fork this repo
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m 'feat: add something') - Push to the branch (
git push origin feature/my-feature) - Open a Pull Request
๐ License
Licensed under the MIT License.
Made with โค๏ธ by Digvijaysinh Chauhan