Skip to main content

write_file

Create or overwrite a project file. The write takes effect on the next run or generation.

warning

The allowlist is strict. Only paths under Features/ or Configurations/ are writable, no .. segments, content at most 262,144 UTF-16 code units (the server calls this “256 KB”). Generated JavaScript under Features/ is writable; a stored file can override a template path under an allowed root. Other template scaffolding is not writable. See Files & configurations.

Request​

PUT /api/v1/ops/projects/{project}/files/content
ParameterInTypeRequiredDescription
projectpathstringyesThe project's public id.
pathbody or querystringyesFile path, e.g. Configurations/Mobile.config.js. A non-empty body path takes precedence over ?path=.
contentbodystringyes (MCP)The full file content (writes are whole-file); REST stores an empty string when omitted/null.
featureIdbodystring or numbernoREST only: associate a file under Features/ with an existing feature id or name. Not valid for configurations.
curl -X PUT -H "Authorization: Bearer $TESTVIBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"path": "Configurations/Mobile.config.js", "content": "module.exports = { … };"}' \
"$TESTVIBE_SERVER/api/v1/ops/projects/$PROJECT/files/content"

Response​

{ "ok": true }

Errors​

HTTPWhen
400 invalid_requestPath missing, outside Features//Configurations/, contains .., or content over 256 KB.
404 not_foundNo such project in this workspace.

When featureId is supplied successfully, the REST response also includes that numeric featureId. This association matters for files intended to run as a feature. The current write_file MCP tool and files put command do not expose this REST-only parameter.