Google Cloud Storage
Work with Google Cloud Storage buckets and objects with the same functions as S3: list, upload, download, copy, delete and signed URLs. Typical uses: archive exports in Google Cloud, read files dropped by a Google service.
gcs pinggcs bucket_creategcs bucket_creategcs bucketsgcs bucketsgcs putgcs putgcs put_textgcs put_textgcs listgcs listgcs getgcs getgcs get_textgcs get_textgcs headgcs copygcs deletegcs delete_manygcs presigngcs presigngcs bucket_drop
gcs ping <config>
Description
Test the endpoint and the credentials (lists one bucket of the project). Returns {ok, project_id, endpoint}
Test the endpoint and the credentials (lists one bucket of the project). Returns {ok, project_id, endpoint}
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
admin
gcs ping "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}"
mentdb
{"ok": true, "project_id": "demo", "endpoint": "127.0.0.1:4443"}
gcs bucket_create <config> <bucket>
Description
Create a bucket in the project. Returns {created, existed}
Create a bucket in the project. Returns {created, existed}
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
admin
gcs bucket_create "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports"
mentdb
{"created": "reports", "existed": false}
gcs bucket_create <config> <bucket> <json_params>
Description
Create a bucket with parameters: location (US by default at Google, EU, europe-west1...), storage_class (STANDARD, NEARLINE, COLDLINE, ARCHIVE), exist_ok (false; true: an existing bucket is not an error)
Create a bucket with parameters: location (US by default at Google, EU, europe-west1...), storage_class (STANDARD, NEARLINE, COLDLINE, ARCHIVE), exist_ok (false; true: an existing bucket is not an error)
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
json_params: The parameters - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
json_params: The parameters - String - required
admin
gcs bucket_create "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "{\"exist_ok\": true}"
mentdb
{"created": "reports", "existed": true}
in Europe (the emulator ignores the location) (fixed result: real fake-gcs-server 1.56.1, a Google Cloud Storage emulator)
admin
gcs bucket_create "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "archive" "{\"location\": \"EU\", \"storage_class\": \"STANDARD\"}"
mentdb
{"created": "archive", "existed": false}
gcs buckets <config>
Description
List the buckets of the project: rows {name, location, storage_class, created}
List the buckets of the project: rows {name, location, storage_class, created}
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
admin
gcs buckets "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}"
mentdb
[{"name": "archive", "location": "US-CENTRAL1", "storage_class": "STANDARD", "created": "2026-11-17T16:15:42Z"}, {"name": "reports", "location": "US-CENTRAL1", "storage_class": "STANDARD", "created": "2026-11-17T16:15:42Z"}]
gcs buckets <config> <json_params>
Description
List the buckets with parameters: prefix, limit (1000, 100000 at most)
List the buckets with parameters: prefix, limit (1000, 100000 at most)
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
json_params: The parameters - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
json_params: The parameters - String - required
admin
gcs buckets "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "{\"prefix\": \"rep\"}"
mentdb
[{"name": "reports", "location": "US-CENTRAL1", "storage_class": "STANDARD", "created": "2026-11-17T16:15:42Z"}]
gcs put <config> <bucket> <key> <file_path>
Description
Upload a file in streaming (multipart, resumable beyond 64 MB). Returns {etag, size}
Upload a file in streaming (multipart, resumable beyond 64 MB). Returns {etag, size}
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
file_path: The local file (same access rules as the other file functions) - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
file_path: The local file (same access rules as the other file functions) - String - required
admin
gcs put "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "2026/sales.csv" "tmp/sales.csv"
mentdb
{"etag": "FHqlFCHSbCZfuOVMyOE0LA==", "size": 22}
gcs put <config> <bucket> <key> <file_path> <json_params>
Description
Upload with parameters: content_type (application/octet-stream), metadata (object of names and printable ASCII values), storage_class, multipart_threshold (64 MB, 1 MB at least), part_size (the chunk of the resumable upload, 16 MB, from 1 MB to 5 GB, rounded down to 256 KB)
Upload with parameters: content_type (application/octet-stream), metadata (object of names and printable ASCII values), storage_class, multipart_threshold (64 MB, 1 MB at least), part_size (the chunk of the resumable upload, 16 MB, from 1 MB to 5 GB, rounded down to 256 KB)
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
file_path: The local file (same access rules as the other file functions) - String - required
json_params: The parameters - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
file_path: The local file (same access rules as the other file functions) - String - required
json_params: The parameters - String - required
admin
gcs put "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "2026/sales2.csv" "tmp/sales.csv" "{\"content_type\": \"text/csv\", \"metadata\": {\"owner\": \"finance\"}}"
mentdb
{"etag": "FHqlFCHSbCZfuOVMyOE0LA==", "size": 22}
resumable in chunks of 2 MB (a file of 5.5 MB) (fixed result: real fake-gcs-server 1.56.1, a Google Cloud Storage emulator)
admin
gcs put "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "2026/big.bin" "tmp/big.bin" "{\"multipart_threshold\": 1048576, \"part_size\": 2097152}"
mentdb
{"etag": "3X3vw3sqcf/h2iHDVka+mA==", "size": 5500000}
gcs put_text <config> <bucket> <key> <text>
Description
Upload a text in UTF-8 (256 MB at most), text/plain; charset=utf-8 by default. Returns {etag, size}
Upload a text in UTF-8 (256 MB at most), text/plain; charset=utf-8 by default. Returns {etag, size}
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
text: The text - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
text: The text - String - required
admin
gcs put_text "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "readme.txt" "Résumé 2026"
mentdb
{"etag": "cV0ojlOF/ru2Ohpxg+J02Q==", "size": 13}
gcs put_text <config> <bucket> <key> <text> <json_params>
Description
Upload a text with parameters: content_type, metadata, storage_class
Upload a text with parameters: content_type, metadata, storage_class
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
text: The text - String - required
json_params: The parameters - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
text: The text - String - required
json_params: The parameters - String - required
admin
gcs put_text "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "state.json" "{}" "{\"content_type\": \"application/json\"}"
mentdb
{"etag": "mZFLkyvTelC5g8XnyQrpOw==", "size": 2}
gcs list <config> <bucket>
Description
List the objects of a bucket: rows {key, size, last_modified, etag, content_type, storage_class}, 1000 rows at most (see the parameters)
List the objects of a bucket: rows {key, size, last_modified, etag, content_type, storage_class}, 1000 rows at most (see the parameters)
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
admin
gcs list "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports"
mentdb
[{"key": "2026/big.bin", "size": 5500000, "last_modified": "2026-11-17T16:15:42Z", "etag": "3X3vw3sqcf/h2iHDVka+mA==", "content_type": "application/octet-stream", "storage_class": "STANDARD"}, {"key": "2026/sales.csv", "size": 22, "last_modified": "2026-11-17T16:15:42Z", "etag": "FHqlFCHSbCZfuOVMyOE0LA==", "content_type": "application/octet-stream", "storage_class": "STANDARD"}, {"key": "2026/sales2.csv", "size": 22, "last_modified": "2026-11-17T16:15:42Z", "etag": "FHqlFCHSbCZfuOVMyOE0LA==", "content_type": "text/csv", "storage_class": "STANDARD"}, {"key": "readme.txt", "size": 13, "last_modified": "2026-11-17T16:15:42Z", "etag": "cV0ojlOF/ru2Ohpxg+J02Q==", "content_type": "text/plain; charset=utf-8", "storage_class": "STANDARD"}, {"key": "state.json", "size": 2, "last_modified": "2026-11-17T16:15:42Z", "etag": "mZFLkyvTelC5g8XnyQrpOw==", "content_type": "application/json", "storage_class": "STANDARD"}]
gcs list <config> <bucket> <json_params>
Description
List with parameters: prefix, delimiter (the result becomes {rows, prefixes, truncated}: the folders of the level), limit (1000, 100000 at most; the page tokens are followed)
List with parameters: prefix, delimiter (the result becomes {rows, prefixes, truncated}: the folders of the level), limit (1000, 100000 at most; the page tokens are followed)
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
json_params: The parameters - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
json_params: The parameters - String - required
admin
gcs list "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "{\"prefix\": \"2026/\", \"limit\": 2}"
mentdb
[{"key": "2026/big.bin", "size": 5500000, "last_modified": "2026-11-17T16:15:42Z", "etag": "3X3vw3sqcf/h2iHDVka+mA==", "content_type": "application/octet-stream", "storage_class": "STANDARD"}, {"key": "2026/sales.csv", "size": 22, "last_modified": "2026-11-17T16:15:42Z", "etag": "FHqlFCHSbCZfuOVMyOE0LA==", "content_type": "application/octet-stream", "storage_class": "STANDARD"}]
the folders with a delimiter (fixed result: real fake-gcs-server 1.56.1, a Google Cloud Storage emulator)
admin
gcs list "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "{\"delimiter\": \"/\"}"
mentdb
{"rows": [{"key": "readme.txt", "size": 13, "last_modified": "2026-11-17T16:15:42Z", "etag": "cV0ojlOF/ru2Ohpxg+J02Q==", "content_type": "text/plain; charset=utf-8", "storage_class": "STANDARD"}, {"key": "state.json", "size": 2, "last_modified": "2026-11-17T16:15:42Z", "etag": "mZFLkyvTelC5g8XnyQrpOw==", "content_type": "application/json", "storage_class": "STANDARD"}], "prefixes": ["2026/"], "truncated": false}
a public bucket of Google (fixed result: real Google Cloud Storage, a public bucket read without an account)
admin
gcs list "{}" "gcp-public-data-landsat" "{\"prefix\": \"LC08/01/044/034/\", \"delimiter\": \"/\", \"limit\": 2}"
mentdb
{"rows": [], "prefixes": ["LC08/01/044/034/LC08_L1GT_044034_20130330_20170310_01_T2/", "LC08/01/044/034/LC08_L1GT_044034_20130330_20180201_01_T2/"], "truncated": true}
gcs get <config> <bucket> <key> <file_path>
Description
Download an object in streaming to a temporary file of the same folder, renamed at the end (no partial file on a failure; an existing file keeps its POSIX permissions). Returns {file, size, etag, content_type, last_modified}
Download an object in streaming to a temporary file of the same folder, renamed at the end (no partial file on a failure; an existing file keeps its POSIX permissions). Returns {file, size, etag, content_type, last_modified}
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
file_path: The local file (same access rules as the other file functions) - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
file_path: The local file (same access rules as the other file functions) - String - required
admin
gcs get "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "2026/big.bin" "tmp/big_copy.bin"
mentdb
{"file": "tmp/big_copy.bin", "size": 5500000, "etag": "3X3vw3sqcf/h2iHDVka+mA==", "content_type": "application/octet-stream", "last_modified": "2026-11-17T16:15:42Z"}
gcs get <config> <bucket> <key> <file_path> <json_params>
Description
Download with parameters: range (bytes=0-9, bytes=100- or bytes=-500), max_bytes (100 GB)
Download with parameters: range (bytes=0-9, bytes=100- or bytes=-500), max_bytes (100 GB)
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
file_path: The local file (same access rules as the other file functions) - String - required
json_params: The parameters - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
file_path: The local file (same access rules as the other file functions) - String - required
json_params: The parameters - String - required
admin
gcs get "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "2026/sales.csv" "tmp/tail.csv" "{\"range\": \"bytes=-6\"}"
mentdb
{"file": "tmp/tail.csv", "size": 6, "etag": "FHqlFCHSbCZfuOVMyOE0LA==", "content_type": "application/octet-stream", "last_modified": "2026-11-17T16:15:42Z"}
the first 100 bytes of a public object of 767 MB (fixed result: real Google Cloud Storage, a public bucket read without an account)
admin
gcs get "{}" "gcp-public-data-landsat" "index.csv.gz" "tmp/landsat_head.bin" "{\"range\": \"bytes=0-99\"}"
mentdb
{"file": "tmp/landsat_head.bin", "size": 100, "etag": "CNTN1e25v/UCEAE=", "content_type": "text/csv", "last_modified": "2022-01-20T04:05:43Z"}
gcs get_text <config> <bucket> <key>
Description
Read an object as UTF-8 text, 10 MB at most (an error if larger, or if it is not valid UTF-8: use gcs get)
Read an object as UTF-8 text, 10 MB at most (an error if larger, or if it is not valid UTF-8: use gcs get)
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
admin
gcs get_text "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "readme.txt"
mentdb
Résumé 2026
gcs get_text <config> <bucket> <key> <json_params>
Description
Read a text with parameters: max_bytes (10 MB, 256 MB at most)
Read a text with parameters: max_bytes (10 MB, 256 MB at most)
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
json_params: The parameters - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
json_params: The parameters - String - required
admin
gcs get_text "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "readme.txt" "{\"max_bytes\": 1024}"
mentdb
Résumé 2026
gcs head <config> <bucket> <key>
Description
Information about an object: {exists, size, etag, content_type, last_modified, storage_class, md5, generation, metadata}. A missing object gives {exists: false}; a missing bucket is an error
Information about an object: {exists, size, etag, content_type, last_modified, storage_class, md5, generation, metadata}. A missing object gives {exists: false}; a missing bucket is an error
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
admin
gcs head "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "2026/sales2.csv"
mentdb
{"exists": true, "size": 22, "etag": "FHqlFCHSbCZfuOVMyOE0LA==", "content_type": "text/csv", "last_modified": "2026-11-17T16:15:42Z", "storage_class": "STANDARD", "md5": "FHqlFCHSbCZfuOVMyOE0LA==", "generation": "1794932142313847", "metadata": {"owner": "finance"}}
no such object (fixed result: real fake-gcs-server 1.56.1, a Google Cloud Storage emulator)
admin
gcs head "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "nothing"
mentdb
{"exists": false}
a public object (fixed result: real Google Cloud Storage, a public bucket read without an account)
admin
gcs head "{}" "gcp-public-data-landsat" "index.csv.gz"
mentdb
{"exists": true, "size": 767466786, "etag": "CNTN1e25v/UCEAE=", "content_type": "text/csv", "last_modified": "2022-01-20T04:05:43Z", "storage_class": "STANDARD", "md5": "EivGmzgsUzAdL6zmtp0zRw==", "generation": "1642651542972116", "metadata": {}}
gcs copy <config> <src_bucket> <src_key> <dst_bucket> <dst_key>
Description
Copy an object on the server side (rewrite: the rewrite tokens of a large copy are followed). Returns {etag, last_modified}
Copy an object on the server side (rewrite: the rewrite tokens of a large copy are followed). Returns {etag, last_modified}
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
src_bucket: The source bucket - String - required
src_key: The source object - String - required
dst_bucket: The target bucket - String - required
dst_key: The target object - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
src_bucket: The source bucket - String - required
src_key: The source object - String - required
dst_bucket: The target bucket - String - required
dst_key: The target object - String - required
admin
gcs copy "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "readme.txt" "reports" "2026/readme_copy.txt"
mentdb
{"etag": "cV0ojlOF/ru2Ohpxg+J02Q==", "last_modified": "2026-11-17T16:15:43Z"}
gcs delete <config> <bucket> <key>
Description
Delete an object. Returns 1, or 0 when the object does not exist (a missing bucket is an error)
Delete an object. Returns 1, or 0 when the object does not exist (a missing bucket is an error)
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
admin
gcs delete "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "state.json"
mentdb
1
no such object (fixed result: real fake-gcs-server 1.56.1, a Google Cloud Storage emulator)
admin
gcs delete "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "nothing.json"
mentdb
0
gcs delete_many <config> <bucket> <json_keys>
Description
Delete a list of objects (100000 at most), one request per object. Returns {deleted, errors}: deleted counts the objects really deleted, a missing object is not an error (a missing bucket is), an error of GCS on an object does not stop the others
Delete a list of objects (100000 at most), one request per object. Returns {deleted, errors}: deleted counts the objects really deleted, a missing object is not an error (a missing bucket is), an error of GCS on an object does not stop the others
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
json_keys: The object names as a JSON array - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
json_keys: The object names as a JSON array - String - required
admin
gcs delete_many "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "reports" "[\"2026/big.bin\", \"2026/sales2.csv\"]"
mentdb
{"deleted": 2, "errors": []}
gcs presign <config> <bucket> <key>
Description
A V4 signed GET URL (1 hour), signed with the key of the service account without any network call. The URL gives access to whoever has it
A V4 signed GET URL (1 hour), signed with the key of the service account without any network call. The URL gives access to whoever has it
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
admin
gcs presign "{\"credentials_file\": \"tmp/gcs-sa.json\"}" "test-bucket" "test-object"
mentdb
https://storage.googleapis.com/test-bucket/test-object?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=test-iam-credentials%40dummy-project-id.iam.gserviceaccount.com%2F20261117%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20261117T161544Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=host&X-Goog-Signature=6117e3f4fcc06ee8e4a8c062b483770e4ca5cd9d728aaf3cbfb57f6b2736034c96837d7eaf6fbe2c97a296cd920e0b42b079309beb973437aef84d67b9714149ef704973ef3686c3cd97ca7d321767bf5988c126afcd378acfa62a36208881e7bb4b040a16ffaf60afe1a79598f75c90c46069997569705e207de18a86d2ca6d1def95ac07e87b77d1c8b173a026dea2a32bfe1985453db8a2eec8cc2a4096862534f69c226b914da3c80c363dfd0d298acb5d3baf941d1bc711b8926b695508beef1ceb54045a41eb79a1c9762580d2675fcb784676da1b24824d5f560f81fc6cba35b8bc4cb175f15f278c92e640b385d62e20b14875403a283b92be165cb1
gcs presign <config> <bucket> <key> <json_params>
Description
A signed URL with parameters: method (GET or PUT), expires_in (seconds, 3600, 604800 at most), now (a fixed date, for tests: 20261117T100000Z or 2026-11-17T10:00:00Z)
A signed URL with parameters: method (GET or PUT), expires_in (seconds, 3600, 604800 at most), now (a fixed date, for tests: 20261117T100000Z or 2026-11-17T10:00:00Z)
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
json_params: The parameters - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
key: The name of the object (1 to 1024 bytes in UTF-8; no . or .. segment, not under .well-known/acme-challenge/) - String - required
json_params: The parameters - String - required
admin
gcs presign "{\"credentials_file\": \"tmp/gcs-sa.json\"}" "test-bucket" "test-object" "{\"expires_in\": 10, \"now\": \"2019-02-01T09:00:00Z\"}"
mentdb
https://storage.googleapis.com/test-bucket/test-object?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=test-iam-credentials%40dummy-project-id.iam.gserviceaccount.com%2F20190201%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20190201T090000Z&X-Goog-Expires=10&X-Goog-SignedHeaders=host&X-Goog-Signature=95e6a13d43a1d1962e667f17397f2b80ac9bdd1669210d5e08e0135df9dff4e56113485dbe429ca2266487b9d1796ebdee2d7cf682a6ef3bb9fbb4c351686fba90d7b621cf1c4eb1fdf126460dd25fa0837dfdde0a9fd98662ce60844c458448fb2b352c203d9969cb74efa4bdb742287744a4f2308afa4af0e0773f55e32e92973619249214b97283b2daa14195244444e33f938138d1e5f561088ce8011f4986dda33a556412594db7c12fc40e1ff3f1bedeb7a42f5bcda0b9567f17f65855f65071fabb88ea12371877f3f77f10e1466fff6ff6973b74a933322ff0949ce357e20abe96c3dd5cfab42c9c83e740a4d32b9e11e146f0eb3404d2e975896f74
an upload link
admin
gcs presign "{\"credentials_file\": \"tmp/gcs-sa.json\"}" "test-bucket" "2026/sales.csv" "{\"method\": \"PUT\", \"expires_in\": 600, \"now\": \"2026-11-17T10:00:00Z\"}"
mentdb
https://storage.googleapis.com/test-bucket/2026/sales.csv?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=test-iam-credentials%40dummy-project-id.iam.gserviceaccount.com%2F20261117%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20261117T100000Z&X-Goog-Expires=600&X-Goog-SignedHeaders=host&X-Goog-Signature=012fb53d20143f356960a4df900d5cec03a9e63fbcc975c2a0e0e8ef44a8c35d3021350ee333787ea35a1f565fe22e34423259c43b49c8751cd19997d6f15517a266020dacbba1d64a71b5f71cac70271fd70ffc3067cc645c69107866d9423f7200b5c8d4b986a89f845e084ba0876e472565a2e2b6ee64d74a3512dd9447e276dd47591f110f7843ffc1078e6c493a3716530edbb559c2dae53c6a06175758dd95bff788faae8a5bdfed3455ec42ca1eb7340347659180349bd19056a72025e42bf3f79ae44785d35d9a17c90f8103238ce8f8eec45aebcfad5220e5feac3666410c63b00599e6bf438c82ea94a1f79b08972e4a5ab33529afcf72c4d0c9e6
gcs bucket_drop <config> <bucket>
Description
Delete an empty bucket. Returns {dropped}
Delete an empty bucket. Returns {dropped}
Parameters
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
config: The Google Cloud Storage configuration as JSON: credentials_file (a service account key file: a signed JWT is exchanged for an OAuth token, kept until 5 minutes before its end) or access_token (the name of a secret: secret set); none for an emulator or a public bucket. project_id (needed by ping, buckets and bucket_create; read from the credentials file by default), endpoint (https://storage.googleapis.com; http only for localhost, or allow_plain true), timeout_ms (60000) - String - required
bucket: The name of the bucket - String - required
admin
gcs bucket_drop "{\"project_id\": \"demo\", \"endpoint\": \"http://127.0.0.1:4443\"}" "archive"
mentdb
{"dropped": "archive"}
