LinuxCommandLibrary

cbt

Manage Cloud Bigtable clusters and tables

TLDR

List tables in the current project

$ cbt ls
copy

Print count of rows in a specific table in the current project
$ cbt count "[table_name]"
copy

Display a single row from a specific table with only 1 (most recent) cell revision per column in the current project
$ cbt lookup "[table_name]" "[row_key]" cells-per-column=[1]
copy

Display a single row with only specific column(s) (omit qualifier to return entire family) in the current project
$ cbt lookup "[table_name]" "[row_key]" columns="[family1:qualifier1,family2:qualifier2,...]"
copy

Search up to 5 rows in the current project by a specific regex pattern and print them
$ cbt read "[table_name]" regex="[row_key_pattern]" count=[5]
copy

Read a specific range of rows and print only returned row keys in the current project
$ cbt read [table_name] start=[start_row_key] end=[end_row_key] keys-only=true
copy

SYNOPSIS

cbt [global-options] [command-options] [arguments]

PARAMETERS

-project project-id
    Specifies the Google Cloud project ID to operate within. This overrides the default project configured in the Google Cloud SDK or environment variables.

-instance instance-id
    Specifies the Bigtable instance ID to connect to for the operation. This is mandatory for most data and table management commands.

-creds path-to-key-file
    Provides the path to a service account JSON key file for authentication. Alternative authentication methods include `gcloud auth application-default login`.

command
    The specific operation to perform, such as createinstance, createtable, read, ls, or delete. cbt is organized around these subcommands, each with its own syntax and purpose.

command-options
    Options specific to the chosen command. These modify the behavior of the subcommand, for example, specifying column families, row ranges, or cluster configurations.

arguments
    Positional arguments required by the command, such as an instance ID, table name, row key, or a value to write.

DESCRIPTION

cbt is a command-line interface (CLI) tool for interacting with Google Cloud Bigtable, a fully managed, scalable NoSQL database service. It is developed by Google and built with Go, providing a convenient way for developers and administrators to manage Bigtable instances, clusters, tables, and data directly from their terminal.

Unlike traditional Linux commands that operate on local filesystems or system processes, cbt facilitates operations on a remote cloud service. It allows users to perform tasks such as creating and deleting instances and tables, reading and writing data, managing column families, and inspecting table schemas without writing any code. cbt is often used for scripting administrative tasks, ad-hoc data lookups, and troubleshooting within Bigtable environments. It requires proper Google Cloud authentication and project configuration to function.

CAVEATS

The cbt command is specifically designed for Google Cloud Bigtable and is not a general-purpose Linux utility. It requires a Google Cloud project, a Bigtable instance, and proper authentication (e.g., via gcloud SDK or service account keys) to function. Network connectivity to Google Cloud is also necessary. Its installation typically involves the Google Cloud SDK or building from source using Go.

INSTALLATION

The cbt command is typically installed as part of the Google Cloud SDK (gcloud CLI). It can also be built and installed directly from its open-source Go repository on GitHub.

AUTHENTICATION

To interact with Google Cloud Bigtable, cbt requires authentication. The most common method is to use Google Cloud SDK credentials, often set up via `gcloud auth application-default login`, or by specifying a service account key file using the -creds option.

HISTORY

The cbt command was developed by Google as part of the Google Cloud ecosystem, specifically for administering and interacting with Google Cloud Bigtable. It is written in Go and open-sourced, evolving alongside the Bigtable service itself to provide a direct, powerful command-line interface for managing data and schemas in the NoSQL database.

SEE ALSO

gcloud bigtable(1), gcloud(1)

Copied to clipboard