# CLI reference

The Comind.work CLI ships as part of the `@comind/api` package and is invoked via `npx comind <command>`. It handles every step between local source code and a running workspace - building, deploying, and importing data. All commands are scriptable, so they work equally well at a developer's terminal or inside a CI/CD pipeline.

## Command reference[​](#command-reference "Direct link to Command reference")

| Command             | Alias | Purpose                                         | Example                                                  |
| ------------------- | ----- | ----------------------------------------------- | -------------------------------------------------------- |
| `install`           | `i`   | Compile an app and deploy it to a workspace     | `npx comind i app-task CMW 100`                          |
| `build`             |       | Compile app to JS (output to `__upload/build/`) | `npx comind build app-task`                              |
| `dump`              |       | Export a running app schema to TypeScript files | `npx comind dump default-app-wiki apps-dev/app-wiki`     |
| `dumpLint`          |       | Dump with ESLint auto-fix applied               | `npx comind dumpLint default-app-wiki apps-dev/app-wiki` |
| `promote`           |       | Promote an app to another environment           | `npx comind promote ...`                                 |
| `createRecords`     |       | Create records from CSV or JSON                 | `npx comind createRecords ...`                           |
| `importRecords`     |       | Import records into a workspace                 | `npx comind importRecords ...`                           |
| `importCustomViews` |       | Import list view configurations                 | `npx comind importCustomViews ...`                       |

## Key workflows[​](#key-workflows "Direct link to Key workflows")

### install - local dev to running workspace[​](#install---local-dev-to-running-workspace "Direct link to install - local dev to running workspace")

The most common command during development. It builds the full [compilation pipeline](/developer-guide/app-architecture/compilation-pipeline.md) and deploys the result in a single step.

```
npx comind install app-task CMW
  → buildAppSchemaObject("app-task")
  → buildAppSchemaCompiledJsCode(schema)
  → comind.schema.deploy(code, "CMW", position)
```

* The optional third argument sets the app's position (sort order) in the workspace sidebar.
* The builder resolves the full dependency tree - base, plugins, and any parent app declared via `inheritFrom` - before compiling.

### dump - running app to TypeScript[​](#dump---running-app-to-typescript "Direct link to dump - running app to TypeScript")

Reverse-engineers a compiled app back into TypeScript source files. This is the primary tool for migrating legacy apps to the v2 [package structure](/developer-guide/app-architecture/package-structure.md).

```
npx comind dump app-id target-dir
  → comind.schema.load(appId)
  → Parse compiled JS back into TypeScript components
  → Generate fields/, actions/, views/, settings/
  → Format with Prettier
```

The `dumpLint` variant runs ESLint with auto-fix on the generated files, saving a manual cleanup step.

### build - compile without deploying[​](#build---compile-without-deploying "Direct link to build - compile without deploying")

Produces compiled JS output in the `__upload/build/` directory without deploying to any workspace. Useful for validating that an app compiles cleanly, or for inspecting the build output.

```
npx comind build app-task
```

## Scaffolding[​](#scaffolding "Direct link to Scaffolding")

New customer apps can be scaffolded using `npm-init-comind`. This generates the standard [package structure](/developer-guide/app-architecture/package-structure.md) - fields, actions, views, settings, and `package.json` - ready for development.

```
npm init comind
```

## CI/CD usage[​](#cicd-usage "Direct link to CI/CD usage")

Customer CI/CD pipelines typically script `npx comind install` for each app in deployment order. The CLI is designed to be non-interactive, so it runs without modification in TeamCity, GitHub Actions, or any other CI system.

A typical deployment script installs apps sequentially to respect dependency order:

```
npx comind install app-base-task PROD
npx comind install app-custom-task PROD
npx comind install app-custom-deal PROD
```

For more on how install fits into the broader development process, see [App lifecycle](/developer-guide/app-architecture/app-lifecycle.md).

## Related[​](#related "Direct link to Related")

* [Data import and export](/developer-guide/how-to/advanced/data-import-export.md) - practical guide to `createRecords`, `importRecords`, and `dump` workflows
* [Production deployment](/developer-guide/how-to/advanced/production-deployment.md) - pre-deploy checklist and multi-environment CLI usage
