gtypee 1.0.0

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 (464) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +1442 -0
  3. package/dist/bin/gtypee.d.ts +3 -0
  4. package/dist/bin/gtypee.d.ts.map +1 -0
  5. package/dist/bin/gtypee.js +18 -0
  6. package/dist/bin/gtypee.js.map +1 -0
  7. package/dist/src/authclient/authclient.d.ts +11 -0
  8. package/dist/src/authclient/authclient.d.ts.map +1 -0
  9. package/dist/src/authclient/authclient.js +26 -0
  10. package/dist/src/authclient/authclient.js.map +1 -0
  11. package/dist/src/cmd/agent/commands.d.ts +3 -0
  12. package/dist/src/cmd/agent/commands.d.ts.map +1 -0
  13. package/dist/src/cmd/agent/commands.js +16 -0
  14. package/dist/src/cmd/agent/commands.js.map +1 -0
  15. package/dist/src/cmd/appscript/commands.d.ts +24 -0
  16. package/dist/src/cmd/appscript/commands.d.ts.map +1 -0
  17. package/dist/src/cmd/appscript/commands.js +116 -0
  18. package/dist/src/cmd/appscript/commands.js.map +1 -0
  19. package/dist/src/cmd/appscript/runtime.d.ts +4 -0
  20. package/dist/src/cmd/appscript/runtime.d.ts.map +1 -0
  21. package/dist/src/cmd/appscript/runtime.js +64 -0
  22. package/dist/src/cmd/appscript/runtime.js.map +1 -0
  23. package/dist/src/cmd/auth/commands.d.ts +67 -0
  24. package/dist/src/cmd/auth/commands.d.ts.map +1 -0
  25. package/dist/src/cmd/auth/commands.js +184 -0
  26. package/dist/src/cmd/auth/commands.js.map +1 -0
  27. package/dist/src/cmd/auth/runtime.d.ts +20 -0
  28. package/dist/src/cmd/auth/runtime.d.ts.map +1 -0
  29. package/dist/src/cmd/auth/runtime.js +237 -0
  30. package/dist/src/cmd/auth/runtime.js.map +1 -0
  31. package/dist/src/cmd/calendar/commands.d.ts +58 -0
  32. package/dist/src/cmd/calendar/commands.d.ts.map +1 -0
  33. package/dist/src/cmd/calendar/commands.js +161 -0
  34. package/dist/src/cmd/calendar/commands.js.map +1 -0
  35. package/dist/src/cmd/calendar/runtime.d.ts +4 -0
  36. package/dist/src/cmd/calendar/runtime.d.ts.map +1 -0
  37. package/dist/src/cmd/calendar/runtime.js +164 -0
  38. package/dist/src/cmd/calendar/runtime.js.map +1 -0
  39. package/dist/src/cmd/chat/commands.d.ts +27 -0
  40. package/dist/src/cmd/chat/commands.d.ts.map +1 -0
  41. package/dist/src/cmd/chat/commands.js +113 -0
  42. package/dist/src/cmd/chat/commands.js.map +1 -0
  43. package/dist/src/cmd/chat/runtime.d.ts +4 -0
  44. package/dist/src/cmd/chat/runtime.d.ts.map +1 -0
  45. package/dist/src/cmd/chat/runtime.js +67 -0
  46. package/dist/src/cmd/chat/runtime.js.map +1 -0
  47. package/dist/src/cmd/classroom/commands.d.ts +22 -0
  48. package/dist/src/cmd/classroom/commands.d.ts.map +1 -0
  49. package/dist/src/cmd/classroom/commands.js +91 -0
  50. package/dist/src/cmd/classroom/commands.js.map +1 -0
  51. package/dist/src/cmd/classroom/runtime.d.ts +4 -0
  52. package/dist/src/cmd/classroom/runtime.d.ts.map +1 -0
  53. package/dist/src/cmd/classroom/runtime.js +67 -0
  54. package/dist/src/cmd/classroom/runtime.js.map +1 -0
  55. package/dist/src/cmd/command-registry.d.ts +8 -0
  56. package/dist/src/cmd/command-registry.d.ts.map +1 -0
  57. package/dist/src/cmd/command-registry.js +40 -0
  58. package/dist/src/cmd/command-registry.js.map +1 -0
  59. package/dist/src/cmd/completion/commands.d.ts +3 -0
  60. package/dist/src/cmd/completion/commands.d.ts.map +1 -0
  61. package/dist/src/cmd/completion/commands.js +29 -0
  62. package/dist/src/cmd/completion/commands.js.map +1 -0
  63. package/dist/src/cmd/config/commands.d.ts +10 -0
  64. package/dist/src/cmd/config/commands.d.ts.map +1 -0
  65. package/dist/src/cmd/config/commands.js +106 -0
  66. package/dist/src/cmd/config/commands.js.map +1 -0
  67. package/dist/src/cmd/contacts/commands.d.ts +18 -0
  68. package/dist/src/cmd/contacts/commands.d.ts.map +1 -0
  69. package/dist/src/cmd/contacts/commands.js +79 -0
  70. package/dist/src/cmd/contacts/commands.js.map +1 -0
  71. package/dist/src/cmd/contacts/runtime.d.ts +4 -0
  72. package/dist/src/cmd/contacts/runtime.d.ts.map +1 -0
  73. package/dist/src/cmd/contacts/runtime.js +67 -0
  74. package/dist/src/cmd/contacts/runtime.js.map +1 -0
  75. package/dist/src/cmd/docs/commands.d.ts +24 -0
  76. package/dist/src/cmd/docs/commands.d.ts.map +1 -0
  77. package/dist/src/cmd/docs/commands.js +82 -0
  78. package/dist/src/cmd/docs/commands.js.map +1 -0
  79. package/dist/src/cmd/docs/runtime.d.ts +4 -0
  80. package/dist/src/cmd/docs/runtime.d.ts.map +1 -0
  81. package/dist/src/cmd/docs/runtime.js +77 -0
  82. package/dist/src/cmd/docs/runtime.js.map +1 -0
  83. package/dist/src/cmd/drive/commands.d.ts +112 -0
  84. package/dist/src/cmd/drive/commands.d.ts.map +1 -0
  85. package/dist/src/cmd/drive/commands.js +431 -0
  86. package/dist/src/cmd/drive/commands.js.map +1 -0
  87. package/dist/src/cmd/drive/runtime.d.ts +4 -0
  88. package/dist/src/cmd/drive/runtime.d.ts.map +1 -0
  89. package/dist/src/cmd/drive/runtime.js +336 -0
  90. package/dist/src/cmd/drive/runtime.js.map +1 -0
  91. package/dist/src/cmd/execution-context.d.ts +33 -0
  92. package/dist/src/cmd/execution-context.d.ts.map +1 -0
  93. package/dist/src/cmd/execution-context.js +31 -0
  94. package/dist/src/cmd/execution-context.js.map +1 -0
  95. package/dist/src/cmd/exit-codes/commands.d.ts +5 -0
  96. package/dist/src/cmd/exit-codes/commands.d.ts.map +1 -0
  97. package/dist/src/cmd/exit-codes/commands.js +25 -0
  98. package/dist/src/cmd/exit-codes/commands.js.map +1 -0
  99. package/dist/src/cmd/exit-codes.d.ts +4 -0
  100. package/dist/src/cmd/exit-codes.d.ts.map +1 -0
  101. package/dist/src/cmd/exit-codes.js +4 -0
  102. package/dist/src/cmd/exit-codes.js.map +1 -0
  103. package/dist/src/cmd/exit.d.ts +7 -0
  104. package/dist/src/cmd/exit.d.ts.map +1 -0
  105. package/dist/src/cmd/exit.js +19 -0
  106. package/dist/src/cmd/exit.js.map +1 -0
  107. package/dist/src/cmd/forms/commands.d.ts +19 -0
  108. package/dist/src/cmd/forms/commands.d.ts.map +1 -0
  109. package/dist/src/cmd/forms/commands.js +73 -0
  110. package/dist/src/cmd/forms/commands.js.map +1 -0
  111. package/dist/src/cmd/forms/runtime.d.ts +4 -0
  112. package/dist/src/cmd/forms/runtime.d.ts.map +1 -0
  113. package/dist/src/cmd/forms/runtime.js +38 -0
  114. package/dist/src/cmd/forms/runtime.js.map +1 -0
  115. package/dist/src/cmd/gmail/commands.d.ts +187 -0
  116. package/dist/src/cmd/gmail/commands.d.ts.map +1 -0
  117. package/dist/src/cmd/gmail/commands.js +767 -0
  118. package/dist/src/cmd/gmail/commands.js.map +1 -0
  119. package/dist/src/cmd/gmail/runtime.d.ts +9 -0
  120. package/dist/src/cmd/gmail/runtime.d.ts.map +1 -0
  121. package/dist/src/cmd/gmail/runtime.js +644 -0
  122. package/dist/src/cmd/gmail/runtime.js.map +1 -0
  123. package/dist/src/cmd/groups/commands.d.ts +26 -0
  124. package/dist/src/cmd/groups/commands.d.ts.map +1 -0
  125. package/dist/src/cmd/groups/commands.js +105 -0
  126. package/dist/src/cmd/groups/commands.js.map +1 -0
  127. package/dist/src/cmd/groups/runtime.d.ts +4 -0
  128. package/dist/src/cmd/groups/runtime.d.ts.map +1 -0
  129. package/dist/src/cmd/groups/runtime.js +61 -0
  130. package/dist/src/cmd/groups/runtime.js.map +1 -0
  131. package/dist/src/cmd/keep/commands.d.ts +23 -0
  132. package/dist/src/cmd/keep/commands.d.ts.map +1 -0
  133. package/dist/src/cmd/keep/commands.js +111 -0
  134. package/dist/src/cmd/keep/commands.js.map +1 -0
  135. package/dist/src/cmd/keep/runtime.d.ts +4 -0
  136. package/dist/src/cmd/keep/runtime.d.ts.map +1 -0
  137. package/dist/src/cmd/keep/runtime.js +82 -0
  138. package/dist/src/cmd/keep/runtime.js.map +1 -0
  139. package/dist/src/cmd/people/commands.d.ts +22 -0
  140. package/dist/src/cmd/people/commands.d.ts.map +1 -0
  141. package/dist/src/cmd/people/commands.js +96 -0
  142. package/dist/src/cmd/people/commands.js.map +1 -0
  143. package/dist/src/cmd/people/runtime.d.ts +4 -0
  144. package/dist/src/cmd/people/runtime.d.ts.map +1 -0
  145. package/dist/src/cmd/people/runtime.js +65 -0
  146. package/dist/src/cmd/people/runtime.js.map +1 -0
  147. package/dist/src/cmd/rewrite-desire-path-args.d.ts +2 -0
  148. package/dist/src/cmd/rewrite-desire-path-args.d.ts.map +1 -0
  149. package/dist/src/cmd/rewrite-desire-path-args.js +75 -0
  150. package/dist/src/cmd/rewrite-desire-path-args.js.map +1 -0
  151. package/dist/src/cmd/root.d.ts +10 -0
  152. package/dist/src/cmd/root.d.ts.map +1 -0
  153. package/dist/src/cmd/root.js +341 -0
  154. package/dist/src/cmd/root.js.map +1 -0
  155. package/dist/src/cmd/schema/commands.d.ts +3 -0
  156. package/dist/src/cmd/schema/commands.d.ts.map +1 -0
  157. package/dist/src/cmd/schema/commands.js +21 -0
  158. package/dist/src/cmd/schema/commands.js.map +1 -0
  159. package/dist/src/cmd/script-path.d.ts +2 -0
  160. package/dist/src/cmd/script-path.d.ts.map +1 -0
  161. package/dist/src/cmd/script-path.js +4 -0
  162. package/dist/src/cmd/script-path.js.map +1 -0
  163. package/dist/src/cmd/sheets/commands.d.ts +20 -0
  164. package/dist/src/cmd/sheets/commands.d.ts.map +1 -0
  165. package/dist/src/cmd/sheets/commands.js +79 -0
  166. package/dist/src/cmd/sheets/commands.js.map +1 -0
  167. package/dist/src/cmd/sheets/runtime.d.ts +4 -0
  168. package/dist/src/cmd/sheets/runtime.d.ts.map +1 -0
  169. package/dist/src/cmd/sheets/runtime.js +37 -0
  170. package/dist/src/cmd/sheets/runtime.js.map +1 -0
  171. package/dist/src/cmd/slides/commands.d.ts +24 -0
  172. package/dist/src/cmd/slides/commands.d.ts.map +1 -0
  173. package/dist/src/cmd/slides/commands.js +90 -0
  174. package/dist/src/cmd/slides/commands.js.map +1 -0
  175. package/dist/src/cmd/slides/runtime.d.ts +4 -0
  176. package/dist/src/cmd/slides/runtime.d.ts.map +1 -0
  177. package/dist/src/cmd/slides/runtime.js +92 -0
  178. package/dist/src/cmd/slides/runtime.js.map +1 -0
  179. package/dist/src/cmd/tasks/commands.d.ts +28 -0
  180. package/dist/src/cmd/tasks/commands.d.ts.map +1 -0
  181. package/dist/src/cmd/tasks/commands.js +103 -0
  182. package/dist/src/cmd/tasks/commands.js.map +1 -0
  183. package/dist/src/cmd/tasks/runtime.d.ts +4 -0
  184. package/dist/src/cmd/tasks/runtime.d.ts.map +1 -0
  185. package/dist/src/cmd/tasks/runtime.js +56 -0
  186. package/dist/src/cmd/tasks/runtime.js.map +1 -0
  187. package/dist/src/cmd/time/commands.d.ts +17 -0
  188. package/dist/src/cmd/time/commands.d.ts.map +1 -0
  189. package/dist/src/cmd/time/commands.js +88 -0
  190. package/dist/src/cmd/time/commands.js.map +1 -0
  191. package/dist/src/cmd/version/commands.d.ts +3 -0
  192. package/dist/src/cmd/version/commands.d.ts.map +1 -0
  193. package/dist/src/cmd/version/commands.js +17 -0
  194. package/dist/src/cmd/version/commands.js.map +1 -0
  195. package/dist/src/cmd/workspace/commands.d.ts +222 -0
  196. package/dist/src/cmd/workspace/commands.d.ts.map +1 -0
  197. package/dist/src/cmd/workspace/commands.js +685 -0
  198. package/dist/src/cmd/workspace/commands.js.map +1 -0
  199. package/dist/src/cmd/workspace/runtime.d.ts +8 -0
  200. package/dist/src/cmd/workspace/runtime.d.ts.map +1 -0
  201. package/dist/src/cmd/workspace/runtime.js +852 -0
  202. package/dist/src/cmd/workspace/runtime.js.map +1 -0
  203. package/dist/src/config/clients.d.ts +8 -0
  204. package/dist/src/config/clients.d.ts.map +1 -0
  205. package/dist/src/config/clients.js +95 -0
  206. package/dist/src/config/clients.js.map +1 -0
  207. package/dist/src/config/config.d.ts +11 -0
  208. package/dist/src/config/config.d.ts.map +1 -0
  209. package/dist/src/config/config.js +54 -0
  210. package/dist/src/config/config.js.map +1 -0
  211. package/dist/src/config/credentials.d.ts +16 -0
  212. package/dist/src/config/credentials.d.ts.map +1 -0
  213. package/dist/src/config/credentials.js +97 -0
  214. package/dist/src/config/credentials.js.map +1 -0
  215. package/dist/src/config/migration.d.ts +13 -0
  216. package/dist/src/config/migration.d.ts.map +1 -0
  217. package/dist/src/config/migration.js +70 -0
  218. package/dist/src/config/migration.js.map +1 -0
  219. package/dist/src/config/paths.d.ts +11 -0
  220. package/dist/src/config/paths.d.ts.map +1 -0
  221. package/dist/src/config/paths.js +74 -0
  222. package/dist/src/config/paths.js.map +1 -0
  223. package/dist/src/googleapi/auth-factory.d.ts +46 -0
  224. package/dist/src/googleapi/auth-factory.d.ts.map +1 -0
  225. package/dist/src/googleapi/auth-factory.js +88 -0
  226. package/dist/src/googleapi/auth-factory.js.map +1 -0
  227. package/dist/src/googleapi/calendar.d.ts +3 -0
  228. package/dist/src/googleapi/calendar.d.ts.map +1 -0
  229. package/dist/src/googleapi/calendar.js +21 -0
  230. package/dist/src/googleapi/calendar.js.map +1 -0
  231. package/dist/src/googleapi/circuitbreaker.d.ts +19 -0
  232. package/dist/src/googleapi/circuitbreaker.d.ts.map +1 -0
  233. package/dist/src/googleapi/circuitbreaker.js +43 -0
  234. package/dist/src/googleapi/circuitbreaker.js.map +1 -0
  235. package/dist/src/googleapi/client.d.ts +17 -0
  236. package/dist/src/googleapi/client.d.ts.map +1 -0
  237. package/dist/src/googleapi/client.js +18 -0
  238. package/dist/src/googleapi/client.js.map +1 -0
  239. package/dist/src/googleapi/drive.d.ts +3 -0
  240. package/dist/src/googleapi/drive.d.ts.map +1 -0
  241. package/dist/src/googleapi/drive.js +11 -0
  242. package/dist/src/googleapi/drive.js.map +1 -0
  243. package/dist/src/googleapi/errors.d.ts +37 -0
  244. package/dist/src/googleapi/errors.d.ts.map +1 -0
  245. package/dist/src/googleapi/errors.js +93 -0
  246. package/dist/src/googleapi/errors.js.map +1 -0
  247. package/dist/src/googleapi/retry-constants.d.ts +5 -0
  248. package/dist/src/googleapi/retry-constants.d.ts.map +1 -0
  249. package/dist/src/googleapi/retry-constants.js +5 -0
  250. package/dist/src/googleapi/retry-constants.js.map +1 -0
  251. package/dist/src/googleapi/transport.d.ts +3 -0
  252. package/dist/src/googleapi/transport.d.ts.map +1 -0
  253. package/dist/src/googleapi/transport.js +39 -0
  254. package/dist/src/googleapi/transport.js.map +1 -0
  255. package/dist/src/googleauth/oauth-flow.d.ts +62 -0
  256. package/dist/src/googleauth/oauth-flow.d.ts.map +1 -0
  257. package/dist/src/googleauth/oauth-flow.js +262 -0
  258. package/dist/src/googleauth/oauth-flow.js.map +1 -0
  259. package/dist/src/googleauth/service.d.ts +28 -0
  260. package/dist/src/googleauth/service.d.ts.map +1 -0
  261. package/dist/src/googleauth/service.js +345 -0
  262. package/dist/src/googleauth/service.js.map +1 -0
  263. package/dist/src/index.d.ts +2 -0
  264. package/dist/src/index.d.ts.map +1 -0
  265. package/dist/src/index.js +2 -0
  266. package/dist/src/index.js.map +1 -0
  267. package/dist/src/outfmt/outfmt.d.ts +8 -0
  268. package/dist/src/outfmt/outfmt.d.ts.map +1 -0
  269. package/dist/src/outfmt/outfmt.js +66 -0
  270. package/dist/src/outfmt/outfmt.js.map +1 -0
  271. package/dist/src/secrets/store.d.ts +61 -0
  272. package/dist/src/secrets/store.d.ts.map +1 -0
  273. package/dist/src/secrets/store.js +247 -0
  274. package/dist/src/secrets/store.js.map +1 -0
  275. package/dist/test/authclient/authclient.test.d.ts +2 -0
  276. package/dist/test/authclient/authclient.test.d.ts.map +1 -0
  277. package/dist/test/authclient/authclient.test.js +14 -0
  278. package/dist/test/authclient/authclient.test.js.map +1 -0
  279. package/dist/test/bin/gtypee-entrypoint.test.d.ts +2 -0
  280. package/dist/test/bin/gtypee-entrypoint.test.d.ts.map +1 -0
  281. package/dist/test/bin/gtypee-entrypoint.test.js +17 -0
  282. package/dist/test/bin/gtypee-entrypoint.test.js.map +1 -0
  283. package/dist/test/cmd/agent/commands.test.d.ts +2 -0
  284. package/dist/test/cmd/agent/commands.test.d.ts.map +1 -0
  285. package/dist/test/cmd/agent/commands.test.js +12 -0
  286. package/dist/test/cmd/agent/commands.test.js.map +1 -0
  287. package/dist/test/cmd/appscript/commands.test.d.ts +2 -0
  288. package/dist/test/cmd/appscript/commands.test.d.ts.map +1 -0
  289. package/dist/test/cmd/appscript/commands.test.js +104 -0
  290. package/dist/test/cmd/appscript/commands.test.js.map +1 -0
  291. package/dist/test/cmd/auth/commands.test.d.ts +2 -0
  292. package/dist/test/cmd/auth/commands.test.d.ts.map +1 -0
  293. package/dist/test/cmd/auth/commands.test.js +142 -0
  294. package/dist/test/cmd/auth/commands.test.js.map +1 -0
  295. package/dist/test/cmd/auth/runtime.test.d.ts +2 -0
  296. package/dist/test/cmd/auth/runtime.test.d.ts.map +1 -0
  297. package/dist/test/cmd/auth/runtime.test.js +214 -0
  298. package/dist/test/cmd/auth/runtime.test.js.map +1 -0
  299. package/dist/test/cmd/calendar/commands.test.d.ts +2 -0
  300. package/dist/test/cmd/calendar/commands.test.d.ts.map +1 -0
  301. package/dist/test/cmd/calendar/commands.test.js +121 -0
  302. package/dist/test/cmd/calendar/commands.test.js.map +1 -0
  303. package/dist/test/cmd/chat/commands.test.d.ts +2 -0
  304. package/dist/test/cmd/chat/commands.test.d.ts.map +1 -0
  305. package/dist/test/cmd/chat/commands.test.js +57 -0
  306. package/dist/test/cmd/chat/commands.test.js.map +1 -0
  307. package/dist/test/cmd/classroom/commands.test.d.ts +2 -0
  308. package/dist/test/cmd/classroom/commands.test.d.ts.map +1 -0
  309. package/dist/test/cmd/classroom/commands.test.js +61 -0
  310. package/dist/test/cmd/classroom/commands.test.js.map +1 -0
  311. package/dist/test/cmd/completion/commands.test.d.ts +2 -0
  312. package/dist/test/cmd/completion/commands.test.d.ts.map +1 -0
  313. package/dist/test/cmd/completion/commands.test.js +30 -0
  314. package/dist/test/cmd/completion/commands.test.js.map +1 -0
  315. package/dist/test/cmd/config/commands.test.d.ts +2 -0
  316. package/dist/test/cmd/config/commands.test.d.ts.map +1 -0
  317. package/dist/test/cmd/config/commands.test.js +21 -0
  318. package/dist/test/cmd/config/commands.test.js.map +1 -0
  319. package/dist/test/cmd/contacts/commands.test.d.ts +2 -0
  320. package/dist/test/cmd/contacts/commands.test.d.ts.map +1 -0
  321. package/dist/test/cmd/contacts/commands.test.js +51 -0
  322. package/dist/test/cmd/contacts/commands.test.js.map +1 -0
  323. package/dist/test/cmd/docs/commands.test.d.ts +2 -0
  324. package/dist/test/cmd/docs/commands.test.d.ts.map +1 -0
  325. package/dist/test/cmd/docs/commands.test.js +39 -0
  326. package/dist/test/cmd/docs/commands.test.js.map +1 -0
  327. package/dist/test/cmd/drive/commands.test.d.ts +2 -0
  328. package/dist/test/cmd/drive/commands.test.d.ts.map +1 -0
  329. package/dist/test/cmd/drive/commands.test.js +409 -0
  330. package/dist/test/cmd/drive/commands.test.js.map +1 -0
  331. package/dist/test/cmd/execution-context.test.d.ts +2 -0
  332. package/dist/test/cmd/execution-context.test.d.ts.map +1 -0
  333. package/dist/test/cmd/execution-context.test.js +29 -0
  334. package/dist/test/cmd/execution-context.test.js.map +1 -0
  335. package/dist/test/cmd/exit-codes/commands.test.d.ts +2 -0
  336. package/dist/test/cmd/exit-codes/commands.test.d.ts.map +1 -0
  337. package/dist/test/cmd/exit-codes/commands.test.js +19 -0
  338. package/dist/test/cmd/exit-codes/commands.test.js.map +1 -0
  339. package/dist/test/cmd/exit.test.d.ts +2 -0
  340. package/dist/test/cmd/exit.test.d.ts.map +1 -0
  341. package/dist/test/cmd/exit.test.js +14 -0
  342. package/dist/test/cmd/exit.test.js.map +1 -0
  343. package/dist/test/cmd/forms/commands.test.d.ts +2 -0
  344. package/dist/test/cmd/forms/commands.test.d.ts.map +1 -0
  345. package/dist/test/cmd/forms/commands.test.js +42 -0
  346. package/dist/test/cmd/forms/commands.test.js.map +1 -0
  347. package/dist/test/cmd/gmail/commands.test.d.ts +2 -0
  348. package/dist/test/cmd/gmail/commands.test.d.ts.map +1 -0
  349. package/dist/test/cmd/gmail/commands.test.js +315 -0
  350. package/dist/test/cmd/gmail/commands.test.js.map +1 -0
  351. package/dist/test/cmd/groups/commands.test.d.ts +2 -0
  352. package/dist/test/cmd/groups/commands.test.d.ts.map +1 -0
  353. package/dist/test/cmd/groups/commands.test.js +79 -0
  354. package/dist/test/cmd/groups/commands.test.js.map +1 -0
  355. package/dist/test/cmd/keep/commands.test.d.ts +2 -0
  356. package/dist/test/cmd/keep/commands.test.d.ts.map +1 -0
  357. package/dist/test/cmd/keep/commands.test.js +87 -0
  358. package/dist/test/cmd/keep/commands.test.js.map +1 -0
  359. package/dist/test/cmd/people/commands.test.d.ts +2 -0
  360. package/dist/test/cmd/people/commands.test.d.ts.map +1 -0
  361. package/dist/test/cmd/people/commands.test.js +52 -0
  362. package/dist/test/cmd/people/commands.test.js.map +1 -0
  363. package/dist/test/cmd/rewrite-desire-path-args.test.d.ts +2 -0
  364. package/dist/test/cmd/rewrite-desire-path-args.test.d.ts.map +1 -0
  365. package/dist/test/cmd/rewrite-desire-path-args.test.js +21 -0
  366. package/dist/test/cmd/rewrite-desire-path-args.test.js.map +1 -0
  367. package/dist/test/cmd/root.test.d.ts +2 -0
  368. package/dist/test/cmd/root.test.d.ts.map +1 -0
  369. package/dist/test/cmd/root.test.js +323 -0
  370. package/dist/test/cmd/root.test.js.map +1 -0
  371. package/dist/test/cmd/runtime-scopes.test.d.ts +2 -0
  372. package/dist/test/cmd/runtime-scopes.test.d.ts.map +1 -0
  373. package/dist/test/cmd/runtime-scopes.test.js +133 -0
  374. package/dist/test/cmd/runtime-scopes.test.js.map +1 -0
  375. package/dist/test/cmd/schema/commands.test.d.ts +2 -0
  376. package/dist/test/cmd/schema/commands.test.d.ts.map +1 -0
  377. package/dist/test/cmd/schema/commands.test.js +31 -0
  378. package/dist/test/cmd/schema/commands.test.js.map +1 -0
  379. package/dist/test/cmd/sheets/commands.test.d.ts +2 -0
  380. package/dist/test/cmd/sheets/commands.test.d.ts.map +1 -0
  381. package/dist/test/cmd/sheets/commands.test.js +39 -0
  382. package/dist/test/cmd/sheets/commands.test.js.map +1 -0
  383. package/dist/test/cmd/slides/commands.test.d.ts +2 -0
  384. package/dist/test/cmd/slides/commands.test.d.ts.map +1 -0
  385. package/dist/test/cmd/slides/commands.test.js +48 -0
  386. package/dist/test/cmd/slides/commands.test.js.map +1 -0
  387. package/dist/test/cmd/tasks/commands.test.d.ts +2 -0
  388. package/dist/test/cmd/tasks/commands.test.d.ts.map +1 -0
  389. package/dist/test/cmd/tasks/commands.test.js +74 -0
  390. package/dist/test/cmd/tasks/commands.test.js.map +1 -0
  391. package/dist/test/cmd/time/commands.test.d.ts +2 -0
  392. package/dist/test/cmd/time/commands.test.d.ts.map +1 -0
  393. package/dist/test/cmd/time/commands.test.js +52 -0
  394. package/dist/test/cmd/time/commands.test.js.map +1 -0
  395. package/dist/test/cmd/version/commands.test.d.ts +2 -0
  396. package/dist/test/cmd/version/commands.test.d.ts.map +1 -0
  397. package/dist/test/cmd/version/commands.test.js +12 -0
  398. package/dist/test/cmd/version/commands.test.js.map +1 -0
  399. package/dist/test/cmd/workspace/commands.test.d.ts +2 -0
  400. package/dist/test/cmd/workspace/commands.test.d.ts.map +1 -0
  401. package/dist/test/cmd/workspace/commands.test.js +285 -0
  402. package/dist/test/cmd/workspace/commands.test.js.map +1 -0
  403. package/dist/test/config/clients.test.d.ts +2 -0
  404. package/dist/test/config/clients.test.d.ts.map +1 -0
  405. package/dist/test/config/clients.test.js +42 -0
  406. package/dist/test/config/clients.test.js.map +1 -0
  407. package/dist/test/config/config.test.d.ts +2 -0
  408. package/dist/test/config/config.test.d.ts.map +1 -0
  409. package/dist/test/config/config.test.js +80 -0
  410. package/dist/test/config/config.test.js.map +1 -0
  411. package/dist/test/config/credentials.test.d.ts +2 -0
  412. package/dist/test/config/credentials.test.d.ts.map +1 -0
  413. package/dist/test/config/credentials.test.js +78 -0
  414. package/dist/test/config/credentials.test.js.map +1 -0
  415. package/dist/test/config/migration.test.d.ts +2 -0
  416. package/dist/test/config/migration.test.d.ts.map +1 -0
  417. package/dist/test/config/migration.test.js +136 -0
  418. package/dist/test/config/migration.test.js.map +1 -0
  419. package/dist/test/config/paths.test.d.ts +2 -0
  420. package/dist/test/config/paths.test.d.ts.map +1 -0
  421. package/dist/test/config/paths.test.js +31 -0
  422. package/dist/test/config/paths.test.js.map +1 -0
  423. package/dist/test/googleapi/auth-factory.test.d.ts +2 -0
  424. package/dist/test/googleapi/auth-factory.test.d.ts.map +1 -0
  425. package/dist/test/googleapi/auth-factory.test.js +215 -0
  426. package/dist/test/googleapi/auth-factory.test.js.map +1 -0
  427. package/dist/test/googleapi/circuitbreaker.test.d.ts +2 -0
  428. package/dist/test/googleapi/circuitbreaker.test.d.ts.map +1 -0
  429. package/dist/test/googleapi/circuitbreaker.test.js +30 -0
  430. package/dist/test/googleapi/circuitbreaker.test.js.map +1 -0
  431. package/dist/test/googleapi/client.test.d.ts +2 -0
  432. package/dist/test/googleapi/client.test.d.ts.map +1 -0
  433. package/dist/test/googleapi/client.test.js +16 -0
  434. package/dist/test/googleapi/client.test.js.map +1 -0
  435. package/dist/test/googleapi/errors.test.d.ts +2 -0
  436. package/dist/test/googleapi/errors.test.d.ts.map +1 -0
  437. package/dist/test/googleapi/errors.test.js +21 -0
  438. package/dist/test/googleapi/errors.test.js.map +1 -0
  439. package/dist/test/googleapi/transport.test.d.ts +2 -0
  440. package/dist/test/googleapi/transport.test.d.ts.map +1 -0
  441. package/dist/test/googleapi/transport.test.js +25 -0
  442. package/dist/test/googleapi/transport.test.js.map +1 -0
  443. package/dist/test/googleauth/oauth-flow.test.d.ts +2 -0
  444. package/dist/test/googleauth/oauth-flow.test.d.ts.map +1 -0
  445. package/dist/test/googleauth/oauth-flow.test.js +85 -0
  446. package/dist/test/googleauth/oauth-flow.test.js.map +1 -0
  447. package/dist/test/googleauth/service.test.d.ts +2 -0
  448. package/dist/test/googleauth/service.test.d.ts.map +1 -0
  449. package/dist/test/googleauth/service.test.js +51 -0
  450. package/dist/test/googleauth/service.test.js.map +1 -0
  451. package/dist/test/outfmt/outfmt.test.d.ts +2 -0
  452. package/dist/test/outfmt/outfmt.test.d.ts.map +1 -0
  453. package/dist/test/outfmt/outfmt.test.js +41 -0
  454. package/dist/test/outfmt/outfmt.test.js.map +1 -0
  455. package/dist/test/secrets/store.test.d.ts +2 -0
  456. package/dist/test/secrets/store.test.d.ts.map +1 -0
  457. package/dist/test/secrets/store.test.js +164 -0
  458. package/dist/test/secrets/store.test.js.map +1 -0
  459. package/dist/vitest.config.d.ts +3 -0
  460. package/dist/vitest.config.d.ts.map +1 -0
  461. package/dist/vitest.config.js +11 -0
  462. package/dist/vitest.config.js.map +1 -0
  463. package/logo.svg +16 -0
  464. package/package.json +69 -0
