nbngcli
v0.1.0
Published
Unified CLI for Gmail, Google Calendar, and Google Drive
Maintainers
Readme
nbngcli
Unified CLI for Gmail, Google Calendar, and Google Drive.
Single OAuth authorization for all three services.
Installation
npm install -g nbngcliSetup
1. Create Google Cloud OAuth Credentials
- Go to Google Cloud Console
- Create a new project (or use existing)
- Enable these APIs:
- Gmail API
- Google Calendar API
- Google Drive API
- Go to "OAuth consent screen" > External > Add your email as test user
- Go to "Credentials" > Create Credentials > OAuth client ID > Desktop app
- Download the JSON file
2. Configure nbngcli
# Set credentials (once)
nbn accounts credentials ~/path/to/credentials.json
# Add your account
nbn accounts add [email protected]This opens a browser for authorization. Use --manual for browserless setup.
Usage
Account Management
nbn accounts list # List accounts
nbn accounts add [email protected] # Add account
nbn accounts remove [email protected] # Remove accountGmail
nbn [email protected] mail search "in:inbox is:unread"
nbn [email protected] mail search "from:[email protected]" --max 50
nbn [email protected] mail thread <threadId>
nbn [email protected] mail labels list
nbn [email protected] mail labels <threadId> --add STARRED --remove UNREAD
nbn [email protected] mail send --to [email protected] --subject "Hi" --body "Hello"
nbn [email protected] mail send --to [email protected] --subject "Hi" --body "Hello" --attach file.pdf
nbn [email protected] mail drafts list
nbn [email protected] mail drafts send <draftId>
nbn [email protected] mail url <threadId>Google Calendar
nbn [email protected] cal calendars
nbn [email protected] cal acl <calendarId>
nbn [email protected] cal events
nbn [email protected] cal events primary --max 20
nbn [email protected] cal event <calendarId> <eventId>
nbn [email protected] cal create primary --title "Meeting" --start "2025-01-15T10:00:00" --end "2025-01-15T11:00:00"
nbn [email protected] cal update <calendarId> <eventId> --title "New Title"
nbn [email protected] cal delete <calendarId> <eventId>
nbn [email protected] cal freebusy primary --start "2025-01-15T00:00:00Z" --end "2025-01-16T00:00:00Z"Google Drive
nbn [email protected] drive ls
nbn [email protected] drive ls <folderId> --max 50
nbn [email protected] drive search "quarterly report"
nbn [email protected] drive get <fileId>
nbn [email protected] drive download <fileId>
nbn [email protected] drive download <fileId> ./local-path.pdf
nbn [email protected] drive upload ./file.pdf
nbn [email protected] drive upload ./file.pdf --folder <folderId>
nbn [email protected] drive mkdir "New Folder"
nbn [email protected] drive mkdir "Subfolder" --parent <folderId>
nbn [email protected] drive delete <fileId>
nbn [email protected] drive move <fileId> <newParentId>
nbn [email protected] drive rename <fileId> "new-name.pdf"
nbn [email protected] drive share <fileId> --anyone
nbn [email protected] drive share <fileId> --email [email protected] --role writer
nbn [email protected] drive permissions <fileId>
nbn [email protected] drive unshare <fileId> <permissionId>
nbn [email protected] drive url <fileId>Data Storage
All data is stored locally in ~/.nbngcli/:
credentials.json- OAuth client credentialsaccounts.json- Account tokensdownloads/- Downloaded files
License
MIT
