Skip to main content
The GCS resource mounts a Google Cloud Storage bucket at some prefix such as /gcs/. All operations involve network I/O to the remote object store. Uses aioboto3 against GCS’s S3-compatible XML API via HMAC keys, inheriting all S3 resource capabilities. For credential setup, see GCS Setup.

Config

GCSResource(config) takes a GCSConfig object with the bucket name and HMAC credentials. Both READ and WRITE modes are supported.

Filesystem Layout

The GCS resource maps object keys to virtual paths under the mount prefix, identical to the S3 resource. GCS “directories” are prefix-based — there are no real directory objects. For example, if bucket mirage-ai contains:
Then mounting at /gcs/ exposes:
Path mapping: virtual /gcs/data/example.json maps to GCS key data/example.json.

Cache

The GCS resource uses IndexCacheStore with index_ttl = 600 (10 minutes), same as S3. Directory listings are cached for up to 600 seconds before being refreshed from GCS. This reduces API calls for repeated directory traversals.

Example

Shell Commands

The GCS resource supports the full set of shell commands since it operates on real file content (text, binary, JSON, CSV, etc.). Large files benefit from range reads to avoid downloading entire objects.

Read Commands

Text Processing

File Operations

Path Utilities

Compression

Encoding

Data Format Support

Commands with format-specific variants for structured data files: These variants auto-detect the format by extension and convert to tabular text (CSV) for processing.

Use Cases

  • AI agents accessing GCS data: Mount GCS buckets for agents to read and process datasets
  • Data pipelines: Read and write GCS objects with shell-like commands
  • FUSE mounting: Expose GCS buckets through a virtual FUSE mount for external tools