hermes-gsuite-cli 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. hermes_gsuite_cli-0.2.0/LICENSE +22 -0
  2. hermes_gsuite_cli-0.2.0/PKG-INFO +333 -0
  3. hermes_gsuite_cli-0.2.0/README.md +277 -0
  4. hermes_gsuite_cli-0.2.0/gsuite_cli/__init__.py +7 -0
  5. hermes_gsuite_cli-0.2.0/gsuite_cli/ai/__init__.py +38 -0
  6. hermes_gsuite_cli-0.2.0/gsuite_cli/ai/analytics.py +460 -0
  7. hermes_gsuite_cli-0.2.0/gsuite_cli/ai/chatbot.py +48 -0
  8. hermes_gsuite_cli-0.2.0/gsuite_cli/ai/commands.py +667 -0
  9. hermes_gsuite_cli-0.2.0/gsuite_cli/ai/date_parser.py +234 -0
  10. hermes_gsuite_cli-0.2.0/gsuite_cli/ai/gemini_client.py +62 -0
  11. hermes_gsuite_cli-0.2.0/gsuite_cli/ai/intent_schema.py +482 -0
  12. hermes_gsuite_cli-0.2.0/gsuite_cli/ai/nlp.py +677 -0
  13. hermes_gsuite_cli-0.2.0/gsuite_cli/ai/query_engine.py +1584 -0
  14. hermes_gsuite_cli-0.2.0/gsuite_cli/ai/summarizer.py +385 -0
  15. hermes_gsuite_cli-0.2.0/gsuite_cli/ai/tool_registry.py +1230 -0
  16. hermes_gsuite_cli-0.2.0/gsuite_cli/auth/__init__.py +7 -0
  17. hermes_gsuite_cli-0.2.0/gsuite_cli/auth/oauth.py +391 -0
  18. hermes_gsuite_cli-0.2.0/gsuite_cli/cli.py +6086 -0
  19. hermes_gsuite_cli-0.2.0/gsuite_cli/config/__init__.py +5 -0
  20. hermes_gsuite_cli-0.2.0/gsuite_cli/config/hermes_config.py +125 -0
  21. hermes_gsuite_cli-0.2.0/gsuite_cli/config/manager.py +349 -0
  22. hermes_gsuite_cli-0.2.0/gsuite_cli/profile/__init__.py +35 -0
  23. hermes_gsuite_cli-0.2.0/gsuite_cli/profile/commands.py +188 -0
  24. hermes_gsuite_cli-0.2.0/gsuite_cli/profile/models.py +190 -0
  25. hermes_gsuite_cli-0.2.0/gsuite_cli/profile/resolver.py +440 -0
  26. hermes_gsuite_cli-0.2.0/gsuite_cli/profile/service.py +357 -0
  27. hermes_gsuite_cli-0.2.0/gsuite_cli/profile/storage.py +125 -0
  28. hermes_gsuite_cli-0.2.0/gsuite_cli/profile/validators.py +86 -0
  29. hermes_gsuite_cli-0.2.0/gsuite_cli/services/__init__.py +3 -0
  30. hermes_gsuite_cli-0.2.0/gsuite_cli/services/admin.py +268 -0
  31. hermes_gsuite_cli-0.2.0/gsuite_cli/services/apps_script.py +206 -0
  32. hermes_gsuite_cli-0.2.0/gsuite_cli/services/booking.py +735 -0
  33. hermes_gsuite_cli-0.2.0/gsuite_cli/services/calendar.py +846 -0
  34. hermes_gsuite_cli-0.2.0/gsuite_cli/services/calendar_advanced.py +534 -0
  35. hermes_gsuite_cli-0.2.0/gsuite_cli/services/calendar_resolver.py +510 -0
  36. hermes_gsuite_cli-0.2.0/gsuite_cli/services/calendar_validators.py +207 -0
  37. hermes_gsuite_cli-0.2.0/gsuite_cli/services/chat.py +457 -0
  38. hermes_gsuite_cli-0.2.0/gsuite_cli/services/chat_commands.py +423 -0
  39. hermes_gsuite_cli-0.2.0/gsuite_cli/services/cloud_identity.py +187 -0
  40. hermes_gsuite_cli-0.2.0/gsuite_cli/services/cloud_search.py +75 -0
  41. hermes_gsuite_cli-0.2.0/gsuite_cli/services/diagnostics.py +250 -0
  42. hermes_gsuite_cli-0.2.0/gsuite_cli/services/docs.py +472 -0
  43. hermes_gsuite_cli-0.2.0/gsuite_cli/services/docs_advanced.py +601 -0
  44. hermes_gsuite_cli-0.2.0/gsuite_cli/services/drive.py +377 -0
  45. hermes_gsuite_cli-0.2.0/gsuite_cli/services/drive_activity.py +76 -0
  46. hermes_gsuite_cli-0.2.0/gsuite_cli/services/forms.py +364 -0
  47. hermes_gsuite_cli-0.2.0/gsuite_cli/services/gmail.py +1252 -0
  48. hermes_gsuite_cli-0.2.0/gsuite_cli/services/gmail_advanced.py +513 -0
  49. hermes_gsuite_cli-0.2.0/gsuite_cli/services/gmail_commands.py +737 -0
  50. hermes_gsuite_cli-0.2.0/gsuite_cli/services/meet.py +800 -0
  51. hermes_gsuite_cli-0.2.0/gsuite_cli/services/people.py +122 -0
  52. hermes_gsuite_cli-0.2.0/gsuite_cli/services/profile_resolver.py +15 -0
  53. hermes_gsuite_cli-0.2.0/gsuite_cli/services/reminders.py +243 -0
  54. hermes_gsuite_cli-0.2.0/gsuite_cli/services/resource_resolver.py +706 -0
  55. hermes_gsuite_cli-0.2.0/gsuite_cli/services/sheets.py +517 -0
  56. hermes_gsuite_cli-0.2.0/gsuite_cli/services/sheets_advanced.py +638 -0
  57. hermes_gsuite_cli-0.2.0/gsuite_cli/services/tasks.py +258 -0
  58. hermes_gsuite_cli-0.2.0/gsuite_cli/services/workspace_commands.py +98 -0
  59. hermes_gsuite_cli-0.2.0/gsuite_cli/services/workspace_events.py +122 -0
  60. hermes_gsuite_cli-0.2.0/gsuite_cli/ui/__init__.py +7 -0
  61. hermes_gsuite_cli-0.2.0/gsuite_cli/ui/human_flows.py +1366 -0
  62. hermes_gsuite_cli-0.2.0/gsuite_cli/ui/interactive.py +2825 -0
  63. hermes_gsuite_cli-0.2.0/gsuite_cli/ui/interactive_calendar.py +708 -0
  64. hermes_gsuite_cli-0.2.0/gsuite_cli/ui/interactive_labels.py +1016 -0
  65. hermes_gsuite_cli-0.2.0/gsuite_cli/ui/interactive_profile.py +1243 -0
  66. hermes_gsuite_cli-0.2.0/gsuite_cli/utils/__init__.py +3 -0
  67. hermes_gsuite_cli-0.2.0/gsuite_cli/utils/cache.py +258 -0
  68. hermes_gsuite_cli-0.2.0/gsuite_cli/utils/errors.py +147 -0
  69. hermes_gsuite_cli-0.2.0/gsuite_cli/utils/formatters.py +412 -0
  70. hermes_gsuite_cli-0.2.0/gsuite_cli/utils/validator.py +266 -0
  71. hermes_gsuite_cli-0.2.0/hermes_gsuite_cli.egg-info/PKG-INFO +333 -0
  72. hermes_gsuite_cli-0.2.0/hermes_gsuite_cli.egg-info/SOURCES.txt +97 -0
  73. hermes_gsuite_cli-0.2.0/hermes_gsuite_cli.egg-info/dependency_links.txt +1 -0
  74. hermes_gsuite_cli-0.2.0/hermes_gsuite_cli.egg-info/entry_points.txt +2 -0
  75. hermes_gsuite_cli-0.2.0/hermes_gsuite_cli.egg-info/requires.txt +21 -0
  76. hermes_gsuite_cli-0.2.0/hermes_gsuite_cli.egg-info/top_level.txt +1 -0
  77. hermes_gsuite_cli-0.2.0/pyproject.toml +87 -0
  78. hermes_gsuite_cli-0.2.0/setup.cfg +4 -0
  79. hermes_gsuite_cli-0.2.0/setup.py +64 -0
  80. hermes_gsuite_cli-0.2.0/tests/test_ai_profile_compose.py +497 -0
  81. hermes_gsuite_cli-0.2.0/tests/test_ai_tool_layer.py +366 -0
  82. hermes_gsuite_cli-0.2.0/tests/test_booking.py +248 -0
  83. hermes_gsuite_cli-0.2.0/tests/test_calendar.py +386 -0
  84. hermes_gsuite_cli-0.2.0/tests/test_calendar_resolver.py +427 -0
  85. hermes_gsuite_cli-0.2.0/tests/test_calendar_update_flow.py +573 -0
  86. hermes_gsuite_cli-0.2.0/tests/test_calendar_validation.py +333 -0
  87. hermes_gsuite_cli-0.2.0/tests/test_chat.py +499 -0
  88. hermes_gsuite_cli-0.2.0/tests/test_compose_flow.py +331 -0
  89. hermes_gsuite_cli-0.2.0/tests/test_drive.py +411 -0
  90. hermes_gsuite_cli-0.2.0/tests/test_global_resource_resolver.py +208 -0
  91. hermes_gsuite_cli-0.2.0/tests/test_gmail.py +1760 -0
  92. hermes_gsuite_cli-0.2.0/tests/test_human_friendly_flows.py +300 -0
  93. hermes_gsuite_cli-0.2.0/tests/test_meet.py +471 -0
  94. hermes_gsuite_cli-0.2.0/tests/test_natural_language_query.py +638 -0
  95. hermes_gsuite_cli-0.2.0/tests/test_personal_profile.py +578 -0
  96. hermes_gsuite_cli-0.2.0/tests/test_screen_transitions.py +319 -0
  97. hermes_gsuite_cli-0.2.0/tests/test_tasks.py +278 -0
  98. hermes_gsuite_cli-0.2.0/tests/test_workflow.py +128 -0
  99. hermes_gsuite_cli-0.2.0/tests/test_workspace_apis.py +643 -0
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Your Name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,333 @@
1
+ Metadata-Version: 2.4
2
+ Name: hermes-gsuite-cli
3
+ Version: 0.2.0
4
+ Summary: Advanced CLI tool for Google Workspace with Gemini-powered Natural Language Query execution
5
+ Home-page: https://github.com/nsakthivel/Hermes-CLI
6
+ Author: NSakthivel
7
+ Author-email: NSakthivel <nsakthiveldev@gmail.com>
8
+ Maintainer-email: NSakthivel <nsakthiveldev@gmail.com>
9
+ License-Expression: MIT
10
+ Project-URL: Homepage, https://github.com/nsakthivel/Hermes-CLI
11
+ Project-URL: Documentation, https://github.com/nsakthivel/Hermes-CLI#readme
12
+ Project-URL: Repository, https://github.com/nsakthivel/Hermes-CLI
13
+ Project-URL: Issues, https://github.com/nsakthivel/Hermes-CLI/issues
14
+ Keywords: google-workspace,gsuite,cli,gmail,google-calendar,google-drive,google-sheets,google-docs,google-meet,gemini,ai
15
+ Classifier: Development Status :: 5 - Production/Stable
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: End Users/Desktop
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Environment :: Console
26
+ Classifier: Topic :: Communications :: Email
27
+ Classifier: Topic :: Office/Business :: Scheduling
28
+ Classifier: Topic :: Utilities
29
+ Requires-Python: >=3.8
30
+ Description-Content-Type: text/markdown
31
+ License-File: LICENSE
32
+ Requires-Dist: click>=8.0.0
33
+ Requires-Dist: google-auth>=2.0.0
34
+ Requires-Dist: google-auth-oauthlib>=1.0.0
35
+ Requires-Dist: google-auth-httplib2>=0.1.0
36
+ Requires-Dist: google-api-python-client>=2.0.0
37
+ Requires-Dist: tabulate>=0.9.0
38
+ Requires-Dist: colorama>=0.4.4
39
+ Requires-Dist: diskcache>=5.4.0
40
+ Requires-Dist: prompt-toolkit>=3.0.0
41
+ Requires-Dist: pyyaml>=6.0
42
+ Requires-Dist: python-dateutil>=2.8.0
43
+ Requires-Dist: requests>=2.25.0
44
+ Requires-Dist: google-genai>=0.1.0
45
+ Requires-Dist: google-generativeai>=0.3.0
46
+ Requires-Dist: plyer>=2.1.0
47
+ Provides-Extra: dev
48
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
49
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
50
+ Requires-Dist: build>=1.0.0; extra == "dev"
51
+ Requires-Dist: twine>=4.0.0; extra == "dev"
52
+ Dynamic: author
53
+ Dynamic: home-page
54
+ Dynamic: license-file
55
+ Dynamic: requires-python
56
+
57
+ # HERMES CLI
58
+
59
+ **HERMES** is an advanced, production-grade command-line interface for Google Workspace services (Gmail, Calendar, Drive, Sheets, Docs, Meet, Forms, Tasks, Chat) with built-in Gemini AI automation.
60
+
61
+ HERMES is built on a **centrally distributed, locally authenticated, client-side open-source architecture**:
62
+ - **Centrally Distributed:** Distributed via PyPI as `hermes-cli`.
63
+ - **Locally Authenticated:** Every user authenticates locally using their own Google account via OAuth 2.0. No developer credentials or third-party servers are ever involved.
64
+ - **Locally Cached & User-Isolated:** Tokens, cache, and configuration remain 100% on the user's local machine (`~/.config/gsuite-cli` and `~/.cache/gsuite-cli`). User A never has access to User B's tokens or Workspace data.
65
+ - **Direct Communication:** HERMES communicates directly with Google APIs and Google Gemini API—no intermediary proxy or backend server required.
66
+
67
+ ---
68
+
69
+ ## Quick Start Workflow
70
+
71
+ ### 1. Installation
72
+
73
+ ```bash
74
+ pip install hermes-cli
75
+ ```
76
+
77
+ Verify the installation:
78
+
79
+ ```bash
80
+ hermes --version
81
+ hermes --help
82
+ ```
83
+
84
+ ### 2. Initial Setup (OAuth Login)
85
+
86
+ Ensure your OAuth client credentials are configured (see [Google Cloud OAuth Setup](#google-cloud-oauth-setup-byoc) below) and run:
87
+
88
+ ```bash
89
+ hermes auth login
90
+ ```
91
+
92
+ This checks your local authentication status, launches a local browser for the official Google OAuth 2.0 consent flow, requests only necessary Workspace scopes, and securely saves your token to your local machine.
93
+
94
+ To force re-authentication at any time:
95
+
96
+ ```bash
97
+ hermes auth login --force
98
+ ```
99
+
100
+ ### 3. Check Authentication
101
+
102
+ ```bash
103
+ hermes auth status
104
+ ```
105
+
106
+ Displays your token validity, expiration, refresh token status, and granted scopes.
107
+
108
+ ### 4. Configure Gemini AI
109
+
110
+ Set your Gemini API key using either an environment variable or HERMES local configuration:
111
+
112
+ ```bash
113
+ # Option A: Environment Variable (Recommended for CI / Terminals)
114
+ export GEMINI_API_KEY="your-gemini-api-key"
115
+ # On Windows PowerShell:
116
+ $env:GEMINI_API_KEY = "your-gemini-api-key"
117
+
118
+ # Option B: Persistent Local Configuration
119
+ hermes config set ai.gemini_api_key "your-gemini-api-key"
120
+ ```
121
+
122
+ ### 5. Use HERMES
123
+
124
+ Manage all your Google Workspace tools directly from the terminal:
125
+
126
+ ```bash
127
+ # Gmail
128
+ hermes inbox
129
+ hermes gmail list --max-results 10
130
+ hermes gmail send --to "colleague@example.com" --subject "Status Update" --body "Everything is on track!"
131
+
132
+ # Calendar
133
+ hermes today
134
+ hermes calendar list
135
+ hermes calendar create --summary "Team Sync" --start "2026-09-30 10:00" --duration 30
136
+
137
+ # Google Drive
138
+ hermes drive list --page-size 10
139
+ hermes upload drive /path/to/report.pdf
140
+
141
+ # Google Sheets
142
+ hermes sheets list
143
+ hermes read sheets <SPREADSHEET_ID> --range "Sheet1!A1:D10"
144
+
145
+ # Google Docs
146
+ hermes docs list
147
+ hermes read docs <DOCUMENT_ID>
148
+
149
+ # Google Meet
150
+ hermes meet create --topic "Project Review"
151
+
152
+ # Google Forms
153
+ hermes forms list
154
+ hermes forms responses <FORM_ID>
155
+
156
+ # Google Tasks
157
+ hermes tasks list
158
+ hermes tasks add "Review PR for HERMES CLI"
159
+
160
+ # Gemini AI Features
161
+ hermes ai ask "Summarize my meetings for today"
162
+ hermes ai chat
163
+ hermes ai compose "Draft an apology email for being 5 minutes late"
164
+ ```
165
+
166
+ ### 6. Logout
167
+
168
+ ```bash
169
+ hermes auth logout
170
+ ```
171
+
172
+ Revokes your active OAuth token online with Google and removes the local token file without affecting other users.
173
+
174
+ ---
175
+
176
+ ## Supported Python Versions
177
+
178
+ HERMES supports:
179
+ - **Python 3.8**
180
+ - **Python 3.9**
181
+ - **Python 3.10**
182
+ - **Python 3.11**
183
+ - **Python 3.12**
184
+
185
+ Tested across Windows, Linux, and macOS.
186
+
187
+ ---
188
+
189
+ ## Google Cloud OAuth Setup (BYOC)
190
+
191
+ HERMES follows the **BYOC (Bring Your Own Credentials)** model. You provide your own Google Cloud OAuth 2.0 client credentials, ensuring you maintain 100% control over your data and API quota.
192
+
193
+ ### 1. Create a Google Cloud Project
194
+ 1. Navigate to the [Google Cloud Console](https://console.cloud.google.com/).
195
+ 2. Create a new project (e.g., `My Hermes CLI`).
196
+
197
+ ### 2. Enable Required APIs
198
+ Enable the Google Workspace APIs you want to interact with in **APIs & Services → Library**:
199
+ - Google Calendar API
200
+ - Gmail API
201
+ - Google Drive API
202
+ - Google Sheets API
203
+ - Google Docs API
204
+ - Google Meet API
205
+ - Google Forms API
206
+ - Google Tasks API
207
+ - Google Chat API
208
+ - Google People API (Contacts)
209
+
210
+ ### 3. Configure OAuth Consent Screen
211
+ 1. Go to **APIs & Services → OAuth consent screen**.
212
+ 2. Select **External** (or **Internal** if using a Google Workspace organization).
213
+ 3. Fill in the App Name (`HERMES CLI`) and User support email.
214
+ 4. Add your email under **Test users** (if in Testing status).
215
+
216
+ ### 4. Create Desktop OAuth Client ID
217
+ 1. Go to **APIs & Services → Credentials**.
218
+ 2. Click **Create Credentials → OAuth client ID**.
219
+ 3. Select **Application type: Desktop app**.
220
+ 4. Set the name to `HERMES Desktop Client` and click **Create**.
221
+ 5. Download the JSON file.
222
+
223
+ ### 5. Supply Your Credentials to HERMES
224
+ You can provide your client credentials in any of the following ways:
225
+
226
+ - **Standard File Location (Recommended):**
227
+ - **Linux / macOS:** `~/.config/gsuite-cli/credentials.json`
228
+ - **Windows:** `C:\Users\<username>\.config\gsuite-cli\credentials.json`
229
+
230
+ - **Environment Variable (File Path):**
231
+ ```bash
232
+ export HERMES_GOOGLE_CLIENT_SECRET="/path/to/downloaded-credentials.json"
233
+ ```
234
+
235
+ - **Environment Variable (Credentials Content or Secret Key):**
236
+ ```bash
237
+ # As raw JSON string:
238
+ export HERMES_GOOGLE_CLIENT_SECRET='{"installed":{"client_id":"...","client_secret":"..."}}'
239
+
240
+ # Or paired with client ID:
241
+ export HERMES_GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com"
242
+ export HERMES_GOOGLE_CLIENT_SECRET="your-client-secret"
243
+ ```
244
+
245
+ ---
246
+
247
+ ## Required Workspace Scopes
248
+
249
+ HERMES requests standard, user-scoped OAuth permissions depending on the service:
250
+
251
+ | Service | Scopes Requested |
252
+ |---|---|
253
+ | **Gmail** | `https://www.googleapis.com/auth/gmail.modify`, `https://www.googleapis.com/auth/gmail.settings.basic` |
254
+ | **Calendar** | `https://www.googleapis.com/auth/calendar` |
255
+ | **Drive** | `https://www.googleapis.com/auth/drive` |
256
+ | **Sheets** | `https://www.googleapis.com/auth/spreadsheets`, `https://www.googleapis.com/auth/drive.file` |
257
+ | **Docs** | `https://www.googleapis.com/auth/documents`, `https://www.googleapis.com/auth/drive` |
258
+ | **Meet** | `https://www.googleapis.com/auth/meetings.space.created`, `https://www.googleapis.com/auth/meetings.space.readonly` |
259
+ | **Forms** | `https://www.googleapis.com/auth/forms.body`, `https://www.googleapis.com/auth/forms.responses.readonly` |
260
+ | **Tasks** | `https://www.googleapis.com/auth/tasks` |
261
+ | **Chat** | `https://www.googleapis.com/auth/chat.spaces`, `https://www.googleapis.com/auth/chat.messages` |
262
+
263
+ ---
264
+
265
+ ## Local Credential Storage & Cache
266
+
267
+ HERMES utilizes user-isolated paths resolved via Python's standard `Path.home()`:
268
+
269
+ | Resource | Linux / macOS | Windows |
270
+ |---|---|---|
271
+ | **Configuration & Tokens** | `~/.config/gsuite-cli/` | `C:\Users\<username>\.config\gsuite-cli\` |
272
+ | **Token File** | `~/.config/gsuite-cli/token.json` | `C:\Users\<username>\.config\gsuite-cli\token.json` |
273
+ | **Local Cache** | `~/.cache/gsuite-cli/` | `C:\Users\<username>\.cache\gsuite-cli\` |
274
+
275
+ You can customize the configuration directory for any command using:
276
+ ```bash
277
+ hermes --config-dir /path/to/custom/dir <command>
278
+ ```
279
+
280
+ To manage the local cache:
281
+ ```bash
282
+ hermes cache stats
283
+ hermes cache clear
284
+ ```
285
+
286
+ ---
287
+
288
+ ## Security Model
289
+
290
+ 1. **Zero Secret Bundling:** The distributed Python package contains zero hardcoded API keys, private OAuth secrets, or user tokens.
291
+ 2. **Client-Side Only:** All network calls go directly to `googleapis.com` or `generativelanguage.googleapis.com`. No telemetry or credentials are sent to any developer-owned server.
292
+ 3. **Multi-User Isolation:** Each user runs the CLI in their own operating system context. User tokens, cache databases, and configuration are saved strictly in the user's home folder with OS file permissions.
293
+ 4. **Token Security:** Stored tokens are refreshed automatically using Google's OAuth token endpoint and can be cleanly revoked online and deleted locally at any time via `hermes auth logout`.
294
+
295
+ ---
296
+
297
+ ## Output Formats & Scripting
298
+
299
+ HERMES supports multiple output formats for easy scripting and terminal viewing:
300
+
301
+ ```bash
302
+ # Standard table (default)
303
+ hermes calendar list
304
+
305
+ # JSON format (ideal for jq, Python, and scripting)
306
+ hermes calendar list --format json
307
+
308
+ # CSV format (ideal for spreadsheets and data processing)
309
+ hermes calendar list --format csv
310
+ ```
311
+
312
+ ---
313
+
314
+ ## Troubleshooting
315
+
316
+ ### "OAuth client configuration not found"
317
+ - Ensure `credentials.json` is placed in `~/.config/gsuite-cli/credentials.json` or set `HERMES_GOOGLE_CLIENT_SECRET=/path/to/credentials.json`.
318
+ - Verify the credentials type in Google Cloud is **Desktop application** (not Web application).
319
+
320
+ ### "Access blocked: This app has not been verified"
321
+ - If your Google Cloud OAuth consent screen is in **Testing** status, add your Google email address under **Test users** on the Google Cloud Console OAuth consent screen page.
322
+
323
+ ### "Permission denied (403)"
324
+ - Re-run `hermes auth login --force` to re-authorize and ensure all requested scope checkboxes are checked in the Google browser prompt.
325
+
326
+ ### Gemini API Key Missing
327
+ - Run `hermes config set ai.gemini_api_key YOUR_KEY` or `export GEMINI_API_KEY=YOUR_KEY`.
328
+
329
+ ---
330
+
331
+ ## License
332
+
333
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,277 @@
1
+ # HERMES CLI
2
+
3
+ **HERMES** is an advanced, production-grade command-line interface for Google Workspace services (Gmail, Calendar, Drive, Sheets, Docs, Meet, Forms, Tasks, Chat) with built-in Gemini AI automation.
4
+
5
+ HERMES is built on a **centrally distributed, locally authenticated, client-side open-source architecture**:
6
+ - **Centrally Distributed:** Distributed via PyPI as `hermes-cli`.
7
+ - **Locally Authenticated:** Every user authenticates locally using their own Google account via OAuth 2.0. No developer credentials or third-party servers are ever involved.
8
+ - **Locally Cached & User-Isolated:** Tokens, cache, and configuration remain 100% on the user's local machine (`~/.config/gsuite-cli` and `~/.cache/gsuite-cli`). User A never has access to User B's tokens or Workspace data.
9
+ - **Direct Communication:** HERMES communicates directly with Google APIs and Google Gemini API—no intermediary proxy or backend server required.
10
+
11
+ ---
12
+
13
+ ## Quick Start Workflow
14
+
15
+ ### 1. Installation
16
+
17
+ ```bash
18
+ pip install hermes-cli
19
+ ```
20
+
21
+ Verify the installation:
22
+
23
+ ```bash
24
+ hermes --version
25
+ hermes --help
26
+ ```
27
+
28
+ ### 2. Initial Setup (OAuth Login)
29
+
30
+ Ensure your OAuth client credentials are configured (see [Google Cloud OAuth Setup](#google-cloud-oauth-setup-byoc) below) and run:
31
+
32
+ ```bash
33
+ hermes auth login
34
+ ```
35
+
36
+ This checks your local authentication status, launches a local browser for the official Google OAuth 2.0 consent flow, requests only necessary Workspace scopes, and securely saves your token to your local machine.
37
+
38
+ To force re-authentication at any time:
39
+
40
+ ```bash
41
+ hermes auth login --force
42
+ ```
43
+
44
+ ### 3. Check Authentication
45
+
46
+ ```bash
47
+ hermes auth status
48
+ ```
49
+
50
+ Displays your token validity, expiration, refresh token status, and granted scopes.
51
+
52
+ ### 4. Configure Gemini AI
53
+
54
+ Set your Gemini API key using either an environment variable or HERMES local configuration:
55
+
56
+ ```bash
57
+ # Option A: Environment Variable (Recommended for CI / Terminals)
58
+ export GEMINI_API_KEY="your-gemini-api-key"
59
+ # On Windows PowerShell:
60
+ $env:GEMINI_API_KEY = "your-gemini-api-key"
61
+
62
+ # Option B: Persistent Local Configuration
63
+ hermes config set ai.gemini_api_key "your-gemini-api-key"
64
+ ```
65
+
66
+ ### 5. Use HERMES
67
+
68
+ Manage all your Google Workspace tools directly from the terminal:
69
+
70
+ ```bash
71
+ # Gmail
72
+ hermes inbox
73
+ hermes gmail list --max-results 10
74
+ hermes gmail send --to "colleague@example.com" --subject "Status Update" --body "Everything is on track!"
75
+
76
+ # Calendar
77
+ hermes today
78
+ hermes calendar list
79
+ hermes calendar create --summary "Team Sync" --start "2026-09-30 10:00" --duration 30
80
+
81
+ # Google Drive
82
+ hermes drive list --page-size 10
83
+ hermes upload drive /path/to/report.pdf
84
+
85
+ # Google Sheets
86
+ hermes sheets list
87
+ hermes read sheets <SPREADSHEET_ID> --range "Sheet1!A1:D10"
88
+
89
+ # Google Docs
90
+ hermes docs list
91
+ hermes read docs <DOCUMENT_ID>
92
+
93
+ # Google Meet
94
+ hermes meet create --topic "Project Review"
95
+
96
+ # Google Forms
97
+ hermes forms list
98
+ hermes forms responses <FORM_ID>
99
+
100
+ # Google Tasks
101
+ hermes tasks list
102
+ hermes tasks add "Review PR for HERMES CLI"
103
+
104
+ # Gemini AI Features
105
+ hermes ai ask "Summarize my meetings for today"
106
+ hermes ai chat
107
+ hermes ai compose "Draft an apology email for being 5 minutes late"
108
+ ```
109
+
110
+ ### 6. Logout
111
+
112
+ ```bash
113
+ hermes auth logout
114
+ ```
115
+
116
+ Revokes your active OAuth token online with Google and removes the local token file without affecting other users.
117
+
118
+ ---
119
+
120
+ ## Supported Python Versions
121
+
122
+ HERMES supports:
123
+ - **Python 3.8**
124
+ - **Python 3.9**
125
+ - **Python 3.10**
126
+ - **Python 3.11**
127
+ - **Python 3.12**
128
+
129
+ Tested across Windows, Linux, and macOS.
130
+
131
+ ---
132
+
133
+ ## Google Cloud OAuth Setup (BYOC)
134
+
135
+ HERMES follows the **BYOC (Bring Your Own Credentials)** model. You provide your own Google Cloud OAuth 2.0 client credentials, ensuring you maintain 100% control over your data and API quota.
136
+
137
+ ### 1. Create a Google Cloud Project
138
+ 1. Navigate to the [Google Cloud Console](https://console.cloud.google.com/).
139
+ 2. Create a new project (e.g., `My Hermes CLI`).
140
+
141
+ ### 2. Enable Required APIs
142
+ Enable the Google Workspace APIs you want to interact with in **APIs & Services → Library**:
143
+ - Google Calendar API
144
+ - Gmail API
145
+ - Google Drive API
146
+ - Google Sheets API
147
+ - Google Docs API
148
+ - Google Meet API
149
+ - Google Forms API
150
+ - Google Tasks API
151
+ - Google Chat API
152
+ - Google People API (Contacts)
153
+
154
+ ### 3. Configure OAuth Consent Screen
155
+ 1. Go to **APIs & Services → OAuth consent screen**.
156
+ 2. Select **External** (or **Internal** if using a Google Workspace organization).
157
+ 3. Fill in the App Name (`HERMES CLI`) and User support email.
158
+ 4. Add your email under **Test users** (if in Testing status).
159
+
160
+ ### 4. Create Desktop OAuth Client ID
161
+ 1. Go to **APIs & Services → Credentials**.
162
+ 2. Click **Create Credentials → OAuth client ID**.
163
+ 3. Select **Application type: Desktop app**.
164
+ 4. Set the name to `HERMES Desktop Client` and click **Create**.
165
+ 5. Download the JSON file.
166
+
167
+ ### 5. Supply Your Credentials to HERMES
168
+ You can provide your client credentials in any of the following ways:
169
+
170
+ - **Standard File Location (Recommended):**
171
+ - **Linux / macOS:** `~/.config/gsuite-cli/credentials.json`
172
+ - **Windows:** `C:\Users\<username>\.config\gsuite-cli\credentials.json`
173
+
174
+ - **Environment Variable (File Path):**
175
+ ```bash
176
+ export HERMES_GOOGLE_CLIENT_SECRET="/path/to/downloaded-credentials.json"
177
+ ```
178
+
179
+ - **Environment Variable (Credentials Content or Secret Key):**
180
+ ```bash
181
+ # As raw JSON string:
182
+ export HERMES_GOOGLE_CLIENT_SECRET='{"installed":{"client_id":"...","client_secret":"..."}}'
183
+
184
+ # Or paired with client ID:
185
+ export HERMES_GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com"
186
+ export HERMES_GOOGLE_CLIENT_SECRET="your-client-secret"
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Required Workspace Scopes
192
+
193
+ HERMES requests standard, user-scoped OAuth permissions depending on the service:
194
+
195
+ | Service | Scopes Requested |
196
+ |---|---|
197
+ | **Gmail** | `https://www.googleapis.com/auth/gmail.modify`, `https://www.googleapis.com/auth/gmail.settings.basic` |
198
+ | **Calendar** | `https://www.googleapis.com/auth/calendar` |
199
+ | **Drive** | `https://www.googleapis.com/auth/drive` |
200
+ | **Sheets** | `https://www.googleapis.com/auth/spreadsheets`, `https://www.googleapis.com/auth/drive.file` |
201
+ | **Docs** | `https://www.googleapis.com/auth/documents`, `https://www.googleapis.com/auth/drive` |
202
+ | **Meet** | `https://www.googleapis.com/auth/meetings.space.created`, `https://www.googleapis.com/auth/meetings.space.readonly` |
203
+ | **Forms** | `https://www.googleapis.com/auth/forms.body`, `https://www.googleapis.com/auth/forms.responses.readonly` |
204
+ | **Tasks** | `https://www.googleapis.com/auth/tasks` |
205
+ | **Chat** | `https://www.googleapis.com/auth/chat.spaces`, `https://www.googleapis.com/auth/chat.messages` |
206
+
207
+ ---
208
+
209
+ ## Local Credential Storage & Cache
210
+
211
+ HERMES utilizes user-isolated paths resolved via Python's standard `Path.home()`:
212
+
213
+ | Resource | Linux / macOS | Windows |
214
+ |---|---|---|
215
+ | **Configuration & Tokens** | `~/.config/gsuite-cli/` | `C:\Users\<username>\.config\gsuite-cli\` |
216
+ | **Token File** | `~/.config/gsuite-cli/token.json` | `C:\Users\<username>\.config\gsuite-cli\token.json` |
217
+ | **Local Cache** | `~/.cache/gsuite-cli/` | `C:\Users\<username>\.cache\gsuite-cli\` |
218
+
219
+ You can customize the configuration directory for any command using:
220
+ ```bash
221
+ hermes --config-dir /path/to/custom/dir <command>
222
+ ```
223
+
224
+ To manage the local cache:
225
+ ```bash
226
+ hermes cache stats
227
+ hermes cache clear
228
+ ```
229
+
230
+ ---
231
+
232
+ ## Security Model
233
+
234
+ 1. **Zero Secret Bundling:** The distributed Python package contains zero hardcoded API keys, private OAuth secrets, or user tokens.
235
+ 2. **Client-Side Only:** All network calls go directly to `googleapis.com` or `generativelanguage.googleapis.com`. No telemetry or credentials are sent to any developer-owned server.
236
+ 3. **Multi-User Isolation:** Each user runs the CLI in their own operating system context. User tokens, cache databases, and configuration are saved strictly in the user's home folder with OS file permissions.
237
+ 4. **Token Security:** Stored tokens are refreshed automatically using Google's OAuth token endpoint and can be cleanly revoked online and deleted locally at any time via `hermes auth logout`.
238
+
239
+ ---
240
+
241
+ ## Output Formats & Scripting
242
+
243
+ HERMES supports multiple output formats for easy scripting and terminal viewing:
244
+
245
+ ```bash
246
+ # Standard table (default)
247
+ hermes calendar list
248
+
249
+ # JSON format (ideal for jq, Python, and scripting)
250
+ hermes calendar list --format json
251
+
252
+ # CSV format (ideal for spreadsheets and data processing)
253
+ hermes calendar list --format csv
254
+ ```
255
+
256
+ ---
257
+
258
+ ## Troubleshooting
259
+
260
+ ### "OAuth client configuration not found"
261
+ - Ensure `credentials.json` is placed in `~/.config/gsuite-cli/credentials.json` or set `HERMES_GOOGLE_CLIENT_SECRET=/path/to/credentials.json`.
262
+ - Verify the credentials type in Google Cloud is **Desktop application** (not Web application).
263
+
264
+ ### "Access blocked: This app has not been verified"
265
+ - If your Google Cloud OAuth consent screen is in **Testing** status, add your Google email address under **Test users** on the Google Cloud Console OAuth consent screen page.
266
+
267
+ ### "Permission denied (403)"
268
+ - Re-run `hermes auth login --force` to re-authorize and ensure all requested scope checkboxes are checked in the Google browser prompt.
269
+
270
+ ### Gemini API Key Missing
271
+ - Run `hermes config set ai.gemini_api_key YOUR_KEY` or `export GEMINI_API_KEY=YOUR_KEY`.
272
+
273
+ ---
274
+
275
+ ## License
276
+
277
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,7 @@
1
+ """
2
+ HERMES CLI - Advanced CLI tool for Google Workspace services and Gemini AI
3
+ """
4
+
5
+ __version__ = "0.1.0"
6
+ __author__ = "NSakthivel"
7
+ __email__ = "nsakthiveldev@gmail.com"
@@ -0,0 +1,38 @@
1
+ """
2
+ AI-powered features for GSuite CLI
3
+ """
4
+
5
+ from .commands import ai
6
+ from .nlp import NaturalLanguageProcessor
7
+ from .analytics import AIAnalytics
8
+ from .summarizer import EmailSummarizer
9
+ from .query_engine import NaturalQueryEngine, ConversationContext
10
+ from .intent_schema import StructuredIntent, validate_structured_intent
11
+ from .date_parser import NaturalDateParser
12
+ from .tool_registry import (
13
+ ToolDefinition,
14
+ ToolRegistry,
15
+ ToolValidator,
16
+ ToolExecutor,
17
+ ToolExecutionResult,
18
+ get_default_registry,
19
+ )
20
+
21
+ __all__ = [
22
+ 'ai',
23
+ 'NaturalLanguageProcessor',
24
+ 'AIAnalytics',
25
+ 'EmailSummarizer',
26
+ 'NaturalQueryEngine',
27
+ 'ConversationContext',
28
+ 'StructuredIntent',
29
+ 'validate_structured_intent',
30
+ 'NaturalDateParser',
31
+ 'ToolDefinition',
32
+ 'ToolRegistry',
33
+ 'ToolValidator',
34
+ 'ToolExecutor',
35
+ 'ToolExecutionResult',
36
+ 'get_default_registry',
37
+ ]
38
+