CLI

Use the CoCalc CLI for automation

Use the CoCalc CLI for authenticated docs, browser, notebook, and project automation.

Automate CoCalc from a terminal or an agent

The CoCalc CLI provides commands for projects, files, collaborative documents, notebooks, agent sessions, browser actions, and long-running operations. Use it from your own computer or from a CoCalc environment with supplied project or agent credentials.

Start here

  1. Install and run your first command: install the CLI, sign in on your own computer, and list a project's files.
  2. Check authentication and targets: choose the site, account, project, and browser deliberately.
  3. Find the right command: navigate the available command families and typed APIs.
  4. Use the CLI in scripts: parse JSON, check remote results, and recover existing operations.

Practical workflows

Read documentation from the CLI

These commands read the docs bundled with the installed CLI and need no login:

cocalc docs list --category CLI
cocalc docs search "project secrets"
cocalc docs show projects/project-secrets

Prefer the task-specific CLI command when one exists. For ordinary automation, start with the authentication flow appropriate to your environment rather than creating a broad API key. The HTTP API guide covers narrow external integrations.