> ## 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.

# Manage app files from the CLI

> List, read, write, move and delete the files of a running Square Cloud application with squarecloud app file, without a commit. Binary files stay intact.

`squarecloud app file` is a remote file manager: it changes files in the application directly, without a commit. Every subcommand takes the application with `--app <appID>`, which is optional: see [how the CLI finds your app](/en/cli-reference/quickstart#how-the-cli-finds-your-app).

`read` and `write` transfer binary files unchanged.

## `squarecloud app file list`

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

Lists a folder of the application (the root when you omit `path`): type, name, size and last modification.

```bash theme={"system"}
squarecloud app file list /logs --app <appID>
# Lists the logs folder of a specific app.
```

## `squarecloud app file read`

```bash Usage theme={"system"}
squarecloud app file read <path> [-o <local file>] [-y] [--app <appID>]
```

| Flag | Description |
| - | - |
| `-o`, `--output <local file>` | Saves the content to a local file instead of printing it. Asks before overwriting an existing file. |
| `-y`, `--yes` | Overwrites an existing local file without asking. |
| `--app <appID>` | The application to read from. |

```bash theme={"system"}
squarecloud app file read config.json
# Prints the file to stdout.
```

```bash theme={"system"}
squarecloud app file read config.json -o ./config.backup.json
# Saves it locally.
```

A new local file created by `-o` is readable only by you (0600 permissions), since application files often hold secrets.

## `squarecloud app file write`

```bash Usage theme={"system"}
squarecloud app file write <path> [--from <local file>] [--app <appID>]
```

| Flag | Description |
| - | - |
| `--from <local file>` | Reads the content from a local file. Without it, the content comes from stdin. |
| `--app <appID>` | The application to write to. |

Creates the file, or overwrites it when it exists.

```bash theme={"system"}
squarecloud app file write config.json --from ./config.json
```

```bash theme={"system"}
cat ./config.json | squarecloud app file write config.json --app <appID>
# Writes stdin as the file content.
```

## `squarecloud app file move`

```bash Usage theme={"system"}
squarecloud app file move <path> <new path> [--app <appID>]
```

**Aliases:** `mv`, `rename`

```bash theme={"system"}
squarecloud app file mv old-name.txt new-name.txt
```

## `squarecloud app file delete`

```bash Usage theme={"system"}
squarecloud app file delete <path> [-y] [--app <appID>]
```

**Aliases:** `rm`

| Flag | Description |
| - | - |
| `-y`, `--yes` | Skips the confirmation prompt. |
| `--app <appID>` | The application to change. |

Asks for `y/N` confirmation, then deletes the file.

```bash theme={"system"}
squarecloud app file rm old-log.txt -y
```

## Related

| Command | API | JavaScript SDK |
| - | - | - |
| `list` | [`GET .../files`](/en/api-reference/endpoint/apps/filemanager/list) | [`api.apps.files.list()`](/en/sdks/js/managing_files) |
| `read` | [`GET .../files/content`](/en/api-reference/endpoint/apps/filemanager/content) | [`api.apps.files.read()`](/en/sdks/js/managing_files) |
| `write` | [`PUT .../files`](/en/api-reference/endpoint/apps/filemanager/put) | [`api.apps.files.write()`](/en/sdks/js/managing_files) |
| `move` | [`PATCH .../files`](/en/api-reference/endpoint/apps/filemanager/patch) | [`api.apps.files.move()`](/en/sdks/js/managing_files) |
| `delete` | [`DELETE .../files`](/en/api-reference/endpoint/apps/filemanager/delete) | [`api.apps.files.delete()`](/en/sdks/js/managing_files) |

To send a whole folder in one step, use [`squarecloud commit`](/en/cli-reference/deploy#squarecloud-commit).
