Skip to main content

Interactive command line shell for CouchDB

Project description

Latest PyPI version Latest Travis CI build status for master Documentation Status Code Coverage License Image on Docker Hub

Features

  • auto-completion for database name, document id, view name, command

  • syntax highlighting of documents and views

  • navigate a couchdb server as if it were a file system

  • various commands supported
    • cd - change database

    • ls - list docs under a database

    • cat - show content of a doc

    • exec - execute a view

    • rm - remove a doc

    • man - show help on commands

    • mkdir - create new database

    • du - doc and database size

    • lv - list views inside a view doc

  • create/update docs using external $EDITOR

  • pipe output to external shell commands, such as grep, wc and jq

Usage

This tool allows you to traverse a CouchDB database as if it were a file system. Familiar file system commands are supported, such as ls, cd, mkdir, rm, etc, while providing context-rich auto-completion.

Starting cdbcli

Refer to the Installation section for guide on how to install cdbcli.

Running cdbcli requires connection parameters to the underlying couchdb instance you want to connnect to.

cdbcli --help

Usage: cdbcli [OPTIONS] [DATABASE]

Options:
  -h, --host TEXT               The host of the couchdb instance
  --port TEXT                   The port of the coouchdb instance
  -u, --username TEXT           The username to connect as
  -p, --password TEXT           The password
  -P, --askpass / --no-askpass  Ask for password?
  --tls / --no-tls              Use TLS to connect to the couchdb instance?
  --help                        Show this message and exit.

e.g., if you want to connect your couchdb instance at http://yourdomain:9999, you can issue the command:

cdbcli -h yourdomain --port 9999 -u admin -P

Specifying -P will prompt you for password. You can also use -p to specify password at the command line, but this is not recommended for sensitive passwords.

By default, cdbcli connects to the couchdb instance at http://localhost:5984.

You will be greeted by the cdbcli’s splash screen:

      ___  ____  ____   ___  __    ____
     / __)(  _ \(  _ \ / __)(  )  (_  _)
    ( (__  )(_) )) _ <( (__  )(__  _)(_
     \___)(____/(____/ \___)(____)(____)

    Welcome to cdbcli 0.1.1
    CouchDB version: 1.5.0

    Type 'help' or 'man' to get a list of all supported commands
    Press <TAB> for command auto-completion
    Press Ctrl+C or Ctrl+D or type 'exit' to exit

admin@yourdomain/>

Run with Docker

cdbcli is also available as a docker image on the docker hub

To run:

docker run -it kevinjqiu/cdbcli cdbcli <arguments>

The docker networking restrictions apply, so if you want to connect to a database on localhost, e.g., you will need to let the container use the host’s networking:

docker run -it --net=host kevinjqiu/cdbcli cdbcli <arguments>

Installation

pip install cdbcli

Contributing

  • Clone this repository.

  • Make a Python virtualenv

  • Install requirements: pip install -r requirements-test.txt

  • Install docker because the integration tests require it

  • Run make start_couchdb. This will start the testing couchdb instance using docker

  • Run make test

  • Run make stop_couchdb to clean up

Contributing to Documentation

  • Clone this repository.

  • Make a Python virtualenv

  • Install requirements: pip install -r requirements-docs.txt

  • Run make docs. The documentation can be accessed under docs/build/index.html.

Licence

cdbcli is licensed under Apache 2.0

Authors

cdbcli was written by Kevin J. Qiu.

See all contributors

Attribution

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdbcli-0.2.1.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

cdbcli-0.2.1-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file cdbcli-0.2.1.tar.gz.

File metadata

  • Download URL: cdbcli-0.2.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cdbcli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 eebf852e7fb5b9279b83dccac0a0a9bff7c28b3b8f482d4e608b19cc87b93f83
MD5 e8517838b2098205dbd2c07b313eebaa
BLAKE2b-256 d29c85cbf6be1c7d330a48847ec44b4f84794d150c493c6bb0d7270e172a40dd

See more details on using hashes here.

File details

Details for the file cdbcli-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cdbcli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 245e219d4b8c55e7bd587f0a53df25b28b1e25978447dc72d9f8c50ab9f49238
MD5 4f2d8bd902ebcd94885dbc880aa9acc2
BLAKE2b-256 d452e90e5c1d50f01f81c0f9904bf453e9ac1297a178685ef67b7ff9ee13418e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page