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

# aether file

> Read, write, and manage files in a running workspace

# aether file

Manage files in a running workspace. All file operations are performed over a WebSocket connection to the workspace.

**Alias:** `files`

## Usage

```bash theme={null}
aether file <subcommand> [flags]
```

## Subcommands

| Subcommand           | Description                |
| -------------------- | -------------------------- |
| `list [path]`        | List files and directories |
| `read <path>`        | Read file contents         |
| `write <path>`       | Write content to a file    |
| `mkdir <path>`       | Create a directory         |
| `delete <path>`      | Delete a file or directory |
| `rename <old> <new>` | Rename or move a file      |
| `stat <path>`        | Get file metadata          |

## aether file list

List files and directories at the given path. Defaults to the workspace root.

```bash theme={null}
aether file list [path]
```

```bash theme={null}
aether file list
```

```
NAME                TYPE        SIZE        MODIFIED
src/                directory   -           2025-01-15
package.json        file        1.2 KB      2025-01-15
tsconfig.json       file        320 B       2025-01-10
README.md           file        2.4 KB      2025-01-14
```

```bash theme={null}
aether file list src/components
```

## aether file read

Read the contents of a file.

```bash theme={null}
aether file read <path> [flags]
```

| Flag         | Description                                             |
| ------------ | ------------------------------------------------------- |
| `--encoding` | File encoding (`utf-8`, `base64`). Defaults to `utf-8`. |

```bash theme={null}
aether file read src/index.ts
```

```typescript theme={null}
import express from "express";

const app = express();
app.listen(3000);
```

```bash theme={null}
# Read a binary file as base64
aether file read assets/logo.png --encoding base64
```

## aether file write

Write content to a file. Creates the file if it does not exist, or overwrites it if it does.

```bash theme={null}
aether file write <path> [flags]
```

| Flag         | Description                                                |
| ------------ | ---------------------------------------------------------- |
| `--content`  | File content (required)                                    |
| `--encoding` | Content encoding (`utf-8`, `base64`). Defaults to `utf-8`. |

```bash theme={null}
aether file write src/config.ts --content 'export const PORT = 3000;'
```

```bash theme={null}
# Write a binary file from base64
aether file write assets/icon.png --content "iVBOR..." --encoding base64
```

## aether file mkdir

Create a directory. Creates parent directories as needed.

```bash theme={null}
aether file mkdir <path>
```

```bash theme={null}
aether file mkdir src/components/ui
```

## aether file delete

Delete a file or directory.

```bash theme={null}
aether file delete <path> [flags]
```

| Flag      | Description              |
| --------- | ------------------------ |
| `--force` | Skip confirmation prompt |

```bash theme={null}
aether file delete src/old-module.ts
```

```
Are you sure you want to delete src/old-module.ts? [y/N]
```

## aether file rename

Rename or move a file.

```bash theme={null}
aether file rename <old> <new>
```

```bash theme={null}
aether file rename src/utils.ts src/helpers.ts
```

## aether file stat

Get metadata for a file or directory.

```bash theme={null}
aether file stat <path>
```

```bash theme={null}
aether file stat src/index.ts
```

```
Path:     src/index.ts
Type:     file
Size:     1,234 bytes
Modified: 2025-01-15T10:30:00Z
```
