Coder Social home page Coder Social logo

cli-kintone's Introduction

cli-kintone

cli-kintone is a command line utility for exporting and importing kintone App data.

Version

0.9.2

How to Build

Requirement

  • Go 1.9.3
  • Git and Mercurial to be able to clone the packages

Getting the source code

$ export GOPATH=/path/to/your/Go/project/folder
$ cd ${GOPATH}/src
$ git clone https://github.com/kintone/cli-kintone.git

Install dependencies

$ export GOPATH=/path/to/your/Go/project/folder
$ go get github.com/mattn/gom
$ sudo ln -s $GOPATH/bin/gom /usr/local/bin/gom
$ gom -production install

build

$ cd ${GOPATH}/src/cli-kintone
$ gom build

Downloads

These binaries are available for download.

  • Windows
  • Linux
  • Mac OS X

https://github.com/kintone/cli-kintone/releases

Usage

    Usage:
        cli-kintone [OPTIONS]

    Application Options:
        -d=           Domain name (specify the FQDN)
        -a=           App ID (default: 0)
        -u=           User's log in name
        -p=           User's password
        -t=           API token
        -g=           Guest Space ID (default: 0)
        -o=           Output format. Specify either 'json' or 'csv' (default: csv)
        -e=           Character encoding. Specify one of the following -> 'utf-8'(default), 'utf-16', 'utf-16be-with-signature', 'utf-16le-with-signature', 'sjis' or
                        'euc-jp' (default: utf-8)
        -U=           Basic authentication user name
        -P=           Basic authentication password
        -q=           Query string
        -c=           Fields to export (comma separated). Specify the field code name
        -f=           Input file path
        -b=           Attachment file directory
        -D            Delete records before insert. You can specify the deleting record condition by option "-q"
        -l=           Position index of data in the input file (default: 1)
            --import  Import data from stdin. If "-f" is also specified, data is imported from the file instead
            --export  Export kintone data to stdout

    Help Options:
        -h, --help    Show this help message

Examples

Export all columns from an app

$ cli-kintone -a <APP_ID> -d <FQDN> -t <API_TOKEN>

Export the specified columns to csv file as Shif-JIS encoding

$ cli-kintone -a <APP_ID> -d <FQDN> -e sjis -c "$id, name1, name2" -t <API_TOKEN> > <OUTPUT_FILE>

Import specified file into an App

$ cli-kintone --import -a <APP_ID> -d <FQDN> -e sjis -t <API_TOKEN> -f <INPUT_FILE>

Records are updated and/or added if the import file contains either an $id column (that represents the Record Number field), or a column representing a key field (denoted with a * symbol before the field code name, such as "*mykeyfield").  

If the value in the $id (or key field) column matches a record number value, that record will be updated.
If the value in the $id (or key field) column is empty, a new record will be added.
If the value in the $id (or key field) column does not match with any record number values, the import process will stop, and an error will occur.
If an $id (or key field) column does not exist in the file, new records will be added, and no records will be updated.

Export and download attachment files to ./mydownloads directory

$ cli-kintone -a <APP_ID> -d <FQDN> -t <API_TOKEN> -b mydownloads

Import and upload attachment files from ./myuploads directory

$ cli-kintone --import -a <APP_ID> -d <FQDN> -t <API_TOKEN> -b myuploads -f <INPUT_FILE>

Import and update by selecting a key to bulk update

The key to bulk update must be specified within the INPUT_FILE by placing an * in front of the field code name,
e.g. “update_date",“*id",“status".

$ cli-kintone --import -a <APP_ID> -d <FQDN> -e sjis -t <API_TOKEN> -f <INPUT_FILE>

Import CSV from line 25 of the input file

 $ cli-kintone --import -a <APP_ID> -d <FQDN> -t <API_TOKEN> -f <INPUT_FILE> -l 25

Import from standard input (stdin)

 $ printf "name,age\nJohn,37\nJane,29" | cli-kintone --import -a <APP_ID> -d <FQDN> -t <API_TOKEN>

Documents for Basic Usage

English: https://developer.kintone.io/hc/en-us/articles/115002614853
Japanese: https://developer.cybozu.io/hc/ja/articles/202957070

Restriction

  • The limit of the file upload size is 10 MB.
  • Client certificates cannot be used with cli-kintone.
  • The following record data cannot be retrieved: Category, Status, Field group.
  • The following fields cannot be retrieved if they are set inside a Field group: Record number, Created by, Created datetime, Updated by, Updated datetime, Blank space, Label, Border.

License

GPL v2

Copyright

Copyright(c) Cybozu, Inc.

cli-kintone's People

Contributors

ryokdy avatar cy-kaneko avatar dtduc91 avatar ushirosako avatar will-yama avatar wolftatsu avatar ydambara avatar ymmt2005 avatar trung-doan avatar north-river avatar shota-fujiwara avatar

Watchers

James Cloos avatar  avatar

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.