gtypee 1.0.2

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