Skip to main content

Source files and the editor

When you deploy an agent, the platform also stores your source files so you can read them later, change one of them, and rebuild without re-uploading anything. This page covers the files API, the redeploy endpoint, what the console can and cannot do with stored source, and what happens when no source is stored.

What gets stored

Deploying an agent uploads a .tar.gz of your code. The platform builds that into an image and keeps a copy of the files as editable source.

Two limits matter. Storage is best-effort, meaning the platform tries to keep the copy but does not promise it. And it holds the latest version only — no history, no git, no undo. The API says as much itself: every file listing carries the note latest version only - the platform keeps no history, so copy anything you want to keep. Keep your real source of truth in your own repository.

These are management routes: sign in, owner or project admin only.

The files API

MethodPathBehavior
GET/v1/agents/{name}/filesList stored files
GET/v1/agents/{name}/files/{path}Read one file
PUT/v1/agents/{name}/files/{path}Create or overwrite one file
DELETE/v1/agents/{name}/files/{path}Delete one file
GET/v1/agents/{name}/code.zipDownload the whole stored source as a zip
POST/v1/agents/{name}/redeployRebuild the agent from the stored source

The three interfaces are not equally granular, and it is worth knowing why before you pick one. The API and the CLI address one file at a time, and a write is a save that does not rebuild anything. The console's editor works on the whole tree at once and its only save button is Build and deploy — every console edit is also a deploy.

List files

platformctl agents files list research-buddy

You should see:

PATH SIZE UPDATED
agent.py 512 B 2026-08-10T09:12:00Z
requirements.txt 64 B 2026-08-10T09:12:00Z

An agent with nothing stored prints no files stored for this agent rather than failing.

Read a file

platformctl agents files get research-buddy agent.py

The default output is the file itself, unadorned, so it redirects straight to disk:

platformctl agents files get research-buddy agent.py > agent.py

Add -o json for the API's full object instead — path, content, and updated_at.

Edit a file

platformctl agents files put research-buddy agent.py --from ./agent.py

--from - reads stdin instead. The stored source is text: a file that is not valid UTF-8 is refused before it is uploaded, rather than stored with its bytes mangled.

On the CLI and API paths, the note means what it says: saving a file changes stored source only. The running agent still runs the image it was built from until you redeploy.

Delete a file

platformctl agents files delete research-buddy old_helper.py

You should see:

deleted old_helper.py from agent research-buddy

There is no Console tab here. The editor's tab close button only removes a file you added in that same dialog, never one already stored. To drop a stored file from the browser, deploy an upload that leaves it out — which is the whole-tree replacement described under the console editor, and it deletes everything else you omit too.

Redeploy from stored source

When your edits are ready, rebuild the agent from what's stored — no tarball, no upload.

platformctl agents redeploy research-buddy

You should see:

agent research-buddy
build_id 8c41…
files 2
note rebuilding from the stored source

The build runs in the background; platformctl status research-buddy is where it finishes.

This runs the same build steps as a normal deploy, and rolls a new revision.

Download the source as a zip

GET /v1/agents/{name}/code.zip streams the whole stored tree as a zip, with every file under a <name>/ top directory so unzipping makes a folder.

platformctl agents files download research-buddy

You should see:

wrote research-buddy-code.zip (915 bytes)

-o <file> names the output, and -o - writes the zip to stdout.

The console editor

Functions have the same editor under Update source on the function's detail page; the deploy dialogs for both use the same tabbed editor in their Write code mode, pre-filled with a working starter for the framework you pick: agent.py (ADK), crew.py (CrewAI), or graph.py (LangGraph), plus a requirements.txt. Switching frameworks resets the starter, so choose the framework first. The other two modes are Upload files or a folder and Upload a .tar.gz you already have.

Deploying an existing name — from Edit code, Update source, or the deploy dialog — replaces the agent's whole stored source. Edit code and Update source open every stored file as a tab, so what you see is exactly what will be stored; the upload modes send exactly what you upload, and any stored file you did not include is deleted. There is no history to fall back on.

An agent deployed before source storage existed has nothing to edit; Edit code says so and the fix is one redeploy (platformctl deploy <dir>), after which its code is stored, editable, and downloadable.

Binary files

The browser upload refuses binary files — images, compiled libraries, anything that is not text — and names the file it rejected. The stored-source API handles text only as well. If your agent needs binary assets, deploy with a .tar.gz, either through the browser's tarball mode or with platformctl deploy. Binary content survives on that path and no other.

When no source is stored

Source storage is best-effort, so an agent can exist with no stored files at all — if the write failed at deploy time, for instance. Redeploying that agent fails with 400:

no source is stored for this agent - deploy it once from the CLI or upload files first

The fix is in the message: deploy once with platformctl deploy <dir> (which uploads and stores the source), or create the files with PUT /v1/agents/{name}/files/{path} first, then redeploy.

Limits

LimitValue
Per file1 MiB
Files per agent200
Uploaded archive, expanded64 MiB
History keptNone — latest version only
Symlinks, or paths in an archive that point outside itRejected
Binary contentOnly via the .tar.gz upload path

Next steps