Code Monkey home page Code Monkey logo

btcli's Introduction

GoDoc CircleCI Go Report Card

btcli

btcli is a CLI client for the Bigtable. Has many read options and auto-completion.

tty

Features

btcli is the cloud bigtable client tool. Connect to your bigtable instances and any read items with auto-completion.

write commands are not implemented yet

Compare to cbt

cbt is an official bigtable client tool

  • btcli has auto-completion
  • btcli can decode a big-endian values
  • btcli has a filter for value, version and family
  • A print format that same as the cbt

Installation

go get -u github.com/takashabe/btcli/cmd/btcli

Require go1.11 or later and GO111MODULE environemnts

Usage

Connect to bigtable

btcli -project <GCP_PROJECT_NAME> -instance <BIGTABLE_INSTANCE_ID> -creds <GCP_CREDENTIAL_FILE>

-creds e.g. ~/.config/gcloud/application_default_credentials.json

Subcommand and options

  • ls

List tables

ls          List tables
  • count

Count rows in a table

count <table>
  • lookup

Read from a single row

lookup <table> <row> [family=<column_family>] [version=<n>]
        version        Read only latest <n> columns
        decode         Decode big-endian value
        decode-columns Decode big-endian value with columns. <column_name:<string|int|float>[,<column_name:...>]
  • read

Read rows

read <table> [start=<row>] [end=<row>] [prefix=<prefix>] [family=<column_family>] [version=<n>]
        start          Start reading at this row
        end            Stop reading before this row
        prefix         Read rows with this prefix
        value          Read rows with has value
        family         Read only columns family with <columns_family>
        version        Read only latest <n> columns
        from           Read cells whose version is newer than or equal to this unixtime
        to             Read cells whose version is older than this unixtime
        decode         Decode big-endian value
        decode-columns Decode big-endian value with columns. <column_name:<string|int|float>[,<column_name:...>]

Environments

Env Detail
BTCLI_DECODE_TYPE set the default decoding type.
values: string, int, float

Support commands

Read commands

  • ls
  • count
  • lookup
    • version
    • decode
    • decode-columns
  • read
    • start
    • end
    • prefix
    • value
    • family
    • version
    • from
    • to
    • decode
    • decode-columns

Write commands

  • createfamily
  • createtable
  • deletecolumn
  • deletefamily
  • deleterow
  • deletetable
  • set
  • setgcpolicy

Others

  • help

btcli's People

Contributors

amksd avatar takashabe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

btcli's Issues

`help` leads to panic

go1.13 linux/amd64 on Ubuntu 18.04.3

> help
panic: runtime error: index out of range [1] with length 0

goroutine 1 [running]:
github.com/takashabe/btcli/pkg/cmd/interactive.lazyDoHelp(0xb38000, 0xc0000cc010, 0xb3ab80, 0xc00031f050, 0xc0005dc410, 0x0, 0x0)
        /home/gustavoip/go/pkg/mod/github.com/takashabe/[email protected]/pkg/cmd/interactive/executor.go:66 +0x339
github.com/takashabe/btcli/pkg/cmd/interactive.doHelp(0xb38000, 0xc0000cc010, 0xb3ab80, 0xc00031f050, 0xc0005dc410, 0x0, 0x0)
        /home/gustavoip/go/pkg/mod/github.com/takashabe/[email protected]/pkg/cmd/interactive/executor.go:19 +0x6e
github.com/takashabe/btcli/pkg/cmd/interactive.(*Executor).Do(0xc0004e05c0, 0xc000324000, 0x4)
        /home/gustavoip/go/pkg/mod/github.com/takashabe/[email protected]/pkg/cmd/interactive/executor.go:49 +0x348
github.com/c-bata/go-prompt.(*Prompt).Run(0xc00013c280)
        /home/gustavoip/go/pkg/mod/github.com/c-bata/[email protected]/prompt.go:85 +0x80e
github.com/takashabe/btcli/pkg/cmd/interactive.(*CLI).Run(0xc0000acf00, 0xc0000d4000, 0x5, 0x5, 0x0)
        /home/gustavoip/go/pkg/mod/github.com/takashabe/[email protected]/pkg/cmd/interactive/interactive.go:65 +0x570
main.main()
        /home/gustavoip/go/pkg/mod/github.com/takashabe/[email protected]/cmd/btcli/btcli.go:22 +0xdf

authentication problem

Hi,

thanks for this tool, it looks great. Unfortunately i am not able authenticate with my bigtable instance. Using the usuall cbt with the same configuration works without problems.

This works:

 cbt -project myProject -instance myInstance ls

and this does not work:

btcli -project myProject -instance myInstance
> ls

I am getting thsi error:

rpc error: code = PermissionDenied desc = Caller does not have required permission to use project 
myProject. Grant the caller the Owner or Editor role, or a custom role with the serviceusage.services.use 
permission, by visiting https://console.developers.google.com/iam-admin/iam/project?project=myProject 
and then retry (propagation of new permission may take a few minutes).>

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.