read_when:
- Auditing Drive folder contents, size, or inventory without changing files.
- Reviewing
drive tree,drive du,drive inventory, or permission audits.
Drive audit commands are read-only reporting helpers. They are meant for cleanup planning, migration review, and automation that needs stable JSON without writing back to Drive.
gog drive treegog drive dugog drive inventorygog drive audit sharinggog drive audit usergog drive lsgog drive getgog drive raw
Print a readable folder tree:
gog drive tree --parent <folderId> --depth 2Use JSON when another tool should consume the result:
gog drive tree --parent <folderId> --depth 3 --jsonSummarize folder sizes:
gog drive du --parent <folderId> --max 20
gog drive du --parent <folderId> --depth 2 --sort size --jsondrive du counts files under folders and sorts by size, path, or files.
Export a read-only item inventory:
gog drive inventory --parent <folderId> --json
gog drive inventory --parent <folderId> --max 0 --depth 0 --json > drive-inventory.jsonUse inventory output when you need a machine-readable list of Drive objects for review, diffing, or downstream cleanup scripts.
Find public or external shares without changing files:
gog drive audit sharing --parent <folderId> --internal-domain example.com --json
gog drive audit sharing --parent <folderId> --public-only --fail-foundFind files shared with a specific user:
gog drive audit user clawdbot@gmail.com --parent <folderId> --jsonBulk permission operations are intentionally separate from audits and require a dry run or confirmation:
gog drive bulk remove-public --parent <folderId> --dry-run
gog drive bulk update-role --parent <folderId> --from writer --to reader --target contractor@example.com --dry-runThe audit commands include shared drives by default where the underlying Drive
API supports it. Pass --no-all-drives to restrict a scan to My Drive:
gog drive inventory --parent root --no-all-drives --jsonFor object-level inspection, use drive get --fields:
gog drive get <fileId> --fields 'id,name,mimeType,size,owners,emailAddress' --jsonUse gog drive raw when you need the raw Drive API
object, with the sensitive-field behavior described in Raw API Dumps.