bigquery-cli

Execute BigQuery operations from the command line with cost estimation and dataset management.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/leweii/bigquery-cli --skill bigquery-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bigquery-cli
Source: https://github.com/leweii/bigquery-cli/tree/main
Command: npx skills add https://github.com/leweii/bigquery-cli --skill bigquery-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a concise reference to use the BigQuery command‑line tool, ensuring queries are cost‑checked, data is loaded correctly, and resources are managed efficiently.

Core Features & Use Cases

  • Cost estimation with --dry_run before running large queries.
  • Data loading and exporting using CSV, JSON, Avro, Parquet formats with schema handling.
  • Resource management for datasets, tables, views, and jobs, including partitioned and clustered table creation.
  • Best‑practice guidance for authentication, project setup, and performance tuning.

Quick Start

Run a dry‑run query to estimate the cost of selecting last month’s revenue from the sales dataset.

Frequently Asked Questions about bigquery-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I estimate BigQuery query costs before running a large job from the command line?

You can estimate BigQuery query costs by executing the command with the `--dry_run` flag. This dry run calculates the bytes that the query will process, allowing you to verify expenses before actually executing data processing.

How do I load and export CSV or JSON data into BigQuery using the bq CLI?

The bq CLI supports data loading and exporting for CSV, JSON, Avro, and Parquet formats. You execute commands specifying the source file and destination table, applying schema handling flags to ensure proper data structure alignment.

What is the best way to create partitioned and clustered tables in BigQuery from the CLI?

Creating partitioned and clustered tables in BigQuery is handled by applying specific partitioning flags during table creation. This resource management approach organizes large datasets efficiently for optimized querying and cost control.

Do I need Google Cloud authentication and the bq CLI tool installed to manage datasets locally?

Yes, executing BigQuery operations from the command line requires the bq CLI tool and active Google Cloud authentication. Proper project setup is a necessary prerequisite to ensure secure and authorized resource management.

Why should I use the bq command line tool instead of other methods for BigQuery resource management?

Using the bq CLI ensures queries are cost-checked with dry runs and resources are managed efficiently through direct command execution. It provides concise reference for schema handling and performance tuning compared to manual console interactions.