Command Line Tool basics


This article introduces the basic usages of the Kintone Command Line Tool a.k.a. cli-kintone.
Cli-kintone is a tool to import and export record data to and from a Kintone App.
Read through Preparing the Command Line Tool for steps on preparing cli-kintone for the local environment.

Display cli-kintone options

Running cli-kintone without any arguments, will list the available cli-kintone options.






To be used when exporting data out from Kintone.
Data will be exported to the stdout (i.e. it will display on the console)



To be used when importing data into Kintone.
Data will be imported from the stdin.
If the -f option is also specified, data is imported from the specified file instead.



The domain name.
Specify the FQDN of the Kintone environment, such as "".
This option is required.



The App ID of the Kintone App.
The App ID can be found in the URL of the App
This option is required.

-a 27


The login name of the Kintone user to authenticate with.
Either the API token or the login name is required.



The login password for the Kintone user.

-p password


The API token of the App.
Either the API token or the login name is required.

-t 4gp63Dpol3ksp4S3fd


The Guest Space ID.
Required, if the App lies within a Guest Space.
The Guest Space ID can be found in the URL of the App

-g 3


The export format.
Specify "json" or "csv".
Default is "csv".

-o json


The Encoding format.
Specify "utf-8", "utf-16", "utf-16be-with-signature", "utf-16le-with-signature", "sjis" or "euc-jp".
Default is "utf-8".

-e utf-16


The Basic Authentication login name.
Refer to the Configuring IP Address Restrictions and Basic Authentication for more information on Basic Authentication.
Required, if the Basic Authentication settings have been set up for the Kintone environment.


* Domains created after the September 6, 2019 update are unable to use basic authentication.

Refer to the API Updates for September 2019 for details.

-U basicusername


The Basic authentication password.

-P basicuserpassword


The query for the API call.
Refer to Get Record for information on how to write queries.

-q "duedate < \"2017-04-27\" order by task_status"


The fields to export.
Specify the field codes of the fields, and separate them with commas.

 -c "title, name, date"


The file name, for importing data.

 -f /Documents/mydata.csv


The directory to download attachment files to, or to upload files from.

 -b /Documents/2017Oct


Position index of data in the input file.
Data import will start from this line.

 -l 11


If this option is specified when importing data, cli-kintone will delete all existing records inside the App before importing.



Below are examples of using cli-kintone on Windows. To cancel a process while it's running, press CTRL+C.


Authenticate via a Username and Password

Use the -u option to authenticate via a Username and Password.
For authenticating with the user Krispy:

The user is prompted to enter a password.

Authenticate via an API Token

Use the -t option to authenticate via an API Token. Refer to Using API Token authentication for how to generate an API token for the Kintone App. Make sure to grant the appropriate permissions to the API token.
For authenticating with an API Token of "c4vIhZ2pez5BhthY3j796pCsv117qyGTx7lHYKM3":

Export data

General Rule

When exporting data out of Kintone, state "--export" at the beginning of the command.

Export Record Data to the console

To export data to the console from a Kintone App, specify the Kintone FQDN with the -d option, and the App ID with the -a option.
For an FQDN of "" and App ID of 999:

The result will be exported in CSV format:

To export the result in JSON format, specify "-o json".

Export with character encoding

By default, the character encoding is UTF-8.
Use the -e option to specify a different character encoding.

Specify the Fields to Export

By default, all fields of the App are exported.
Use the -c option to specify the fields to export.
For exporting the fields with field codes of record_num, Name, and Department:

The result will be exported as below:

Export data with filter conditions and sort order

The -q option specifies the filter and sort of the exported data. Refer to the Get Records article for information on how to write query conditions.
For exporting records where the date field with field code Hired_date is before April 27th 2017:

The result will be exported as below:

Export table data

If the exported record data contains table data, the contents of the record will be displayed in multiple lines. Below is how the exported CSV data looks like, together with data of other records:

In this example, the fields Transferred_Date and Transferred_to are in a table, and can carry several lines of data. If exported records contain table data, an * symbol that indicates new records will be added to the first column of every record of the exported file. Exported rows without an * symbol indicate that they carry the data of the second or later rows of a table (the data of the first row of the table is carried by the row containing the * symbol).

In the above CSV data, 5 records are exported. Record number 5 contains two lines of data in its table, which is represented in the CSV as two rows.

The contents of Record number 5 on the Kintone GUI looks like the below:


Downloading Attachments

Specify the folder name to download the file into using the -b option. The folder is automatically created if the name does not exist.
For exporting files attached to the field with the field code of pic into the folder kintonePics:

New folders will be created inside the specified folder for each record that contains attachment files. These new folders will be named as "{attachment field code}-{record number}".

In the exported console data, the value of the attachment file field will be the relative path from the specified download folder.

Export to a CSV file

The > symbol can be used to redirect the output to a file. Note that this command is not part of cli-kintone's feature, but it is a common command offered by command line interfaces.
The usage or output may differ depending on what operating system is being used.
The following command redirects cli-kintone's output to a csv file:

Import data

General Rule

When importing data into Kintone, state --import at the beginning of the command.

Add data using a CSV file

Use the -f option to specify a file to import into the App.
Prepare a CSV file with data such as:

For adding CSV data of sample.csv to a Kintone App:

The resulting data will be displayed on the console:

Add Data after Deleting Existing Data

If you specify the -D option, all existing records are deleted before adding data.

Update data using a CSV file

To update existing data, add an $id column (which represents the record ID) in the CSV file which will be the key to update.

Following is a sample CSV file that updates Clark’s department to the Planning Dept. and Jones’s to the HR Dept.

This will be used to update as follows:

To update records using a different field as the key instead of the record number, add an * symbol to the field code name to indicate it will be the key. The key field must have the Prohibit duplicated values settings checked in the Kintone App settings.
For updating data in an App with the field code customerCode as the key field, prepare a CSV file with data such as:

This will be used to update as follows:

Import table data

Similar to the exported table data, rows with an * symbol will be treated as new records, and rows without an * symbol will be treated as containing table data related to the rows above it.
Non-table Values of the rows that do not have an * in the first column will be ignored.

Uploading attachments

Specify the folder name to upload files from with the -b option. The value to write in the attachment field of the CSV file is a relative path from the specified folder. Use a carriage return (e.g. ALT+Enter inside cells for Microsoft Excel) to specify multiple attachment files.

For uploading files from the myfiles folder:


  • 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.
Was this article helpful?
0 out of 0 found this helpful
Do you have any questions or issues related to this article?
Please share your views with us in the Community forums!