# CLI Commands

[`@crowdin/serverless-apps-cli`](https://www.npmjs.com/package/@crowdin/serverless-apps-cli) is the command-line tool for serverless Crowdin apps: one binary scaffolds an app, runs it live inside Crowdin with hot reload, extracts and compiles translations, lints and formats your code, and publishes the result. It is a zero-config toolchain - React, Tailwind CSS, and Lingui i18n work out of the box, with Vite powering the dev server and the production build.

## Installation

Requires Node.js `^22.19 || ^24` - 22.19 or newer within the 22.x line, or any 24.x.

```bash
npm install --global @crowdin/serverless-apps-cli
```

Or run it ad hoc with `npx @crowdin/serverless-apps-cli <command>`.

Run `crowdin-serverless-apps <command> --help` for all options and examples.

## Develop

### create

```bash
crowdin-serverless-apps create [name] [--template <t>] [--yes]
```

Create a new serverless app from a starter template, register it in Crowdin, and link the folder to it (`CROWDIN_APP_ID` in `.env`). Both templates scaffold the same sample app (`manifest.json`, `src/`, `public/`, `locales/`) and differ in who owns the build:

- [`projects-dashboard-cli`](https://github.com/crowdin-community/serverless-apps-starter-kit/tree/main/templates/projects-dashboard-cli) - the CLI handles building for you: `dev`, `build`, and `publish` work out of the box with the zero-config toolchain. The default (used with `--yes`).
- [`projects-dashboard-standalone`](https://github.com/crowdin-community/serverless-apps-starter-kit/tree/main/templates/projects-dashboard-standalone) - you control the build setup: the template ships its own Vite/Lingui configuration and build scripts; use the CLI for app management (`login`, `link`, `manifest`, `publish`).

### dev

```bash
crowdin-serverless-apps dev [--port <n>] [--yes] [--no-manifest-sync]
```

Start a local dev server with hot reload; while it runs, your app inside Crowdin loads straight from your machine. See [how dev and publish work](/serverless-apps/development/dev-and-publish/).

The server listens on port 8080 (`PORT` sets a different starting point). If that port is taken - typically by a dev server for another app - `dev` reports the port it moved to and points Crowdin at that one. `--port <n>` is exact: `dev` stops rather than moving, so a scripted port never changes under you.

### preview

```bash
crowdin-serverless-apps preview [--module <key>] [--project <id|identifier>]
```

Open the app's page in Crowdin in the browser (does not start a server). Module types that have no page of their own (for example `modal` or `chat`) can't be opened - the CLI explains why instead of opening the browser.

[Project modules](/serverless-apps/building-app/modules/) and `editor-right-panel` open inside a project, so they need one. `--project` accepts either the numeric id or the project identifier. In an interactive terminal the CLI lists the projects you can access and lets you pick one; without a TTY it falls back to the first project on that list, so a scripted `preview` still ends on a URL - the `Opening <url>` line names the project it used. Pass `--project` when a specific one matters, since the first project you can access is not necessarily one where the app has anything to show. If the account has no accessible projects, `preview` stops and says so.

## Build & publish

### build

```bash
crowdin-serverless-apps build [--no-extract] [--no-bundle]
```

Build the app and package it for publishing (`dist/bundle.zip`).

### extract

```bash
crowdin-serverless-apps extract
```

Scan the source for translatable text and update the `locales/*.po` catalogs. See [translations](/serverless-apps/building-app/i18n/).

### publish

```bash
crowdin-serverless-apps publish [--no-build] [--yes] [--no-manifest-sync]
```

Build, upload the bundle to Crowdin, and switch the app to serve it.

## Quality

### lint

```bash
crowdin-serverless-apps lint
```

Check the app's code for problems (Biome, no configuration needed).

### format

```bash
crowdin-serverless-apps format
```

Auto-format the app's code.

## Manage apps

### list

```bash
crowdin-serverless-apps list [--print] [--json]
```

List your serverless apps. Alias: `ls`.

### link

```bash
crowdin-serverless-apps link [--app-id <id>]
```

Link the local project to an existing app.

### manifest

```bash
crowdin-serverless-apps manifest validate
crowdin-serverless-apps manifest status
crowdin-serverless-apps manifest pull
crowdin-serverless-apps manifest push
```

Check, diff, pull, or push `manifest.json`.

`manifest validate` checks the file against the [manifest schema](/serverless-apps/reference/manifest/) and needs no login and no app link - it never contacts Crowdin. It exits with code 1 when the manifest is invalid or is not valid JSON, which makes it usable as a pre-commit or CI gate.

`manifest status` exits with code 1 when the local file drifts from Crowdin.

## Account

### login

```bash
crowdin-serverless-apps login [--file-storage] [--port <n>]
```

Sign in via the browser; tokens are stored in the OS keychain, or in an encrypted file with `--file-storage`. Your Crowdin Enterprise organization is detected automatically.

`--port` pins the browser-callback port to one of `26140`-`26144` (useful for SSH port forwarding); by default the first free one of those is used.

### logout

```bash
crowdin-serverless-apps logout
```

Log out and remove the stored token.