cbt Reference

Cbt is a tool for doing basic interactions with Cloud Bigtable.


cbt [options] command [arguments]

The commands are:

count                     Count rows in a table
createfamily              Create a column family
createtable               Create a table
deletefamily              Delete a column family
deleterow                 Delete a row
deletetable               Delete a table
doc                       Print godoc-suitable documentation for cbt
help                      Print help text
listinstances             List instances in a project
lookup                    Read from a single row
ls                        List tables and column families
mddoc                     Print documentation for cbt in Markdown format
read                      Read rows
set                       Set value of a cell
setgcpolicy               Set the GC policy for a column family
version                   Print the current cbt version

Use "cbt help " for more information about a command.

The options are:

-project string
    project ID, if unset uses gcloud configured project
-instance string
    Cloud Bigtable instance
-creds string
    if set, use application credentials in this file

Count rows in a table

cbt count <table>

Create a column family

cbt createfamily <table> <family>

Create a table

cbt createtable <table>
  initial_splits=row        A row key to be used to initially split the table into multiple tablets. Can be repeated to create multiple splits.

Delete a column family

cbt deletefamily <table> <family>

Delete a row

cbt deleterow <table> <row>

Delete a table

cbt deletetable <table>
cbt doc
cbt help [command]

List instances in a project

cbt listinstances

Read from a single row

cbt lookup <table> <row>

List tables and column families

cbt ls          List tables
cbt ls <table>      List column families in <table>
cbt mddoc

Read rows

cbt read <table> [start=<row>] [end=<row>] [prefix=<prefix>] [count=<n>]
  start=<row>       Start reading at this row
  end=<row>     Stop reading before this row
  prefix=<prefix>   Read rows with this prefix
  count=<n>     Read only this many rows

Set value of a cell

cbt set <table> <row> family:column=val[@ts] ...
  family:column=val[@ts] may be repeated to set multiple cells.

  ts is an optional integer timestamp.
  If it cannot be parsed, the `@ts` part will be
  interpreted as part of the value.

Set the GC policy for a column family

cbt setgcpolicy <table> <family> ( maxage=<d> | maxversions=<n> )

  maxage=<d>        Maximum timestamp age to preserve (e.g. "1h", "4d")
  maxversions=<n>   Maximum number of versions to preserve
cbt version

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Cloud Bigtable Documentation