Gog CLI is a powerful, interactive command-line interface for managing your Gmail, built with Laravel Zero. It allows you to check your emails directly from your terminal with a beautiful, modern UI.
- ๐จ Interactive Email List: View your recent emails in a beautifully formatted table.
- ๐ Quick Preview: Select an email to instantly view its details and snippet.
- ๐ Secure Authentication: OAuth2 integration with Google for secure login.
- โก Fast: Built for speed and efficiency in the terminal.
-
Clone the repository
git clone https://github.com/devMuhammad05/gog-cli.git cd gog-cli -
Install dependencies
composer install
-
Setup Credentials
- Place your Google OAuth
credentials.jsonfile in the project's storage path (or configured path). - Ensure the
google.phpconfig points to the correct credentials location.
- Place your Google OAuth
First, you need to authenticate with your Google account. Run:
php gog-cli auth:loginFollow the interactive prompts to authorize the application in your browser.
To view your emails, run:
php gog-cli gmail:listThis will:
- Fetch your latest emails (with a cool spinner!).
- Display them in a table (#, From, Subject, Date).
- Prompt you to enter the
#of the email you want to read.
You can specify the number of emails to retrieve:
php gog-cli gmail:list --limit=20Search your Gmail messages using standard Gmail search operators:
php gog-cli gmail:search "from:boss"
php gog-cli gmail:search "is:unread"
php gog-cli gmail:search "subject:meeting"
php gog-cli gmail:search "has:attachment after:2024/01/01"This will:
- Search your emails using the provided query.
- Display matching results in a table.
- Allow you to select an email to view its details.
Common search operators:
from:sender@example.com- Emails from a specific senderto:recipient@example.com- Emails to a specific recipientsubject:keyword- Emails with keyword in subjectis:unread- Unread emailsis:starred- Starred emailshas:attachment- Emails with attachmentsafter:YYYY/MM/DD- Emails after a specific datebefore:YYYY/MM/DD- Emails before a specific date
- Laravel Zero - The framework for console artisans.
- Laravel Prompts - For beautiful and user-friendly forms.
- Google API Client - Interaction with Gmail API.
Gog CLI is open-sourced software licensed under the MIT license.
