# Install insMind CLI

Use insMind CLI to create images, videos, and text, work with the focused insMind Editor canvas, and manage insMind assets from a terminal or compatible AI Agent.

## Requirements

- Node.js 20 or later
- npm or pnpm
- A browser session that can sign in to insMind

## Install

Use one package manager:

```bash
npm install --global --allow-scripts=@insmind/cli @insmind/cli
# or
pnpm add --global --allow-build=@insmind/cli @insmind/cli
```

Global installation synchronizes the bundled `insmind-cli` Skill. If the current Agent session cannot see a newly installed Skill, restart the Agent or open a new session.

## Authenticate and verify

```bash
insmind-cli --version
insmind-cli auth status
insmind-cli auth login
insmind-cli credits
```

The login command opens an insMind authorization page. Complete authorization in the browser, then return to the terminal. insMind automatically binds the account context, so no context-selection step is required.

## Discover capabilities before creation

Do not hard-code Tools, Models, parameters, credit prices, or estimated duration. Discover the live catalog and inspect the selected schema first:

```bash
insmind-cli tool list
insmind-cli model list --tool <tool>
insmind-cli model get <model>
insmind-cli agent send --schema
insmind-cli tool call <tool> --schema
```

Use Agent for tasks that need clarification, planning, multiple steps, or multiple deliverables. Use Tool for one direct image, video, or text operation.

For an accepted asynchronous creation, keep its task ID and retrieve the original result instead of submitting again:

```bash
insmind-cli agent send --input request.json --async
insmind-cli tool call <tool> --input request.json --async
insmind-cli task list
insmind-cli task get <id>
```

Use the global `--locale <locale>` option when service-owned business descriptions should follow a specific language. Commands, identifiers, and parameters remain in English.

## Safety and output

- Use explicitly authorized absolute paths for local media.
- Never request, print, or persist credentials or signed request data.
- Do not automatically retry a paid request whose submission status is unknown.
- stdout contains command results; stderr contains warnings, authorization guidance, and errors.
- Exit code 0 means success, 1 means a runtime or service failure, 2 means invalid command input, and 130 means user interruption.

## Update or repair the Skill

```bash
insmind-cli update
```

The update command checks `@insmind/cli` on npm, updates a supported global installation, and synchronizes the bundled Skill. It can also repair the Skill after an installation that used `--ignore-scripts`.
