项目作者: go-kivik

项目描述 :
CouchDB command-line tool
高级语言: Go
项目地址: git://github.com/go-kivik/kouch.git
创建时间: 2017-07-09T18:26:29Z
项目社区:https://github.com/go-kivik/kouch

开源协议:Other

下载


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

  1. $ kouch get doc localhost:5984/foo/bar
  2. {"_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

  1. $ kouch get doc localhost:5984/foo/bar -F json --json-indent " "
  2. {
  3. "_attachments": {
  4. "foo.txt": {
  5. "content_type": "text/plain",
  6. "digest": "md5-WiGw80mG3uQuqTKfUnIZsg==",
  7. "length": 9,
  8. "revpos": 3,
  9. "stub": true
  10. }
  11. },
  12. "_id": "bar",
  13. "_rev": "3-13438fbeeac7271383a42b57511f03ea",
  14. "a": "c"
  15. }

Fetch a document, YAML output

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

Fetch a document, showing only the headers

  1. $ kouch get doc localhost:5984/foo/bar -I
  2. Cache-Control: must-revalidate
  3. Content-Length: 198
  4. Content-Type: application/json
  5. Date: Sun, 26 Aug 2018 16:32:12 GMT
  6. Etag: "3-13438fbeeac7271383a42b57511f03ea"
  7. Server: CouchDB/2.1.1 (Erlang OTP/17)
  8. X-Couch-Request-Id: 0ff82e5498
  9. 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.