package/README.md ADDED
@@ -0,0 +1,1442 @@
1
+ <div align="center">
2
+ <img src="logo.svg" alt="gtypee logo" width="200" height="200">
3
+
4
+ # gtypee
5
+
6
+ **TypeScript CLI for Google Workspace administration**
7
+
8
+ [![npm version](https://img.shields.io/npm/v/gtypee.svg)](https://www.npmjs.com/package/gtypee)
9
+ [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
10
+ [![Node.js Version](https://img.shields.io/node/v/gtypee.svg)](https://nodejs.org)
11
+ [![CI](https://github.com/ejpespa/gtypee/actions/workflows/ci.yml/badge.svg)](https://github.com/ejpespa/gtypee/actions/workflows/ci.yml)
12
+ [![Release](https://github.com/ejpespa/gtypee/actions/workflows/release.yml/badge.svg)](https://github.com/ejpespa/gtypee/actions/workflows/release.yml)
13
+
14
+ **[📚 Documentation](https://gtypee.ejpespa.dev)** • **[🐛 Report Bug](https://github.com/ejpespa/gtypee/issues)** • **[✨ Request Feature](https://github.com/ejpespa/gtypee/issues)**
15
+ </div>
16
+
17
+ ---
18
+
19
+ A powerful command-line interface for managing Gmail, Drive, Calendar, and 15+ Google services. Perfect for personal productivity, workspace administration, and automation scripts.
20
+
21
+ ## Key Features
22
+
23
+ - **15+ Google Services** - Gmail, Drive, Calendar, Docs, Sheets, Slides, Tasks, Forms, Contacts, People, Chat, Classroom, Groups, Keep, and Apps Script
24
+ - **Two Auth Modes** - OAuth 2.0 for personal accounts, Service Account for workspace admin
25
+ - **JSON Output** - All commands support `--json` for scripting and automation
26
+ - **Workspace Admin** - Full user, group, and device management for Google Workspace domains
27
+ - **Beginner Friendly** - Intuitive commands with helpful examples
28
+
29
+ ## Table of Contents
30
+
31
+ - [Installation](#installation)
32
+ - [Quick Start](#quick-start)
33
+ - [Authentication](#authentication)
34
+ - [Commands Reference](#commands-reference)
35
+ - [Gmail](#gmail-commands)
36
+ - [Drive](#drive-commands)
37
+ - [Calendar](#calendar-commands)
38
+ - [Workspace Admin](#workspace-admin-commands)
39
+ - [Docs, Sheets, Slides](#docs-sheets-slides-commands)
40
+ - [Other Services](#other-services)
41
+ - [Usage Scenarios](#usage-scenarios)
42
+ - [JSON Output](#json-output)
43
+ - [Configuration](#configuration)
44
+ - [Development](#development)
45
+ - [Contributing](#contributing)
46
+ - [Tips & Troubleshooting](#tips--troubleshooting)
47
+ - [License](#license)
48
+
49
+ ---
50
+
51
+ ## Installation
52
+
53
+ ### From npm (recommended)
54
+
55
+ ```bash
56
+ npm install -g gtypee
57
+ gtypee --help
58
+ ```
59
+
60
+ ### From source
61
+
62
+ ```bash
63
+ git clone https://github.com/ejpespa/gtypee.git
64
+ cd gtypee
65
+ npm install
66
+ npm run build
67
+ npm link
68
+ gtypee --help
69
+ ```
70
+
71
+ ### Prerequisites
72
+
73
+ - Node.js 20+
74
+ - npm
75
+ - A Google Cloud project (free tier works)
76
+
77
+ ---
78
+
79
+ ## Quick Start
80
+
81
+ ```bash
82
+ # Install from npm
83
+ npm install -g gtypee
84
+
85
+ # Set up authentication
86
+ gtypee auth add --email you@gmail.com
87
+
88
+ # Start using
89
+ gtypee gmail labels
90
+ gtypee drive ls
91
+ gtypee calendar events
92
+ gtypee people me
93
+ ```
94
+
95
+ ### Running from Source (Development)
96
+
97
+ If you cloned the repository for development:
98
+
99
+ ```bash
100
+ # Install dependencies
101
+ npm install
102
+
103
+ # Build the project first!
104
+ npm run build
105
+
106
+ # Use the compiled version (RECOMMENDED for JSON output)
107
+ node dist/bin/gtypee.js --help
108
+
109
+ # Or use dev mode (NOT recommended for piping to jq)
110
+ npm run dev -- --help
111
+ ```
112
+
113
+ > **Important:** When using `--json` output and piping to `jq` or other tools, **always use the compiled version** (`node dist/bin/gtypee.js`). The `npm run dev` command adds extra output that breaks JSON parsing.
114
+ >
115
+ > ```bash
116
+ > # WRONG - npm output will break jq
117
+ > npm run dev -- workspace user list --json | jq
118
+ >
119
+ > # CORRECT - use compiled version
120
+ > node dist/bin/gtypee.js workspace user list --json | jq '.[].primaryEmail'
121
+ > ```
122
+
123
+ ---
124
+
125
+ ## Authentication
126
+
127
+ gtypee supports two authentication modes:
128
+
129
+ ### OAuth 2.0 (Personal Accounts)
130
+
131
+ For `@gmail.com` accounts and Workspace users accessing their own data.
132
+
133
+ **1. Create a Google Cloud Project**
134
+
135
+ 1. Go to [Google Cloud Console](https://console.cloud.google.com/)
136
+ 2. Create a new project (e.g., `gtypee`)
137
+ 3. Go to **APIs & Services > OAuth consent screen**
138
+ 4. Select **External** user type
139
+ 5. Fill in required fields (App name: `gtypee`, your email)
140
+ 6. Add your email as a **Test user**
141
+
142
+ **2. Enable APIs**
143
+
144
+ Enable the APIs you need in [APIs & Services > Library](https://console.cloud.google.com/apis/library):
145
+
146
+ | API | Services |
147
+ |-----|----------|
148
+ | Gmail API | `gmail` |
149
+ | Google Calendar API | `calendar` |
150
+ | Google Drive API | `drive`, `docs`, `sheets`, `slides` |
151
+ | Google Docs API | `docs` |
152
+ | Google Sheets API | `sheets` |
153
+ | Google Slides API | `slides` |
154
+ | Google Tasks API | `tasks` |
155
+ | Google Forms API | `forms` |
156
+ | People API | `contacts`, `people` |
157
+ | Google Chat API | `chat` |
158
+ | Google Classroom API | `classroom` |
159
+ | Apps Script API | `appscript` |
160
+
161
+ **3. Create OAuth Credentials**
162
+
163
+ 1. Go to **APIs & Services > Credentials**
164
+ 2. Click **Create Credentials > OAuth client ID**
165
+ 3. Application type: **Desktop app**
166
+ 4. Copy the **Client ID** and **Client Secret**
167
+
168
+ **4. Add Credentials to gtypee**
169
+
170
+ Create `credentials.json` in the config directory:
171
+
172
+ | OS | Path |
173
+ |----|------|
174
+ | Windows | `%APPDATA%\typee\credentials.json` |
175
+ | macOS | `~/.config/gtypee/credentials.json` |
176
+ | Linux | `~/.config/gtypee/credentials.json` |
177
+
178
+ ```json
179
+ {
180
+ "clientId": "YOUR_CLIENT_ID.apps.googleusercontent.com",
181
+ "clientSecret": "YOUR_CLIENT_SECRET"
182
+ }
183
+ ```
184
+
185
+ **5. Authenticate**
186
+
187
+ ```bash
188
+ # Browser flow
189
+ gtypee auth add --email you@gmail.com
190
+
191
+ # Manual flow (no browser auto-open)
192
+ gtypee auth add --email you@gmail.com --manual
193
+
194
+ # Remote/headless (SSH, server)
195
+ gtypee auth add --email you@gmail.com --remote --step 1
196
+ # Open URL in browser, then:
197
+ gtypee auth add --email you@gmail.com --remote --step 2 --auth-url "http://localhost:PORT/?code=..."
198
+ ```
199
+
200
+ **6. Verify**
201
+
202
+ ```bash
203
+ gtypee auth status
204
+ gtypee auth list
205
+ gtypee people me
206
+ ```
207
+
208
+ ### Service Account (Workspace Admin)
209
+
210
+ For Workspace administrators who need to:
211
+ - Access employee data across the organization
212
+ - Run automated/headless scripts
213
+ - Use Workspace-only APIs (Groups, Keep)
214
+
215
+ **1. Create a Service Account**
216
+
217
+ 1. Go to [IAM & Admin > Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts)
218
+ 2. Click **Create Service Account**
219
+ 3. Go to **Keys** tab > **Add Key > Create new key > JSON**
220
+ 4. Save the JSON file securely
221
+
222
+ **2. Enable Domain-Wide Delegation**
223
+
224
+ 1. On the service account, click **Show Advanced Settings**
225
+ 2. Check **Enable Google Workspace Domain-wide Delegation**
226
+ 3. Note the **Client ID** (numeric)
227
+
228
+ **3. Authorize Scopes in Admin Console**
229
+
230
+ 1. Go to [Admin Console](https://admin.google.com) > **Security > API Controls**
231
+ 2. Click **Manage Domain Wide Delegation** > **Add new**
232
+ 3. Enter the service account **Client ID**
233
+ 4. Paste the required scopes (comma-separated)
234
+
235
+ <details>
236
+ <summary>All scopes (click to expand)</summary>
237
+
238
+ ```
239
+ https://www.googleapis.com/auth/gmail.modify,https://www.googleapis.com/auth/gmail.settings.basic,https://www.googleapis.com/auth/gmail.settings.sharing,https://www.googleapis.com/auth/calendar,https://www.googleapis.com/auth/chat.spaces,https://www.googleapis.com/auth/chat.messages,https://www.googleapis.com/auth/chat.memberships,https://www.googleapis.com/auth/chat.users.readstate.readonly,https://www.googleapis.com/auth/classroom.courses,https://www.googleapis.com/auth/classroom.rosters,https://www.googleapis.com/auth/classroom.coursework.students,https://www.googleapis.com/auth/classroom.coursework.me,https://www.googleapis.com/auth/classroom.courseworkmaterials,https://www.googleapis.com/auth/classroom.announcements,https://www.googleapis.com/auth/classroom.topics,https://www.googleapis.com/auth/classroom.guardianlinks.students,https://www.googleapis.com/auth/classroom.profile.emails,https://www.googleapis.com/auth/classroom.profile.photos,https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/documents,https://www.googleapis.com/auth/presentations,https://www.googleapis.com/auth/spreadsheets,https://www.googleapis.com/auth/contacts,https://www.googleapis.com/auth/contacts.other.readonly,https://www.googleapis.com/auth/directory.readonly,https://www.googleapis.com/auth/tasks,https://www.googleapis.com/auth/forms.body,https://www.googleapis.com/auth/forms.responses.readonly,https://www.googleapis.com/auth/script.projects,https://www.googleapis.com/auth/script.deployments,https://www.googleapis.com/auth/script.processes,https://www.googleapis.com/auth/admin.directory.user,https://www.googleapis.com/auth/admin.directory.user.security,https://www.googleapis.com/auth/admin.directory.orgunit,https://www.googleapis.com/auth/admin.directory.group,https://www.googleapis.com/auth/admin.directory.group.member,https://www.googleapis.com/auth/admin.directory.device.chromeos,https://www.googleapis.com/auth/admin.directory.device.mobile,https://www.googleapis.com/auth/admin.reports.audit.readonly,https://www.googleapis.com/auth/keep.readonly
240
+ ```
241
+
242
+ </details>
243
+
244
+ <details>
245
+ <summary>Workspace Admin only scopes (minimal)</summary>
246
+
247
+ ```
248
+ https://www.googleapis.com/auth/admin.directory.user,https://www.googleapis.com/auth/admin.directory.user.security,https://www.googleapis.com/auth/admin.directory.orgunit,https://www.googleapis.com/auth/admin.directory.group,https://www.googleapis.com/auth/admin.directory.group.member,https://www.googleapis.com/auth/admin.directory.device.chromeos,https://www.googleapis.com/auth/admin.directory.device.mobile,https://www.googleapis.com/auth/admin.reports.audit.readonly
249
+ ```
250
+
251
+ </details>
252
+
253
+ **4. Import the Key**
254
+
255
+ ```bash
256
+ gtypee auth add-sa --key-file /path/to/sa-key.json
257
+ gtypee auth set-default-sa --email sa@project.iam.gserviceaccount.com
258
+ ```
259
+
260
+ **5. Use Service Account**
261
+
262
+ ```bash
263
+ # With explicit SA
264
+ gtypee --sa sa@project.iam.gserviceaccount.com --impersonate user@domain.com gmail labels
265
+
266
+ # With default SA
267
+ gtypee --impersonate user@domain.com drive ls
268
+ ```
269
+
270
+ ---
271
+
272
+ ## Commands Reference
273
+
274
+ ### Global Flags
275
+
276
+ | Flag | Description |
277
+ |------|-------------|
278
+ | `--json` | JSON output (for scripting) |
279
+ | `--plain` | Stable plain-text output |
280
+ | `--account <email>` | Select OAuth account |
281
+ | `--client <name>` | Select OAuth client credentials |
282
+ | `--sa <email>` | Use service account |
283
+ | `--impersonate <email>` | Impersonate Workspace user (requires `--sa`) |
284
+ | `--verbose` | Verbose logging |
285
+ | `--dry-run` | Show planned actions without executing |
286
+
287
+ ### Gmail Commands
288
+
289
+ **Messages**
290
+
291
+ ```bash
292
+ gtypee gmail list # List recent messages
293
+ gtypee gmail list --query "is:unread" # Filter with Gmail query
294
+ gtypee gmail search --query "from:boss@company.com" # Search messages
295
+ gtypee gmail get <message-id> # Get full message
296
+ gtypee gmail delete <message-id> --force # Permanently delete
297
+ gtypee gmail trash <message-id> # Move to trash
298
+ gtypee gmail untrash <message-id> # Restore from trash
299
+ gtypee gmail modify <message-id> --add-label STARRED --remove-label UNREAD
300
+ gtypee gmail send --to person@example.com --subject "Hello" --body "Hi there"
301
+ ```
302
+
303
+ **Drafts**
304
+
305
+ ```bash
306
+ gtypee gmail draft create --to person@example.com --subject "Draft" --body "Content"
307
+ gtypee gmail draft list
308
+ gtypee gmail draft get <draft-id>
309
+ gtypee gmail draft delete <draft-id> --force
310
+ gtypee gmail draft send <draft-id>
311
+ ```
312
+
313
+ **Threads**
314
+
315
+ ```bash
316
+ gtypee gmail thread list
317
+ gtypee gmail thread list --query "has:attachment"
318
+ gtypee gmail thread get <thread-id>
319
+ ```
320
+
321
+ **Labels**
322
+
323
+ ```bash
324
+ gtypee gmail labels # List all labels
325
+ gtypee gmail label create --name "Projects" --color "#ffcc00:#000000"
326
+ gtypee gmail label get <label-id>
327
+ gtypee gmail label update <label-id> --name "New Name"
328
+ gtypee gmail label delete <label-id> --force
329
+ ```
330
+
331
+ **Filters**
332
+
333
+ ```bash
334
+ gtypee gmail filter list
335
+ gtypee gmail filter create --query "from:newsletter@example.com" --add-label TRASH
336
+ gtypee gmail filter delete <filter-id> --force
337
+ ```
338
+
339
+ **Signatures**
340
+
341
+ ```bash
342
+ gtypee gmail signature list
343
+ gtypee gmail signature get --email you@example.com
344
+ gtypee gmail signature set --email you@example.com --signature "Best, John"
345
+ ```
346
+
347
+ ### Drive Commands
348
+
349
+ **Files and Folders**
350
+
351
+ ```bash
352
+ gtypee drive ls # List files
353
+ gtypee drive search --query "name contains 'report'"
354
+ gtypee drive download --id <file-id> --out ./file.pdf
355
+ gtypee drive upload --path ./report.pdf
356
+ gtypee drive delete <file-id> # Move to trash
357
+ gtypee drive delete <file-id> --permanent # Permanently delete
358
+ gtypee drive copy <file-id> --name "Copy of File"
359
+ gtypee drive move <file-id> --parent <folder-id>
360
+ gtypee drive rename <file-id> --name "New Name"
361
+ gtypee drive mkdir --name "New Folder"
362
+ gtypee drive info <file-id>
363
+ ```
364
+
365
+ **Permissions**
366
+
367
+ ```bash
368
+ gtypee drive permission list <file-id>
369
+ gtypee drive permission create <file-id> --email person@example.com --role reader
370
+ gtypee drive permission create <file-id> --email team@company.com --role writer --type group
371
+ gtypee drive permission delete <file-id> --permission-id <perm-id>
372
+ ```
373
+
374
+ **Comments**
375
+
376
+ ```bash
377
+ gtypee drive comment list <file-id>
378
+ gtypee drive comment create <file-id> --content "Please review this"
379
+ gtypee drive comment delete <file-id> --comment-id <comment-id>
380
+ ```
381
+
382
+ **Revisions**
383
+
384
+ ```bash
385
+ gtypee drive revision list <file-id>
386
+ gtypee drive revision get <file-id> --revision-id <rev-id>
387
+ gtypee drive revision delete <file-id> --revision-id <rev-id>
388
+ ```
389
+
390
+ ### Calendar Commands
391
+
392
+ ```bash
393
+ gtypee calendar events # List upcoming events
394
+ gtypee calendar events --from "2026-03-01" --to "2026-03-31"
395
+ gtypee calendar create --summary "Team Meeting" --start "2026-03-15T10:00:00" --end "2026-03-15T11:00:00"
396
+ gtypee calendar update --id <event-id> --summary "Updated Meeting"
397
+ gtypee calendar respond --id <event-id> --response accepted
398
+ gtypee calendar conflicts --from "2026-03-01" --to "2026-03-31"
399
+ ```
400
+
401
+ ### Workspace Admin Commands
402
+
403
+ > **Note:** Workspace admin commands require a service account with domain-wide delegation.
404
+
405
+ **Quick Examples with Service Account:**
406
+
407
+ ```bash
408
+ # Set up alias for convenience
409
+ alias gtypee-admin='npm run dev -- --sa your-sa@project.iam.gserviceaccount.com --impersonate admin@yourdomain.com'
410
+
411
+ # Or use directly:
412
+ gtypee --sa your-sa@project.iam.gserviceaccount.com --impersonate admin@yourdomain.com workspace user list
413
+ ```
414
+
415
+ **User Management**
416
+
417
+ ```bash
418
+ gtypee workspace user list # List all users
419
+ gtypee workspace user list --org-unit "/Sales" # Filter by org unit
420
+ gtypee workspace user create --email john@company.com --first-name John --last-name Doe
421
+ gtypee workspace user create --email jane@company.com --first-name Jane --last-name Smith --password Temp123! --org-unit "/Engineering" --admin
422
+ gtypee workspace user delete --email user@company.com --force
423
+ gtypee workspace user suspend --email user@company.com
424
+ gtypee workspace user unsuspend --email user@company.com
425
+ gtypee workspace user reset-password --email user@company.com
426
+ gtypee workspace user set-admin --email user@company.com --yes
427
+ gtypee workspace user set-org-unit --email user@company.com --org-unit "/Sales"
428
+ ```
429
+
430
+ **User Aliases**
431
+
432
+ ```bash
433
+ gtypee workspace user add-alias --email user@company.com --alias alias@company.com
434
+ gtypee workspace user list-aliases --email user@company.com
435
+ gtypee workspace user delete-alias --email user@company.com --alias alias@company.com
436
+ ```
437
+
438
+ **User Photos**
439
+
440
+ ```bash
441
+ gtypee workspace user set-photo --email user@company.com --path ./photo.jpg
442
+ gtypee workspace user delete-photo --email user@company.com
443
+ ```
444
+
445
+ **Backup Codes**
446
+
447
+ ```bash
448
+ gtypee workspace user generate-backup-codes --email user@company.com
449
+ ```
450
+
451
+ **Group Management**
452
+
453
+ ```bash
454
+ gtypee workspace group list
455
+ gtypee workspace group create --email team@company.com --name "Team Group"
456
+ gtypee workspace group delete --email team@company.com --force
457
+ gtypee workspace group list-members --group team@company.com
458
+ gtypee workspace group add-member --group team@company.com --email user@company.com --role MEMBER
459
+ gtypee workspace group remove-member --group team@company.com --email user@company.com
460
+ ```
461
+
462
+ **Organization Units**
463
+
464
+ ```bash
465
+ gtypee workspace org list
466
+ gtypee workspace org create --name "Engineering" --parent "/" --description "Engineering team"
467
+ gtypee workspace org get --path "/Engineering"
468
+ gtypee workspace org update --path "/Engineering" --name "Dev Team"
469
+ gtypee workspace org delete --path "/Engineering" --force
470
+ ```
471
+
472
+ **Devices**
473
+
474
+ ```bash
475
+ gtypee workspace device list
476
+ gtypee workspace device list --type chromebook
477
+ gtypee workspace device list --type mobile --org-unit "/Sales"
478
+ ```
479
+
480
+ **Reports**
481
+
482
+ ```bash
483
+ gtypee workspace report logins --days 30
484
+ gtypee workspace report admin --days 7
485
+ ```
486
+
487
+ ### Docs, Sheets, Slides Commands
488
+
489
+ **Google Docs**
490
+
491
+ ```bash
492
+ gtypee docs create --title "My Document"
493
+ gtypee docs read --id <doc-id>
494
+ gtypee docs markdown --id <doc-id> # Export as markdown
495
+ gtypee docs write --id <doc-id> --markdown "# Heading\nContent"
496
+ ```
497
+
498
+ **Google Sheets**
499
+
500
+ ```bash
501
+ gtypee sheets create --title "My Spreadsheet"
502
+ gtypee sheets read --id <sheet-id> --range "Sheet1!A1:D10"
503
+ gtypee sheets update --id <sheet-id> --range "Sheet1!A1:B2" --values "Name,Age;John,30;Jane,25"
504
+ ```
505
+
506
+ **Google Slides**
507
+
508
+ ```bash
509
+ gtypee slides create --title "My Presentation"
510
+ gtypee slides list --id <presentation-id>
511
+ gtypee slides read --id <presentation-id> --index 0
512
+ gtypee slides export --id <presentation-id> --format pdf
513
+ ```
514
+
515
+ ### Other Services
516
+
517
+ **Tasks**
518
+
519
+ ```bash
520
+ gtypee tasks list
521
+ gtypee tasks list --list <task-list-id>
522
+ gtypee tasks add --title "Buy groceries"
523
+ gtypee tasks update --id <task-id> --title "Updated task"
524
+ gtypee tasks done --id <task-id>
525
+ ```
526
+
527
+ **Forms**
528
+
529
+ ```bash
530
+ gtypee forms create --title "Survey"
531
+ gtypee forms get --id <form-id>
532
+ gtypee forms responses --id <form-id>
533
+ ```
534
+
535
+ **Contacts**
536
+
537
+ ```bash
538
+ gtypee contacts list
539
+ gtypee contacts search --query "john"
540
+ gtypee contacts get --resource <resource-name>
541
+ gtypee contacts update --resource <resource-name> --email new@email.com
542
+ ```
543
+
544
+ **People**
545
+
546
+ ```bash
547
+ gtypee people me # Show your profile
548
+ gtypee people search --query "john"
549
+ gtypee people get --resource <resource-name>
550
+ gtypee people update --resource <resource-name> --name "New Name"
551
+ ```
552
+
553
+ **Chat**
554
+
555
+ ```bash
556
+ gtypee chat spaces
557
+ gtypee chat get-space --space <space-id>
558
+ gtypee chat create-space --name "New Space"
559
+ gtypee chat messages --space <space-id>
560
+ gtypee chat send --space <space-id> --text "Hello team!"
561
+ ```
562
+
563
+ **Classroom**
564
+
565
+ ```bash
566
+ gtypee classroom courses
567
+ gtypee classroom get-course --course <course-id>
568
+ gtypee classroom create-course --name "New Course"
569
+ gtypee classroom submissions --course <course-id>
570
+ ```
571
+
572
+ **Groups (Legacy)**
573
+
574
+ ```bash
575
+ gtypee groups list
576
+ gtypee groups get --group <group-key>
577
+ gtypee groups members --group <group-key>
578
+ gtypee groups add-member --group <group-key> --email user@company.com --role MEMBER
579
+ gtypee groups remove-member --group <group-key> --email user@company.com
580
+ ```
581
+
582
+ **Keep**
583
+
584
+ ```bash
585
+ gtypee keep list
586
+ gtypee keep get --id <note-id>
587
+ gtypee keep search --query "shopping"
588
+ gtypee keep create --title "Shopping List"
589
+ gtypee keep update --id <note-id> --title "Updated Title"
590
+ ```
591
+
592
+ **Apps Script**
593
+
594
+ ```bash
595
+ gtypee appscript list
596
+ gtypee appscript get --id <script-id>
597
+ gtypee appscript create --title "My Script"
598
+ gtypee appscript run --id <script-id> --fn myFunction
599
+ gtypee appscript run --id <script-id> --fn myFunction --params '["arg1", "arg2"]'
600
+ ```
601
+
602
+ ### Desire-Path Aliases
603
+
604
+ Top-level shortcuts for common commands:
605
+
606
+ | Alias | Expands To |
607
+ |-------|-----------|
608
+ | `gtypee send` | `gtypee gmail send` |
609
+ | `gtypee ls` | `gtypee drive ls` |
610
+ | `gtypee search` | `gtypee drive search` |
611
+ | `gtypee download` | `gtypee drive download` |
612
+ | `gtypee upload` | `gtypee drive upload` |
613
+ | `gtypee login` | `gtypee auth add` |
614
+ | `gtypee logout` | `gtypee auth remove` |
615
+ | `gtypee status` | `gtypee auth status` |
616
+ | `gtypee me` | `gtypee people me` |
617
+ | `gtypee whoami` | `gtypee people me` |
618
+
619
+ ---
620
+
621
+ ## Usage Scenarios
622
+
623
+ This section covers practical real-world examples organized by common use cases.
624
+
625
+ ### User Management Scenarios
626
+
627
+ #### Onboarding a New Employee
628
+
629
+ ```bash
630
+ # 1. Create the user with initial settings
631
+ gtypee workspace user create \
632
+ --email john.doe@company.com \
633
+ --first-name John \
634
+ --last-name Doe \
635
+ --password "Temp@12345" \
636
+ --org-unit "/Engineering" \
637
+ --change-password-next-login
638
+
639
+ # 2. Add email aliases
640
+ gtypee workspace user add-alias \
641
+ --email john.doe@company.com \
642
+ --alias jdoe@company.com
643
+
644
+ # 3. Add to appropriate groups
645
+ gtypee workspace group add-member \
646
+ --group engineering@company.com \
647
+ --email john.doe@company.com \
648
+ --role MEMBER
649
+
650
+ gtypee workspace group add-member \
651
+ --group all-staff@company.com \
652
+ --email john.doe@company.com
653
+
654
+ # 4. Generate backup codes for 2FA
655
+ gtypee workspace user generate-backup-codes \
656
+ --email john.doe@company.com
657
+
658
+ # 5. Verify the user was created correctly
659
+ gtypee workspace user list --json | jq '.[] | select(.primaryEmail == "john.doe@company.com")'
660
+ ```
661
+
662
+ #### Offboarding an Employee
663
+
664
+ ```bash
665
+ # 1. Suspend the account immediately
666
+ gtypee workspace user suspend --email former@company.com
667
+
668
+ # 2. Remove from all groups (list first)
669
+ gtypee workspace group list --json | jq '.[].email' | while read group; do
670
+ gtypee workspace group remove-member --group "$group" --email former@company.com 2>/dev/null
671
+ done
672
+
673
+ # 3. Transfer Drive files to manager
674
+ gtypee --impersonate former@company.com drive ls --json | jq '.[].id' | while read file; do
675
+ gtypee --impersonate former@company.com drive permission create "$file" \
676
+ --email manager@company.com --role owner --transfer-ownership
677
+ done
678
+
679
+ # 4. Delete after hold period (30+ days)
680
+ gtypee workspace user delete --email former@company.com --force
681
+ ```
682
+
683
+ #### Bulk User Operations
684
+
685
+ ```bash
686
+ # Export all users to CSV
687
+ gtypee workspace user list --json | jq -r '.[] | [.primaryEmail, .name.givenName, .name.familyName, .orgUnitPath, .suspended] | @csv' > users.csv
688
+
689
+ # Find all suspended users
690
+ gtypee workspace user list --json | jq '.[] | select(.suspended == true) | .primaryEmail'
691
+
692
+ # Find all admin users
693
+ gtypee workspace user list --json | jq '.[] | select(.isAdmin == true) | .primaryEmail'
694
+
695
+ # Count users by org unit
696
+ gtypee workspace user list --json | jq -r '.[].orgUnitPath' | sort | uniq -c
697
+
698
+ # Find users who haven't changed password in 90 days (via login audit)
699
+ gtypee workspace report logins --days 90 --json | jq -r '.[] | select(.success == true) | .userEmail' | sort | uniq
700
+ ```
701
+
702
+ ### Group Management Scenarios
703
+
704
+ #### Creating a Project Team Group
705
+
706
+ ```bash
707
+ # 1. Create the group
708
+ gtypee workspace group create \
709
+ --email project-alpha@company.com \
710
+ --name "Project Alpha Team" \
711
+ --description "Members of Project Alpha"
712
+
713
+ # 2. Add team members
714
+ for email in alice@company.com bob@company.com charlie@company.com; do
715
+ gtypee workspace group add-member \
716
+ --group project-alpha@company.com \
717
+ --email "$email" \
718
+ --role MEMBER
719
+ done
720
+
721
+ # 3. Add project manager as owner
722
+ gtypee workspace group add-member \
723
+ --group project-alpha@company.com \
724
+ --email pm@company.com \
725
+ --role OWNER
726
+
727
+ # 4. Verify membership
728
+ gtypee workspace group list-members --group project-alpha@company.com
729
+ ```
730
+
731
+ #### Group Membership Audit
732
+
733
+ ```bash
734
+ # List all groups and their member counts
735
+ gtypee workspace group list --json | jq '.[] | .email' | while read group; do
736
+ count=$(gtypee workspace group list-members --group "$group" --json | jq 'length')
737
+ echo "$group: $count members"
738
+ done
739
+
740
+ # Find all groups a user belongs to
741
+ gtypee workspace group list --json | jq '.[].email' | while read group; do
742
+ if gtypee workspace group list-members --group "$group" --json | jq -e ".[] | select(.email == \"user@company.com\")" > /dev/null; then
743
+ echo "$group"
744
+ fi
745
+ done
746
+
747
+ # Export group memberships to CSV
748
+ gtypee workspace group list --json | jq '.[].email' | while read group; do
749
+ gtypee workspace group list-members --group "$group" --json | jq -r ".[] | [\"$group\", .email, .role] | @csv"
750
+ done > group-memberships.csv
751
+ ```
752
+
753
+ ### Organization Unit Management
754
+
755
+ #### Creating an Org Structure
756
+
757
+ ```bash
758
+ # Create top-level departments
759
+ for dept in Engineering Sales Marketing HR Finance; do
760
+ gtypee workspace org create \
761
+ --name "$dept" \
762
+ --parent "/" \
763
+ --description "$dept Department"
764
+ done
765
+
766
+ # Create sub-units under Engineering
767
+ gtypee workspace org create \
768
+ --name "Backend" \
769
+ --parent "/Engineering" \
770
+ --description "Backend Engineering Team"
771
+
772
+ gtypee workspace org create \
773
+ --name "Frontend" \
774
+ --parent "/Engineering" \
775
+ --description "Frontend Engineering Team"
776
+
777
+ gtypee workspace org create \
778
+ --name "DevOps" \
779
+ --parent "/Engineering" \
780
+ --description "DevOps Team"
781
+
782
+ # View the full org structure
783
+ gtypee workspace org list
784
+ ```
785
+
786
+ #### Moving Users Between Org Units
787
+
788
+ ```bash
789
+ # Move a user to a new org unit
790
+ gtypee workspace user set-org-unit \
791
+ --email user@company.com \
792
+ --org-unit "/Engineering/Backend"
793
+
794
+ # Bulk move users from CSV
795
+ cat users-to-move.csv | while read email org_unit; do
796
+ gtypee workspace user set-org-unit --email "$email" --org-unit "$org_unit"
797
+ done
798
+
799
+ # List all users in a specific org unit
800
+ gtypee workspace user list --org-unit "/Engineering" --json | jq '.[].primaryEmail'
801
+ ```
802
+
803
+ ### Device Management Scenarios
804
+
805
+ #### Device Inventory and Audit
806
+
807
+ ```bash
808
+ # List all ChromeOS devices
809
+ gtypee workspace device list --type chromebook --json > chromebooks.json
810
+
811
+ # List all mobile devices
812
+ gtypee workspace device list --type mobile --json > mobiles.json
813
+
814
+ # Find devices by org unit
815
+ gtypee workspace device list --org-unit "/Sales" --json | jq '.[]'
816
+
817
+ # Find devices not synced in 30 days
818
+ gtypee workspace device list --json | jq '.[] | select(.lastSync < "2026-01-21")'
819
+
820
+ # Export device inventory to CSV
821
+ gtypee workspace device list --json | jq -r '.[] | [.deviceId, .email, .modelName, .status, .orgUnitPath, .lastSync] | @csv' > devices.csv
822
+ ```
823
+
824
+ ### Gmail Automation Scenarios
825
+
826
+ #### Email Management
827
+
828
+ ```bash
829
+ # Find all unread emails from a sender
830
+ gtypee gmail search --query "from:newsletter@example.com is:unread" --json | jq '.messages[].id'
831
+
832
+ # Bulk archive old newsletters
833
+ gtypee gmail search --query "from:newsletter@example.com older_than:30d" --json | jq '.messages[].id' | while read id; do
834
+ gtypee gmail modify "$id" --remove-label INBOX
835
+ done
836
+
837
+ # Create labels for project organization
838
+ for project in alpha beta gamma; do
839
+ gtypee gmail label create --name "Project-$project" --color "#00ff00:#000000"
840
+ done
841
+
842
+ # Create filters for automatic labeling
843
+ gtypee gmail filter create \
844
+ --query "from:client@company.com" \
845
+ --add-label "Project-alpha"
846
+
847
+ # Export all filters for backup
848
+ gtypee gmail filter list --json > filters-backup.json
849
+ ```
850
+
851
+ #### Signature Management
852
+
853
+ ```bash
854
+ # Set standard signature for a user
855
+ gtypee gmail signature set \
856
+ --email user@company.com \
857
+ --signature "John Doe
858
+ Software Engineer
859
+ Company Inc.
860
+ Phone: +1-555-123-4567"
861
+
862
+ # List all signatures (requires admin access)
863
+ gtypee gmail signature list
864
+
865
+ # Update signature across multiple accounts
866
+ for email in $(cat users.txt); do
867
+ gtypee --impersonate "$email" gmail signature set \
868
+ --email "$email" \
869
+ --signature "$(cat standard-sig.txt)"
870
+ done
871
+ ```
872
+
873
+ ### Drive Management Scenarios
874
+
875
+ #### File Organization
876
+
877
+ ```bash
878
+ # Create folder structure
879
+ gtypee drive mkdir --name "2026 Projects" --parent root
880
+ gtypee drive mkdir --name "Q1 Reports" --parent "<2026-Projects-folder-id>"
881
+
882
+ # Find large files (>10MB)
883
+ gtypee drive search --query "mimeType != 'application/vnd.google-apps.folder'" --json | \
884
+ jq '.[] | select(.size > 10000000) | {name, size, id}'
885
+
886
+ # Find files shared externally
887
+ gtypee drive ls --json | jq '.[] | select(.shared == true) | {name, id}'
888
+
889
+ # Bulk download files by type
890
+ gtypee drive search --query "mimeType = 'application/pdf'" --json | jq '.[].id' | while read id; do
891
+ gtypee drive download --id "$id" --out "./pdfs/"
892
+ done
893
+
894
+ # Find and trash old files
895
+ gtypee drive search --query "modifiedTime < '2023-01-01'" --json | jq '.[].id' | while read id; do
896
+ gtypee drive delete "$id"
897
+ done
898
+ ```
899
+
900
+ #### Permission Auditing
901
+
902
+ ```bash
903
+ # List permissions for a file
904
+ gtypee drive permission list <file-id> --json
905
+
906
+ # Find files with public access
907
+ gtypee drive permission list <file-id> --json | jq '.[] | select(.type == "anyone")'
908
+
909
+ # Share a file with team
910
+ gtypee drive permission create <file-id> \
911
+ --email team@company.com \
912
+ --role reader \
913
+ --type group
914
+
915
+ # Remove external sharing
916
+ gtypee drive permission list <file-id> --json | jq '.[] | select(.type == "user" and .emailAddress | endswith("@competitor.com")) | .id' | while read perm_id; do
917
+ gtypee drive permission delete <file-id> --permission-id "$perm_id"
918
+ done
919
+ ```
920
+
921
+ ### Security and Compliance Scenarios
922
+
923
+ #### Login Audit and Security Review
924
+
925
+ ```bash
926
+ # Get login activities for past 30 days
927
+ gtypee workspace report logins --days 30 --json > login-audit.json
928
+
929
+ # Find failed login attempts
930
+ gtypee workspace report logins --days 30 --json | jq '.[] | select(.success == false)'
931
+
932
+ # Find logins from unusual locations
933
+ gtypee workspace report logins --days 7 --json | jq '.[] | select(.country != "US") | {userEmail, ipAddress, country, timestamp}'
934
+
935
+ # Find concurrent sessions
936
+ gtypee workspace report logins --days 1 --json | jq -r '.[] | select(.success == true) | .userEmail' | sort | uniq -c | awk '$1 > 5 {print}'
937
+ ```
938
+
939
+ #### Admin Activity Audit
940
+
941
+ ```bash
942
+ # Get admin activities for past 7 days
943
+ gtypee workspace report admin --days 7 --json > admin-audit.json
944
+
945
+ # Find user creation events
946
+ gtypee workspace report admin --days 30 --json | jq '.[] | select(.action == "CREATE_USER")'
947
+
948
+ # Find permission changes
949
+ gtypee workspace report admin --days 30 --json | jq '.[] | select(.action | contains("CHANGE") or contains("GRANT"))'
950
+
951
+ # Export audit log to CSV
952
+ gtypee workspace report admin --days 30 --json | jq -r '.[] | [.timestamp, .userEmail, .action, .resource] | @csv' > admin-audit.csv
953
+ ```
954
+
955
+ ### Cross-Service Workflows
956
+
957
+ #### New Hire Complete Setup
958
+
959
+ ```bash
960
+ #!/bin/bash
961
+ # new-hire.sh - Complete new hire setup script
962
+
963
+ EMAIL=$1
964
+ FIRST_NAME=$2
965
+ LAST_NAME=$3
966
+ ORG_UNIT=$4
967
+
968
+ # Create user
969
+ echo "Creating user $EMAIL..."
970
+ gtypee workspace user create \
971
+ --email "$EMAIL" \
972
+ --first-name "$FIRST_NAME" \
973
+ --last-name "$LAST_NAME" \
974
+ --org-unit "$ORG_UNIT" \
975
+ --change-password-next-login
976
+
977
+ # Wait for user propagation
978
+ sleep 10
979
+
980
+ # Add to All Staff group
981
+ gtypee workspace group add-member \
982
+ --group all-staff@company.com \
983
+ --email "$EMAIL"
984
+
985
+ # Add to department group based on org unit
986
+ if [[ "$ORG_UNIT" == *"/Engineering"* ]]; then
987
+ gtypee workspace group add-member --group engineering@company.com --email "$EMAIL"
988
+ elif [[ "$ORG_UNIT" == *"/Sales"* ]]; then
989
+ gtypee workspace group add-member --group sales@company.com --email "$EMAIL"
990
+ fi
991
+
992
+ # Create standard Drive folders
993
+ gtypee --impersonate "$EMAIL" drive mkdir --name "My Documents"
994
+ gtypee --impersonate "$EMAIL" drive mkdir --name "Projects"
995
+
996
+ # Set email signature
997
+ gtypee --impersonate "$EMAIL" gmail signature set \
998
+ --email "$EMAIL" \
999
+ --signature "$FIRST_NAME $LAST_NAME
1000
+ Company Inc.
1001
+ $EMAIL"
1002
+
1003
+ # Generate backup codes
1004
+ gtypee workspace user generate-backup-codes --email "$EMAIL"
1005
+
1006
+ echo "Setup complete for $EMAIL"
1007
+ ```
1008
+
1009
+ #### Daily Admin Report
1010
+
1011
+ ```bash
1012
+ #!/bin/bash
1013
+ # daily-report.sh - Generate daily admin report
1014
+
1015
+ REPORT_DATE=$(date +%Y-%m-%d)
1016
+ REPORT_FILE="admin-report-$REPORT_DATE.txt"
1017
+
1018
+ echo "=== Daily Admin Report - $REPORT_DATE ===" > "$REPORT_FILE"
1019
+ echo "" >> "$REPORT_FILE"
1020
+
1021
+ echo "--- User Stats ---" >> "$REPORT_FILE"
1022
+ TOTAL_USERS=$(gtypee workspace user list --json | jq 'length')
1023
+ SUSPENDED=$(gtypee workspace user list --json | jq '[.[] | select(.suspended == true)] | length')
1024
+ echo "Total Users: $TOTAL_USERS" >> "$REPORT_FILE"
1025
+ echo "Suspended: $SUSPENDED" >> "$REPORT_FILE"
1026
+ echo "" >> "$REPORT_FILE"
1027
+
1028
+ echo "--- Failed Logins (Last 24h) ---" >> "$REPORT_FILE"
1029
+ gtypee workspace report logins --days 1 --json | jq '.[] | select(.success == false) | " - \(.userEmail) from \(.ipAddress)"' >> "$REPORT_FILE"
1030
+ echo "" >> "$REPORT_FILE"
1031
+
1032
+ echo "--- Admin Actions (Last 24h) ---" >> "$REPORT_FILE"
1033
+ gtypee workspace report admin --days 1 --json | jq '.[] | " - \(.timestamp): \(.userEmail) - \(.action)"' >> "$REPORT_FILE"
1034
+
1035
+ echo "Report saved to $REPORT_FILE"
1036
+ ```
1037
+
1038
+ ### Scripting with JSON Output
1039
+
1040
+ #### Using jq for Filtering
1041
+
1042
+ ```bash
1043
+ # Get active users in Engineering
1044
+ gtypee workspace user list --json | jq '.[] | select(.suspended == false and .orgUnitPath == "/Engineering") | .primaryEmail'
1045
+
1046
+ # Count users by last name initial
1047
+ gtypee workspace user list --json | jq -r '.[].name.familyName' | cut -c1 | sort | uniq -c | sort -rn
1048
+
1049
+ # Find users with specific email domain
1050
+ gtypee workspace user list --json | jq '.[] | select(.primaryEmail | endswith("@engineering.company.com")) | .primaryEmail'
1051
+
1052
+ # Get user counts by org unit
1053
+ gtypee workspace user list --json | jq 'group_by(.orgUnitPath) | map({org: .[0].orgUnitPath, count: length}) | sort_by(-.count)'
1054
+
1055
+ # Extract email addresses for mail merge
1056
+ gtypee workspace user list --json | jq -r '.[] | select(.suspended == false) | "\(.name.givenName) \(.name.familyName),\(.primaryEmail)"' > mail-merge.csv
1057
+ ```
1058
+
1059
+ #### Using PowerShell (Windows)
1060
+
1061
+ ```powershell
1062
+ # Get all users and convert to PowerShell objects
1063
+ $users = gtypee workspace user list --json | ConvertFrom-Json
1064
+
1065
+ # Filter and display
1066
+ $users | Where-Object { $_.suspended -eq $false } | Select-Object primaryEmail, orgUnitPath
1067
+
1068
+ # Count by org unit
1069
+ $users | Group-Object orgUnitPath | Select-Object Name, Count | Sort-Object Count -Descending
1070
+
1071
+ # Export to CSV
1072
+ $users | Select-Object primaryEmail, @{N='FirstName';E={$_.name.givenName}}, @{N='LastName';E={$_.name.familyName}}, orgUnitPath, suspended | Export-Csv users.csv -NoTypeInformation
1073
+ ```
1074
+
1075
+ #### Using Python
1076
+
1077
+ ```python
1078
+ import subprocess
1079
+ import json
1080
+
1081
+ # Run gtypee command and parse JSON
1082
+ def gtypee_json(cmd):
1083
+ result = subprocess.run(f"gtypee {cmd} --json", shell=True, capture_output=True, text=True)
1084
+ return json.loads(result.stdout)
1085
+
1086
+ # Get all users
1087
+ users = gtypee_json("workspace user list")
1088
+
1089
+ # Filter active users in Engineering
1090
+ active_engineering = [
1091
+ u for u in users
1092
+ if not u.get('suspended', False) and u.get('orgUnitPath') == '/Engineering'
1093
+ ]
1094
+
1095
+ # Print emails
1096
+ for user in active_engineering:
1097
+ print(user['primaryEmail'])
1098
+
1099
+ # Group by org unit
1100
+ from collections import defaultdict
1101
+ by_org = defaultdict(list)
1102
+ for user in users:
1103
+ by_org[user.get('orgUnitPath', 'Unknown')].append(user['primaryEmail'])
1104
+
1105
+ for org, emails in sorted(by_org.items()):
1106
+ print(f"{org}: {len(emails)} users")
1107
+ ```
1108
+
1109
+ ---
1110
+
1111
+ ## JSON Output
1112
+
1113
+ All commands support `--json` for script-friendly output:
1114
+
1115
+ ```bash
1116
+ gtypee gmail list --json
1117
+ gtypee drive ls --json
1118
+ gtypee workspace user list --json
1119
+ ```
1120
+
1121
+ > **Important for Development:** If running from source, use the compiled version for JSON output:
1122
+ > ```bash
1123
+ > # CORRECT - clean JSON output
1124
+ > node dist/bin/gtypee.js workspace user list --json | jq '.[].primaryEmail'
1125
+ >
1126
+ > # WRONG - npm adds extra text that breaks JSON parsing
1127
+ > npm run dev -- workspace user list --json | jq
1128
+ > ```
1129
+
1130
+ Example output:
1131
+
1132
+ ```json
1133
+ {
1134
+ "messages": [
1135
+ {
1136
+ "id": "18f3a2b1c4d5e6f7",
1137
+ "threadId": "18f3a2b1c4d5e6f7",
1138
+ "subject": "Project Update"
1139
+ }
1140
+ ]
1141
+ }
1142
+ ```
1143
+
1144
+ Perfect for piping to `jq` or other tools:
1145
+
1146
+ ```bash
1147
+ gtypee gmail list --json | jq '.messages[].subject'
1148
+ gtypee workspace user list --json | jq '.[] | select(.suspended == false) | .primaryEmail'
1149
+ ```
1150
+
1151
+ ---
1152
+
1153
+ ## Configuration
1154
+
1155
+ ### Config File Location
1156
+
1157
+ | OS | Path |
1158
+ |----|------|
1159
+ | Windows | `%APPDATA%\typee\` |
1160
+ | macOS | `~/.config/gtypee/` |
1161
+ | Linux | `~/.config/gtypee/` |
1162
+
1163
+ ### Files
1164
+
1165
+ | File | Description |
1166
+ |------|-------------|
1167
+ | `credentials.json` | OAuth client credentials |
1168
+ | `credentials-<name>.json` | Named OAuth client (use with `--client`) |
1169
+ | `credentials.enc` | Encrypted stored tokens and service account keys |
1170
+
1171
+ ### Security
1172
+
1173
+ - Credentials are encrypted using AES-256-GCM with a machine-derived key
1174
+ - Never commit credentials or key files to version control
1175
+ - The `.gitignore` excludes `*-sa-key.json` patterns
1176
+
1177
+ ---
1178
+
1179
+ ## Development
1180
+
1181
+ ### Running from Source
1182
+
1183
+ ```bash
1184
+ # Clone and install
1185
+ git clone https://github.com/ejpespa/gtypee.git
1186
+ cd gtypee
1187
+ npm install
1188
+
1189
+ # Build the project
1190
+ npm run build
1191
+
1192
+ # Run the compiled CLI (RECOMMENDED)
1193
+ node dist/bin/gtypee.js --help
1194
+
1195
+ # Run in dev mode (for quick testing only)
1196
+ npm run dev -- --help
1197
+ ```
1198
+
1199
+ > **Pro Tip:** Create an alias for the compiled version to save typing:
1200
+ > ```bash
1201
+ > # Add to ~/.bashrc or ~/.zshrc
1202
+ > alias gtypee='node /path/to/gtypee/dist/bin/gtypee.js'
1203
+ > ```
1204
+
1205
+ ### npm Scripts
1206
+
1207
+ ```bash
1208
+ npm run build # Compile TypeScript to dist/
1209
+ npm run dev # Run with ts-node (dev mode)
1210
+ npm run typecheck # Type-check without emitting
1211
+ npm test # Run all tests
1212
+ npm run test:watch # Run tests in watch mode
1213
+ ```
1214
+
1215
+ ### Project Structure
1216
+
1217
+ ```
1218
+ src/
1219
+ cmd/ # Command definitions
1220
+ gmail/commands.ts # Gmail commands
1221
+ drive/commands.ts # Drive commands
1222
+ calendar/commands.ts # Calendar commands
1223
+ workspace/commands.ts # Workspace admin commands
1224
+ auth/commands.ts # Authentication commands
1225
+ ...
1226
+ googleapi/ # Google API client wrappers
1227
+ googleauth/ # Authentication handling
1228
+ outfmt/ # Output formatting
1229
+ ```
1230
+
1231
+ ---
1232
+
1233
+ ## Contributing
1234
+
1235
+ Contributions are welcome! Please feel free to submit a [Pull Request](https://github.com/ejpespa/gtypee/pulls).
1236
+
1237
+ ### Development Setup
1238
+
1239
+ ```bash
1240
+ git clone https://github.com/ejpespa/gtypee.git
1241
+ cd gtypee
1242
+ npm install
1243
+ npm run build
1244
+ npm test
1245
+ ```
1246
+
1247
+ ### Commit Convention
1248
+
1249
+ This project uses [Conventional Commits](https://www.conventionalcommits.org/) for automatic versioning:
1250
+
1251
+ | Commit Type | Version Impact | Example |
1252
+ |-------------|----------------|---------|
1253
+ | `feat:` | Minor (1.0.0 → 1.1.0) | `feat: add user export command` |
1254
+ | `fix:` | Patch (1.0.0 → 1.0.1) | `fix: resolve pagination issue` |
1255
+ | `feat!:` or `BREAKING CHANGE:` | Major (1.0.0 → 2.0.0) | `feat!: redesign CLI structure` |
1256
+ | `docs:`, `chore:`, `refactor:` | No release | `docs: update README` |
1257
+
1258
+ ```bash
1259
+ # Examples
1260
+ git commit -m "feat: add workspace device wipe command" # → Minor bump
1261
+ git commit -m "fix: handle empty email body" # → Patch bump
1262
+ git commit -m "feat!: change API response format" # → Major bump
1263
+ git commit -m "docs: add usage examples" # → No release
1264
+ ```
1265
+
1266
+ ### Pull Request Process
1267
+
1268
+ 1. Fork the repository
1269
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
1270
+ 3. Make your changes and add tests
1271
+ 4. Commit using conventional format (`git commit -m "feat: add amazing feature"`)
1272
+ 5. Push to the branch (`git push origin feature/amazing-feature`)
1273
+ 6. Open a Pull Request
1274
+ 7. Ensure CI tests pass
1275
+ 8. After merge, release happens automatically! 🚀
1276
+
1277
+ ---
1278
+
1279
+ ## Supported Services
1280
+
1281
+ | Service | API | Personal Account | Workspace (SA) |
1282
+ |---------|-----|:---:|:---:|
1283
+ | Gmail | Gmail API | Yes | Yes |
1284
+ | Calendar | Calendar API | Yes | Yes |
1285
+ | Drive | Drive API | Yes | Yes |
1286
+ | Docs | Docs API + Drive API | Yes | Yes |
1287
+ | Sheets | Sheets API + Drive API | Yes | Yes |
1288
+ | Slides | Slides API + Drive API | Yes | Yes |
1289
+ | Tasks | Tasks API | Yes | Yes |
1290
+ | Forms | Forms API | Yes | Yes |
1291
+ | Contacts | People API | Yes | Yes |
1292
+ | People | People API | Yes | Yes |
1293
+ | Chat | Chat API | Yes | Yes |
1294
+ | Classroom | Classroom API | Yes | Yes |
1295
+ | Apps Script | Apps Script API + Drive API | Yes | Yes |
1296
+ | Groups | Admin SDK Directory API | No | Yes |
1297
+ | Keep | Keep API | No | Yes |
1298
+ | Workspace Admin | Admin SDK API | No | Yes |
1299
+
1300
+ ---
1301
+
1302
+ ## Tips & Troubleshooting
1303
+
1304
+ ### Most Common Issue: npm Output Breaks JSON Parsing
1305
+
1306
+ If you see `jq: parse error: Invalid numeric literal at line 2, column 2`:
1307
+
1308
+ ```bash
1309
+ # PROBLEM: npm adds header text to output
1310
+ npm run dev -- workspace user list --json | jq '.[].primaryEmail'
1311
+ # Output: > gtypee@1.0.0 dev
1312
+ # > ts-node src/bin/gtypee.ts "--impersonate" ...
1313
+ # jq: parse error: Invalid numeric literal...
1314
+
1315
+ # SOLUTION 1: Use the compiled version
1316
+ npm run build
1317
+ node dist/bin/gtypee.js workspace user list --json | jq '.[].primaryEmail'
1318
+
1319
+ # SOLUTION 2: Output to file first, then process
1320
+ npm run dev -- workspace user list --json > output.json
1321
+ jq '.[].primaryEmail' output.json
1322
+
1323
+ # SOLUTION 3: Create an alias to the compiled version
1324
+ alias gtypee='node /path/to/gtypee/dist/bin/gtypee.js'
1325
+ gtypee workspace user list --json | jq '.[].primaryEmail'
1326
+ ```
1327
+
1328
+ ### Common Issues
1329
+
1330
+ #### "Auth required" Error
1331
+
1332
+ ```bash
1333
+ # Check current auth status
1334
+ gtypee auth status
1335
+
1336
+ # For workspace admin, ensure you're using service account with impersonation
1337
+ gtypee --sa your-sa@project.iam.gserviceaccount.com --impersonate admin@domain.com workspace user list
1338
+
1339
+ # For personal accounts, re-authenticate
1340
+ gtypee auth add --email you@gmail.com
1341
+ ```
1342
+
1343
+ #### Insufficient Permissions / Scope Errors
1344
+
1345
+ Make sure the required APIs are enabled in Google Cloud Console and the correct scopes are authorized:
1346
+
1347
+ - **Personal accounts**: Enable APIs in [API Library](https://console.cloud.google.com/apis/library)
1348
+ - **Service accounts**: Add scopes in [Admin Console > Security > API Controls > Domain Wide Delegation](https://admin.google.com/ac/owl)
1349
+
1350
+ See [Authentication](#authentication) section for full scope lists.
1351
+
1352
+ #### jq Not Found (Windows)
1353
+
1354
+ Install jq using one of these methods:
1355
+
1356
+ ```bash
1357
+ # Using winget
1358
+ winget install stedolan.jq
1359
+
1360
+ # Using chocolatey
1361
+ choco install jq
1362
+
1363
+ # Using scoop
1364
+ scoop install jq
1365
+
1366
+ # Or use PowerShell's ConvertFrom-Json instead of jq
1367
+ node dist/bin/gtypee.js workspace user list --json | ConvertFrom-Json | Select-Object -ExpandProperty primaryEmail
1368
+ ```
1369
+
1370
+ ### Performance Tips
1371
+
1372
+ #### Large User Lists
1373
+
1374
+ ```bash
1375
+ # Use --json and filter with jq for large datasets
1376
+ gtypee workspace user list --json | jq '.[] | select(.suspended == false) | .primaryEmail'
1377
+
1378
+ # Or redirect to file first
1379
+ gtypee workspace user list --json > users.json
1380
+ jq '.[] | .primaryEmail' users.json
1381
+ ```
1382
+
1383
+ #### Batch Operations
1384
+
1385
+ ```bash
1386
+ # Process in parallel with xargs
1387
+ gtypee workspace user list --json | jq -r '.[].primaryEmail' | xargs -P 4 -I {} gtypee workspace user generate-backup-codes --email "{}"
1388
+
1389
+ # Or use a shell script with proper error handling
1390
+ for email in $(cat users.txt); do
1391
+ echo "Processing $email..."
1392
+ gtypee workspace user set-org-unit --email "$email" --org-unit "/NewOU" || echo "Failed: $email"
1393
+ done
1394
+ ```
1395
+
1396
+ ### Useful Aliases
1397
+
1398
+ Add these to your `.bashrc` or `.zshrc`:
1399
+
1400
+ ```bash
1401
+ # Point to your gtypee installation (if running from source)
1402
+ export GTYPEE_PATH="/path/to/gtypee/dist/bin/gtypee.js"
1403
+
1404
+ # Base alias for compiled version
1405
+ alias gtypee="node $GTYPEE_PATH"
1406
+
1407
+ # Workspace admin with service account (UPDATE THESE VALUES!)
1408
+ alias twa='node /path/to/gtypee/dist/bin/gtypee.js --sa your-sa@project.iam.gserviceaccount.com --impersonate admin@yourdomain.com'
1409
+
1410
+ # Quick JSON + jq combos
1411
+ alias tj-users='node /path/to/gtypee/dist/bin/gtypee.js workspace user list --json | jq'
1412
+ alias tj-groups='node /path/to/gtypee/dist/bin/gtypee.js workspace group list --json | jq'
1413
+
1414
+ # Common queries
1415
+ alias active-users='twa workspace user list --json | jq ".[] | select(.suspended == false) | .primaryEmail"'
1416
+ alias suspended-users='twa workspace user list --json | jq ".[] | select(.suspended == true) | .primaryEmail"'
1417
+ alias admin-users='twa workspace user list --json | jq ".[] | select(.isAdmin == true) | .primaryEmail"'
1418
+ alias count-users='twa workspace user list --json | jq "length"'
1419
+ alias failed-logins='twa workspace report logins --days 1 --json | jq ".[] | select(.success == false)"'
1420
+ alias recent-admin-actions='twa workspace report admin --days 1 --json | jq ".[].action" | sort | uniq -c'
1421
+ ```
1422
+
1423
+ ## Acknowledgements
1424
+
1425
+ This project was inspired by these excellent Google CLI tools:
1426
+
1427
+ - [gogcli](https://github.com/steipete/gogcli) - Google CLI by steipete
1428
+ - [gmcli](https://github.com/badlogic/gmcli) - Gmail CLI by badlogic
1429
+ - [gccli](https://github.com/badlogic/gccli) - Google Calendar CLI by badlogic
1430
+ - [gdcli](https://github.com/badlogic/gdcli) - Google Drive CLI by badlogic
1431
+
1432
+ ## License
1433
+
1434
+ ISC
1435
+
1436
+ ---
1437
+
1438
+ ## Links
1439
+
1440
+ - [GitHub Repository](https://github.com/ejpespa/gtypee)
1441
+ - [npm Package](https://www.npmjs.com/package/gtypee)
1442
+ - [Report Issues](https://github.com/ejpespa/gtypee/issues)