While the library offers several command-line tools, they conform to similar rules. Specifically, all client-based command-line tools follow a specific format when connecting to the cluster.
To connect to a cluster, pass the cluster’s connection string to the
If your bucket requires a password, you can specify the password using the
The value to the
-P option can either be a literal password string (insecure, but more convenient when testing), or a dash (
-), which will cause the command line tool to prompt for the password once during execution.
The latter method is more secure and should be used when connecting to production password-protected buckets.
Logging can be enabled by passing the
In accordance with many traditional command line tools, the verbosity of the logging may be increased by passing the
-v option more than once.
While connection string options can be passed directly inside the connection string, they can also be specified on the command line directly by using the
-D option can be supplied multiple times and functions similarly to the option of the same name as used in the C preprocessor.
cbc cat foo -U couchbase://localhost/default?certpath=/foo/bar/baz?operation_timeout=5.0 # Simpler cbc cat foo -U couchbase://localhost/default -Dcertpath=/foo/bar/baz -Doperation_timeout=5.0