Registry / gcp / gws-with-audit-log

gws-with-audit-log

JSON →
library0.0.5jsnpmunverified

A CLI tool for interacting with Google Workspace APIs (Gmail, Drive, Calendar, etc.) with built-in audit logging. Current stable version is v0.22.5. Released as part of the googleworkspace/cli project with regular releases every 1-2 weeks. Key differentiators: dynamic command surface generated from Google Discovery Service, audit log support for tracking commands, prebuilt binaries with native OS keychain integration. ESM-only via npm package or direct binary download.

npm install gws-with-audit-log
INSTALL
IMPORT
SIG · GWS-WITH-AUDIT-LOG
G
gws-with-audit-log
gcpjavascriptv0.0.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gws
import gws from 'gws-with-audit-log'
const gws = require('gws-with-audit-log')
ESM-only since v0.22.4. CJS require() will fail.
GwsClient
import { GwsClient } from 'gws-with-audit-log'
import GwsClient from 'gws-with-audit-log'
Named export for programmatic use.
AuditLog
import { AuditLog } from 'gws-with-audit-log'
const AuditLog = require('gws-with-audit-log').AuditLog
Audit logging module for tracking CLI commands.

Shows authentication, sending an email via Gmail API, and enabling audit logging.

import gws from 'gws-with-audit-log'; // Authenticate with Google Workspace await gws.auth.login({ clientId: process.env.GOOGLE_CLIENT_ID ?? '', clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? '', scopes: ['https://www.googleapis.com/auth/gmail.send'] }); // Send an email with audit log const result = await gws.gmail.send({ to: 'user@example.com', subject: 'Hello', body: 'Test email', auditLog: true }); console.log('Sent message ID:', result.id);
gws --version
Debug
Known issues
gotchaRequires Node >=14 and ESM imports. Do not use require().
fix
Use import syntax and Node >=14.
affects: >=0.22.4
breakingv0.22.0 changed the --draft flag behavior for Gmail helpers. Existing scripts may send emails immediately if not updated.
fix
Add --draft flag explicitly if saving drafts is intended.
affects: >=0.22.0
breakingv0.18.0 introduced auto-population of From header with display name. May change sender display unexpectedly.
fix
Use --from with explicit display name to override.
affects: >=0.18.0
breakingv0.22.3 removed fallback .encryption_key file on macOS/Windows. Credentials cannot be decrypted if keychain fails.
fix
Ensure native OS keychain is available and not corrupted.
affects: >=0.22.3
deprecatedAudit logging flags may change in future versions. Currently experimental.
fix
Watch release notes for stabilization.
affects: >=0.0.5
Errors
Common errors & fixes
TypeError: gws.auth.login is not a function
Using require() instead of import, or wrong import path.
fix
Use: import gws from 'gws-with-audit-log' (ESM only)
Error: [gws] No credentials found. Run 'gws auth login' first.
Missing OAuth tokens; --audit-log requires prior authentication.
fix
Run: gws auth login with required scopes
SyntaxError: Cannot use import statement outside a module
Node.js project not configured for ESM.
fix
Add "type": "module" to package.json or use .mjs extension.
gws: command not found
Binary not installed or not in PATH after npm install.
fix
Install globally: npm install -g gws-with-audit-log
Upgrade
Version history
0.0.5latest on npm
Audit
Dependencies
noderequiredRequired runtime for npm installation (>=14)
Agent activity
22 hits · last 30 days
node
18
OpenAI (training)
1
Resources
gws-with-audit-log — npm install gws-with-audit-log · libregistry