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

# celesto sandbox file

> Use celesto sandbox file to upload files into a sandbox or download files back to your host over SSH or the Celesto guest-agent channel.

`celesto sandbox file` copies individual files between your host and a sandbox. Use it when you need to send a prompt, collect an artifact, or avoid sharing a whole folder.

## Synopsis

```bash theme={null}
celesto sandbox file upload <sandbox> <local-path> <guest-path> [OPTIONS]
celesto sandbox file download <sandbox> <guest-path> <local-path> [OPTIONS]
```

## Shared options

**--no-create-dirs** `flag`

Require parent directories to already exist instead of creating them.

**--ssh-key** `string`

Path to an SSH private key when the command uses SSH.

**--ssh-user** `string` (default: root)

SSH user when the command uses SSH.

**--comm-channel** `string`

Host-to-guest control channel. Use `ssh`, `vsock`, or omit it for auto-selection.

**--json** `flag`

Print a JSON envelope instead of formatted text.

## Upload a file

```bash theme={null}
celesto sandbox file upload my-sandbox ./prompt.txt /workspace/prompt.txt
```

Force the guest-agent channel on a recent Linux sandbox:

```bash theme={null}
celesto sandbox file upload my-sandbox ./report.csv /workspace/report.csv --comm-channel vsock
```

## Download a file

```bash theme={null}
celesto sandbox file download my-sandbox /workspace/result.json ./result.json
```

## Use JSON output

```bash theme={null}
celesto sandbox file upload my-sandbox ./input.txt /tmp/input.txt --json
```

```json theme={null}
{
  "ok": true,
  "command": "sandbox.file.upload",
  "exit_code": 0,
  "data": {
    "vm_id": "my-sandbox",
    "local_path": "input.txt",
    "guest_path": "/tmp/input.txt"
  },
  "error": null
}
```

## Related commands

* [Host mounts](https://celesto.ai/docs/celesto/features/host-mounts.md) - Share a whole folder
* [`celesto sandbox env`](https://celesto.ai/docs/celesto/cli/env) - Set config values
* [Control channel](https://celesto.ai/docs/celesto/concepts/control-channel.md) - Learn how file transfer chooses SSH or vsock


## Related topics

- [celesto sandbox env](https://celesto.ai/docs/celesto/cli/env.md)
- [Control channel](https://celesto.ai/docs/celesto/concepts/control-channel.md)
- [Troubleshooting guide](https://celesto.ai/docs/celesto/advanced/troubleshooting.md)
- [CLI overview](https://celesto.ai/docs/celesto/cli/overview.md)
- [Windows sandboxes in Celesto](https://celesto.ai/docs/celesto/guides/windows-guests.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.