Skip to content

GOG CLI โ€” A command-line tool to interact with Gmail and Google services, written in PHP ๐Ÿ˜

Notifications You must be signed in to change notification settings

devMuhammad05/gog-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Logo

Gog CLI

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.

PHP Laravel Zero

โœจ Features

  • ๐Ÿ“จ 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.

๐Ÿš€ Installation

  1. Clone the repository

    git clone https://github.com/devMuhammad05/gog-cli.git
    cd gog-cli
  2. Install dependencies

    composer install
  3. Setup Credentials

    • Place your Google OAuth credentials.json file in the project's storage path (or configured path).
    • Ensure the google.php config points to the correct credentials location.

๐ŸŽฎ Usage

Authentication

First, you need to authenticate with your Google account. Run:

php gog-cli auth:login

Follow the interactive prompts to authorize the application in your browser.

List Emails

To view your emails, run:

php gog-cli gmail:list

This will:

  1. Fetch your latest emails (with a cool spinner!).
  2. Display them in a table (#, From, Subject, Date).
  3. Prompt you to enter the # of the email you want to read.

List Options

You can specify the number of emails to retrieve:

php gog-cli gmail:list --limit=20

Search Emails

Search 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:

  1. Search your emails using the provided query.
  2. Display matching results in a table.
  3. Allow you to select an email to view its details.

Common search operators:

  • from:sender@example.com - Emails from a specific sender
  • to:recipient@example.com - Emails to a specific recipient
  • subject:keyword - Emails with keyword in subject
  • is:unread - Unread emails
  • is:starred - Starred emails
  • has:attachment - Emails with attachments
  • after:YYYY/MM/DD - Emails after a specific date
  • before:YYYY/MM/DD - Emails before a specific date

๐Ÿ›  Tech Stack

๐Ÿ“„ License

Gog CLI is open-sourced software licensed under the MIT license.

About

GOG CLI โ€” A command-line tool to interact with Gmail and Google services, written in PHP ๐Ÿ˜

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages