๐ ๏ธ dig_cli
Note: The default command is
dig_cli. If you want to use a shorter command, you must set up an alias (see the 'Setup Alias' section below).
A powerful Flutter CLI tool for building APKs and AABs with automatic timestamped filenames, cleaning build artifacts, and organizing output โ all from your terminal.
๐ Features
- ๐ฆ Build APK: Generate release APKs with datetime-stamped filenames
- ๐ฏ Build AAB: Generate Android App Bundles (.aab) with timestamps
- ๐งน Clean Projects: Deep clean Flutter, iOS, and Android build files
- ๐ฅ๏ธ Auto-Export to Desktop: Outputs are automatically moved to your Desktop
- โฑ Timestamp Naming: Output files are named using the current date and time
- ๐ Cross-Platform: Works on macOS, Windows, and Linux
๐ฆ Installation
โ From pub.dev
flutter pub global activate dig_cli
๐ From GitHub (local source)
git clone https://github.com/Digvijaysinh2204/dig_cli.git
cd dig_cli
flutter pub global activate --source path .
Install globally via Git:
dart pub global activate --source git https://github.com/Digvijaysinh2204/dig_cli.git
๐ฅ๏ธ 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 (macOS and Linux setup is the same):
# 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.
โ๏ธ Usage
Build APK
dig_cli create build
Output (Desktop): yourproject-25-12-2025-02.30PM.apk
Build AAB
dig_cli create bundle
Output (Desktop): yourproject-25-12-2025-02.30PM.aab
Clean Project
dig_cli clean
Or:
dig_cli clear build
This cleans:
- Flutter build and cache
- Android
.gradle,.cxx, build folders - iOS workspace, Pods, build folder, and DerivedData (macOS only)
๐งช Examples
dig_cli create apk
dig_cli create build
# Builds PubSpecName-DD-MM-YYYY-HH.MMAM.apk to Desktop
dig_cli create build --name MyApp
# Builds MyApp-DD-MM-YYYY-HH.MMAM.apk to Desktop
dig_cli create bundle -o ./output
# Builds AAB to ./output folder
dig_cli clean
# Fully cleans Android and iOS artifacts
# Build APK with custom name and output directory
dig_cli create apk --name MyApp --output ~/Downloads
# Builds MyApp-DD-MM-YYYY-HH.MMAM.apk to your Downloads folder
๐ Output File Naming
All output files follow the pattern:
- APK:
{project_or_custom_name}-{dd-mm-yyyy}-{hh.mmAM}.apk - AAB:
{project_or_custom_name}-{dd-mm-yyyy}-{hh.mmAM}.aab
These are automatically moved to your Desktop (or a specified output directory).
โ๏ธ Options
| Option | Alias | Description |
|---|---|---|
--help |
-h |
Show help |
--version |
-v |
Show version information |
--output <dir> |
-o |
Specify output directory (default: Desktop) |
--name <prefix> |
-n |
Use custom prefix instead of project name for the output |
๐งฌ Requirements
- Flutter SDK โฅ 3.0.0
- Dart SDK โฅ 2.19.0
- Android SDK (for APK/AAB)
- Xcode & CocoaPods (for iOS cleanup on macOS)
๐ง Setup Alias (Optional)
By default, use dig_cli in your terminal. If you prefer a shorter command, you can set up an alias:
# Add this to ~/.zshrc or ~/.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 ~/.zshrc), you can use your chosen alias (e.g.,myflutter) instead ofdig_cliin all commands.
๐ 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