Skip to content
CouchDB command-line tool
Branch: master
Clone or download
flimzy Merge pull request #69 from go-kivik/noraw
Remove raw output support.
Latest commit 1bf7cb7 Oct 25, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/kouch Final migration to SetParams() Oct 17, 2018
config Move user/pass flag handling to separate function Sep 16, 2018
internal Use a single SetParam function, with dispatch tables, in place of Set… Oct 17, 2018
io Remove raw output support. Oct 24, 2018
kouchio Stash flags in context Oct 7, 2018
script Set prerelease flag Sep 18, 2018
vendor Update deps Sep 13, 2018
.gitignore Multi-arch build Sep 18, 2018
.linter.json Remove obsolete linter Sep 13, 2018
.travis.yml Set prerelease flag Sep 18, 2018
Gopkg.lock Update deps Sep 13, 2018
Gopkg.toml Update dependencies Aug 6, 2018
LICENSE.md Initial commit Jul 9, 2017
README.md Flesh out the readme a bit Aug 26, 2018
common_test.go Move FilenameFromFlags to main package Aug 15, 2018
config.go Add support for --user and --password flags Sep 16, 2018
config_test.go Plumbing for 'get uuids' to config Aug 6, 2018
constants.go Add version & tests Sep 13, 2018
context.go Add ctx getter & setter for flags Oct 7, 2018
context_test.go Add back-fill support for contexts associated with *cobra.Commands Aug 12, 2018
design.txt Add --output and --force flags Aug 7, 2018
errors.go Delint Sep 13, 2018
errors_test.go
flags.go Final migration to SetParams() Oct 17, 2018
helptext.go Move helptext to kouch package Sep 16, 2018
helptext_test.go Unxport TargetLastScope once again Sep 16, 2018
options.go Final migration to SetParams() Oct 17, 2018
options_test.go Use a single SetParam function, with dispatch tables, in place of Set… Oct 17, 2018
target.go Final auth plumbing Sep 16, 2018
target_test.go Final auth plumbing Sep 16, 2018

README.md

Build Status Codecov Go Report Card GoDoc

Kouch

Kouch is a command-line interface for CouchDB, intended to facilitate ease of scripting or manual interaction with CouchDB.

It takes great inspiration from curl, the command-line tool for transferring data with URLs.

Kouch aims to make CouchDB administration and scripting easier, by providing a simple, CouchDB-centric command-line tool for performing routine administration and debugging operations, without the cumbersome task of manually constructing HTTP requests for use with curl.

Kouch can also output (and read input) to pretty-printed JSON or YAML, rather than CouchDB's native JSON format, for more more human-friendly interaction with documents.

Example Usage

Fetch a document

$ kouch get doc localhost:5984/foo/bar
{"_attachments":{"foo.txt":{"content_type":"text/plain","digest":"md5-WiGw80mG3uQuqTKfUnIZsg==","length":9,"revpos":3,"stub":true}},"_id":"bar","_rev":"3-13438fbeeac7271383a42b57511f03ea","a":"c"}

Fetch a document, pretty JSON output

$ kouch get doc localhost:5984/foo/bar -F json --json-indent " "
{
 "_attachments": {
  "foo.txt": {
   "content_type": "text/plain",
   "digest": "md5-WiGw80mG3uQuqTKfUnIZsg==",
   "length": 9,
   "revpos": 3,
   "stub": true
  }
 },
 "_id": "bar",
 "_rev": "3-13438fbeeac7271383a42b57511f03ea",
 "a": "c"
}

Fetch a document, YAML output

$ kouch get doc localhost:5984/foo/bar --output-format yaml
_attachments:
  foo.txt:
    content_type: text/plain
    digest: md5-WiGw80mG3uQuqTKfUnIZsg==
    length: 9
    revpos: 3
    stub: true
_id: bar
_rev: 3-13438fbeeac7271383a42b57511f03ea
a: c

Fetch a document, showing only the headers

$ kouch get doc localhost:5984/foo/bar -I
Cache-Control: must-revalidate
Content-Length: 198
Content-Type: application/json
Date: Sun, 26 Aug 2018 16:32:12 GMT
Etag: "3-13438fbeeac7271383a42b57511f03ea"
Server: CouchDB/2.1.1 (Erlang OTP/17)
X-Couch-Request-Id: 0ff82e5498
X-Couchdb-Body-Time: 0

Current status

Kouch is still in the early stages of development. Most features have not yet been implemented. But fast progress is being made, and your contributions are also welcome!

License

This software is released under the terms of the Apache 2.0 license. See LICENCE.md, or read the full license.

You can’t perform that action at this time.