๐Ÿ› ๏ธ 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.

pub package
MIT License


๐Ÿš€ 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 ~/.zshrc or source ~/.bashrc), you can use your chosen alias (e.g., myflutter) instead of dig_cli in 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:

  1. Open Notepad and add the following line:
    @echo off
    dig_cli %*
    
  2. Save the file as myflutter.bat in a directory included in your system's PATH (e.g., C:\Windows).
  3. Now you can use myflutter instead of dig_cli in 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 of dig_cli in all commands.


๐Ÿค Contributing

  1. Fork this repo
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'feat: add something')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

๐Ÿ“ License

Licensed under the MIT License.


Made with โค๏ธ by Digvijaysinh Chauhan

Libraries