Skip to content

Instantly share code, notes, and snippets.

@dat-boris
Created February 26, 2026 05:59
Show Gist options
  • Select an option

  • Save dat-boris/259e5e35f693607292a58918fb89466c to your computer and use it in GitHub Desktop.

Select an option

Save dat-boris/259e5e35f693607292a58918fb89466c to your computer and use it in GitHub Desktop.
Agent Skill for BigQuery schema
name description
bigquery-schema
Fetch and inspect BigQuery table schemas using the bq CLI (part of the Google Cloud SDK). Use when you need to look up column names, types, or structure of a BigQuery table before writing SQL queries or building pipeline assets.

BigQuery Schema Lookup

Use the bq CLI (bundled with gcloud SDK) to inspect table schemas before writing queries or pipeline code.

Fetch a table schema

bq show --schema --format=prettyjson --project_id=PROJECT DATASET.TABLE

Returns a JSON array of field objects with name, type, mode, and optional description/fields (for RECORD types).

Example:

# Show schema for `example_project.example_dataset.example_table`
bq show --schema --format=prettyjson --project_id=example_project \
    example_dataset.example_table

Get full table metadata (schema + partitioning + stats)

bq show --project_id=PROJECT DATASET.TABLE

List all tables in a dataset

bq ls --project_id=PROJECT DATASET

Notes

  • Run gcloud auth login or gcloud auth application-default login first if not authenticated.
  • Omit PROJECT: to use the default project configured in gcloud config.
  • For RECORD (STRUCT) columns, nested fields appear under "fields" in the JSON output.
  • Use --format=json instead of prettyjson when piping output to scripts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment