Get started with Zoho Sheet CLI

Get started with Zoho Sheet CLI

What is a CLI

A Command Line Interface, or CLI, is a text-based user interface, one of the oldest ways humans used to interact with computers. Most of the apps we use now are graphics-based; we tap icons and click buttons which is why they are called Graphical User Interfaces, or GUIs. A CLI only has text; you type commands into a terminal and the computer runs them.

What can you do with Zoho Sheet CLI

You can use Zoho Sheet CLI(zs-cli) to create and edit spreadsheets from scratch, build pivot tables and charts, and apply formatting, entirely with commands you type into your terminal.
You can also run zs-cli from CI/CD pipelines to generate reports and dashboards repeatedly.

How to install Zoho Sheet CLI

Zoho Sheet CLI is installed using npm, so you'll need Node.js and npm on your machine first. 
  1. Open your terminal and run these commands to check whether you already have them:
    node -v
    npm -v
  2. If you don't have them yet, you can follow npm's guide on downloading and installing Node.js and npm.
  3. Once Node.js is installed on your machine, close your terminal and open a new one. Run this command to install Zoho Sheet CLI:
    npm install -g @zohocorporation/zs-cli
Notes
Run zs-cli help. If the CLI is installed, you'll see a list of commands Zoho Sheet CLI supports.


Sample Commands

If you're new to using a CLI, here are the commands you need to get started. Type zs-cli in your terminal to start a session, then run:
  1. open "D:\Documents\Budget.xlsx"
  2. cell set A1 "Item"
  3. cell set B1 "Cost"
  4. cell set A2 "Laptop"
  5. cell set B2 "62000"
  6. cell set A3 "Total"
  7. cell set B3 --formula =SUM(B2:B2)
  8. save --as budget.xlsx
  9. exit

Where your files are saved

Zoho Sheet CLI saves the spreadsheets you create as .xlsx files. The file is saved to the folder your terminal is currently in. You can open your sheet using the Zoho Sheet desktop app or import the .xlsx file into the web app.