Write a file in a machine
instabox_write_fileCreate or replace a file inside a running cloud machine, automatically creating parent directories and overwriting existing content; supports utf8 or base64 content with optional permissions.
Instructions
Create or replace a file inside a RUNNING machine, creating parent directories. Implemented over exec (base64 on stdin), so it is limited to about 700 KB of content; for bigger files use instabox_exec with curl/git inside the machine. Overwrites without asking. Relative paths start at /data/home.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>",
"path": "<path>",
"content": "<content>"
},
"name": "instabox_write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Machine ID (m_...) or its unique name | |
| mode | No | Octal permissions to apply, e.g. 0755 | |
| path | Yes | Absolute path, or relative to /data/home | |
| content | Yes | File content | |
| encoding | No | How `content` is encoded (use base64 for binary) | utf8 |