> ## Documentation Index
> Fetch the complete documentation index at: https://docs.happycapy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI tools

> Run command-line tools in the Happycapy sandbox.

## Overview

A command-line interface, or CLI, is a tool you run with commands instead of buttons. Many services provide CLIs so users can manage repositories, documents, deployments, logs, and workspace data programmatically.

In Happycapy, you do not need to memorize those commands. Describe what you want to do in natural language, and Happycapy can install the CLI, choose the right commands, run them in the sandbox, read the output, and continue the work inside your Project.

A CLI may connect to an external service such as GitHub, Notion, Lark, or Fly.io. It may also be a local utility for working with files, code, media, or data inside the sandbox.

## When to use CLI tools

Use CLI tools when a service exposes useful actions through commands:

* Work with repositories, pull requests, issues, logs, and deployments
* Read or update workspace systems such as Notion and Lark
* Run cloud, database, or infrastructure commands
* Turn repeatable command-line work into a Project workflow

## CLI or MCP?

CLI and MCP can feel similar in Happycapy: you describe the goal in natural language, and the agent decides which tool calls or commands are needed.

The difference is the connection layer. With CLI tools, Happycapy writes and runs command-line programs in the sandbox. With [MCP](/en/integrations/mcp), Happycapy calls tools exposed by an MCP server.

If a service has a well-maintained official CLI, or the task involves deployments, logs, scripts, files, or one-off setup, CLI is often the direct path. If a service has a maintained MCP server, or you want tool actions exposed through a structured interface, MCP may fit better. If both exist, choose the option that is officially maintained, clear about permissions, and easiest to configure.

## Before you start

Helpful context to provide:

* The official CLI name or install link
* The account, workspace, repository, or app to connect
* The required auth method, such as login flow, token, API key, or workspace permission
* The outcome you want Happycapy to complete after setup

## First use

Give Happycapy the tool and the goal:

```text theme={null}
Install [CLI name] in the Happycapy sandbox.
Tell me what authentication is required before you continue.
After it is ready, use it to [goal].

CLI link: [official link]
```

## Recommended CLIs

These CLIs work well in a Happycapy sandbox because they expose real systems through commands that an agent can install, configure, and run.

<CardGroup cols={2}>
  <Card title="GitHub CLI" icon="https://mintcdn.com/happycapy/9SccTkPwiYpehlgU/images/integrations/logos/github.png?fit=max&auto=format&n=9SccTkPwiYpehlgU&q=85&s=679bb093797d36e654af372f853a460a" href="https://cli.github.com" width="560" height="560" data-path="images/integrations/logos/github.png">
    Work with repositories, pull requests, issues, and GitHub Actions.
  </Card>

  <Card title="ntn" icon="https://mintcdn.com/happycapy/9SccTkPwiYpehlgU/images/integrations/logos/notion.png?fit=max&auto=format&n=9SccTkPwiYpehlgU&q=85&s=534c589e6711180fe51fa3b632720e51" href="https://developers.notion.com/cli" width="64" height="64" data-path="images/integrations/logos/notion.png">
    Search Notion pages, create content, and query databases.
  </Card>

  <Card title="lark-cli" icon="https://mintcdn.com/happycapy/9SccTkPwiYpehlgU/images/integrations/logos/lark.png?fit=max&auto=format&n=9SccTkPwiYpehlgU&q=85&s=adc21fbe2f882fafdd5006135fb05128" href="https://github.com/larksuite/cli" width="48" height="48" data-path="images/integrations/logos/lark.png">
    Work with Lark/Feishu messages, docs, sheets, calendar, tasks, mail, and meetings.
  </Card>

  <Card title="flyctl" icon="https://mintcdn.com/happycapy/9SccTkPwiYpehlgU/images/integrations/logos/flyio.svg?fit=max&auto=format&n=9SccTkPwiYpehlgU&q=85&s=d9342a993c06f2170919e5f5a526a3d3" href="https://fly.io/docs/flyctl/" width="167" height="151" data-path="images/integrations/logos/flyio.svg">
    Deploy and operate Fly.io apps, Machines, logs, secrets, and releases.
  </Card>
</CardGroup>

## Example workflows

```text theme={null}
Use GitHub CLI.
Review the latest failed GitHub Actions run for this repository.
Summarize the failure and suggest the smallest fix.
```

```text theme={null}
Use ntn.
Search our Notion workspace for onboarding docs.
Summarize the current process and list gaps.
```

```text theme={null}
Use lark-cli.
Collect this week's project updates from Lark docs.
Turn them into a short team report.
```

```text theme={null}
Use flyctl.
Check the status and recent logs for this Fly.io app.
Tell me whether the latest deploy is healthy.
```

## Authentication and permissions

* Start with the account, workspace, repository, or project the CLI should connect to.
* Keep secrets out of prompts when possible. Prefer the CLI's normal authentication flow.
* Ask Happycapy to explain required permissions before you approve authentication.
* For tokens, prefer scoped or short-lived tokens when the service supports them.
* For destructive operations, ask Happycapy to show the command and expected effect before running it.

## Troubleshooting

### The CLI cannot install

Share the official install link and ask Happycapy to check the sandbox environment, package manager, and platform requirements.

### Login failed

Confirm whether the CLI expects browser login, token login, workspace approval, or environment variables.

### Permission denied

Ask Happycapy to show which permission is missing and whether the action needs a different token, role, workspace, repository, or organization.

### The output is too broad

Narrow the request with a repository, project, date range, file path, app name, or command target.

## Next steps

* Read [MCP](/en/integrations/mcp) to see another way to connect tools. MCP feels similar to CLI in use, but calls tools from an MCP server instead of running command-line programs in the sandbox.
* Use [Automations](/en/features/automations) when the same CLI workflow should run on a schedule.
