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

# Upload and update apps from the CLI

> Deploy a folder as a new Square Cloud app with squarecloud upload, send changes with squarecloud commit and check what the zip contains with squarecloud zip.

* **`upload`** creates a **new** application, with a new ID.
* **`commit`** sends files to an application that **already exists** and keeps its ID, domain and settings.
* **`zip`** builds the same zip locally, without sending it, so you can check what goes in.

`upload` and `commit` also exist under `squarecloud app` (`squarecloud app upload`, `squarecloud app commit`). New here? Start with the [Quickstart](/en/cli-reference/quickstart).

## What goes in the zip

`upload`, `commit` and `zip` zip the current folder and leave out what [`squarecloud.ignore`](/en/getting-started/squarecloud-ignore), in the project root, lists. It uses `.gitignore` syntax and is the same file the [VS Code extension](/en/vscode-extension/features#ignore-rules) reads.

* **Always left out first:** `node_modules`, `.git`, `.github`, `.vscode`, `package-lock.json`, `pnpm-lock.yaml` and `yarn.lock`. Dependencies are installed on the platform from your manifest. To send a lockfile because you need pinned versions, add a `!` rule, such as `!package-lock.json`.
* **Links:** a symbolic link to a file is zipped as that file; links to folders and broken links are skipped with a note on stderr.
* **Older file names** (`.squareignore`, `.squarecloudignore`, `square.ignore`) are still read when `squarecloud.ignore` is missing, with a warning to rename the file.

## `squarecloud upload`

```bash Usage theme={"system"}
squarecloud upload [--file <path>] [--json]
```

Zips the current folder and creates a new application from it. The folder needs a [`squarecloud.app` or `squarecloud.config`](/en/getting-started/config-file) file.

| Flag | Description |
| - | - |
| `--file <path>` | Uploads a zip you already have instead of zipping the current folder. Relative and absolute paths both work. |

```bash theme={"system"}
squarecloud upload
# Zips the current folder and deploys it as a new application.
```

```bash theme={"system"}
squarecloud upload --file ./build/my-app.zip
# Uploads an existing zip.
```

```bash Output theme={"system"}
Compressing the current directory.
Uploading the zip file to Square Cloud.

✓ Application uploaded to Square Cloud!
  Open it at https://squarecloud.app/dashboard/applications/<appID>
```

After a successful upload, the CLI writes `ID=<appID>` into the configuration file of the current folder, so later commands know which app you mean. See [where the app ID is saved](/en/cli-reference/quickstart#where-the-app-id-is-saved).

With `--json`, stdout carries only the created application (ID, name, description, domain, cluster, memory, CPU and language) as JSON; progress messages go to stderr.

## `squarecloud commit`

```bash Usage theme={"system"}
squarecloud commit [appID] [--file <path>] [--path <dir>] [-r]
```

**Aliases:** `squarecloud push`, `squarecloud app commit`, `squarecloud app push`

Zips the current folder and sends it to an existing application. The ID comes from the argument or from the `ID=` line of your configuration file. Unlike other commands, `commit` never opens a picker: without either, it stops with exit code 1.

| Flag | Description |
| - | - |
| `--file <path>` | Sends one file instead of the current folder. A zip is extracted in the application; any other file is written under its own name. Relative and absolute paths both work. |
| `--path <dir>` | Commits into this folder of the application instead of its root. |
| `-r`, `--restart` | Restarts the application after the commit. |

```bash theme={"system"}
squarecloud commit
# Sends the current folder to the app in the ID= line.
```

```bash theme={"system"}
squarecloud commit <appID> --restart
# Sends the current folder to a specific app, then restarts it.
```

```bash theme={"system"}
squarecloud commit --file ./config.json --path settings
# Sends one file into the settings folder of the app.
```

```bash Output theme={"system"}
Compressing the current directory.
Committing to your application (<appID>)...
Committed to your application.
```

Large commits are not cut off by a timeout. `commit` has no JSON output.

## `squarecloud zip`

```bash Usage theme={"system"}
squarecloud zip
```

Zips the current folder the same way `upload` and `commit` do and saves it as `<folder name>.zip` inside that folder, replacing an existing file with that name. It doesn't need a login.

```bash Output theme={"system"}
✓ Your project was zipped to <folder name>
```

If the zip can't be written, the CLI prints `Couldn't zip your application.` with the reason; if an old `<folder name>.zip` can't be deleted, it says so. Both exit with code 1.

## Related

| Command | API | JavaScript SDK | VS Code |
| - | - | - | - |
| `upload` | [`POST /v2/apps`](/en/api-reference/endpoint/apps/upload) | [`api.apps.create()`](/en/sdks/js/commit_and_upload) | [Upload New Application](/en/vscode-extension/features#upload-a-new-application) |
| `commit` | [`POST /v2/apps/{app_id}/commit`](/en/api-reference/endpoint/apps/commit) | [`api.apps.commit()`](/en/sdks/js/commit_and_upload) | [Commit](/en/vscode-extension/features#commit-changes-to-an-existing-application) |

To deploy on every push instead, see [GitHub deploys](/en/cli-reference/github-deploys).
