create_code
Put code in a space for people to read, edit together live and review: one or more files (a script, a module, a config, a small project). People see the files in a code editor, comment on lines, and see each version as a diff. Read guide topic "code" first. To make a web page or small app people can use, use create_page instead.
Parameters
space_idstringrequiredtitlestringrequiredfilesobject[]requiredShow child attributes
pathstringrequiredcontentstringrequiredmessagestringread_code
A code item's files as they are now, people's live edits included, and its version number. Pass paths to read only some; numbered: true puts line numbers in front of each line (what comments on lines refer to).
Parameters
item_idstringrequiredpathsstring[]numberedbooleanedit_code
Change a code item's files while people may be editing them: everyone with it open sees the change at once, and it becomes a new version with your message (people see it as a diff in History). Read the files first (read_code). Prefer replace with the exact current text for small changes; write a whole file for new files or rewrites. All edits in one call are one version; if one can't apply, none do.
Parameters
item_idstringrequiredmessagestringrequirededitsobject[]requiredShow child attributes
opstringrequiredwrite, replace, delete, rename.pathstringcontentstringfindstringreplacestringallbooleantostringcode_history
The versions of a code item, a page or a report (its files), newest first: number, message, who made it (a person or an agent), when, and which files it changed. People's typing is grouped into one version per person until they pause for five minutes.
Parameters
item_idstringrequiredcode_diff
A unified diff (as git diff prints it) for a code item, a page or a report: what one version changed (version), or between two versions (from, to; to "now" for the files as they are this moment, people's typing included). Pass path for one file.
Parameters
item_idstringrequiredversionintegerfromintegertointeger | "now"pathstringcode_restore
Put a code item's, a page's or a report's files back as they were in a version. It becomes a new version ("Restored version N"); nothing is lost — the versions after it stay in the history.
Parameters
item_idstringrequiredversionintegerrequiredcreate_page
Make a working web page in a space: HTML, CSS and JavaScript that run when people open it — a calculator, a quiz, a tracker, an interactive chart, a game, a simulation, custom 3D, generative art. People use it live, see its code, comment on a part of it or a line, and see each version as a diff. Give index.html (where it starts); put CSS and JavaScript in it or in files beside it (style.css, app.js) that it links. It runs in a sandbox: no localStorage or cookies, and nothing from Artifacts; libraries load from a CDN by full URL. A prototype (a product or app people click through) or a website (a landing page, a site, pricing, docs, an article): before its first write, do the steps of guide topic "prototype" or "website" in order: a template's guide, its rules, one design system read whole, the template's example. It is never designed without them, however short or simple the request. Anything else: guide topic "pages", and page-design, page-games, page-3d, page-simulations or page-art for what it is. A prototype or a website is built one part at a time: give its head, the design system's whole :root block, its styles and first finished part; edit_page adds the rest, a part a call. Run it with render_page and lint_page once it is whole.
Parameters
space_idstringrequiredtitlestringrequiredkindstringprototype, website.htmlstringrequiredfilesobject[]Show child attributes
pathstringrequiredcontentstringrequiredmessagestringread_page
A working page's files (index.html and the files beside it) as they are now, people's live edits included, and its version number. numbered: true puts line numbers in front of each line.
Parameters
item_idstringrequiredpathsstring[]numberedbooleanedit_page
Change a working page's files while people may be using or editing it (a prototype or a website, when it is still empty or is being redesigned: first the steps of guide topic "prototype" or "website", in order — a template's guide, its rules, one design system, the template's example — then one part a call): everyone with it open gets the new page at once, and it becomes a new version with your message. Same edits as edit_code (replace exact text, write a whole file, delete, rename); index.html stays. Run it with render_page after.
Parameters
item_idstringrequiredmessagestringrequirededitsobject[]requiredShow child attributes
opstringrequiredwrite, replace, delete, rename.pathstringcontentstringfindstringreplacestringallbooleantostringrender_page
Run a working page as people see it (scripts on) and check all of it in one call: JavaScript errors, console errors and failed requests; its layout at desktop and phone widths, in words (what sticks out of the frame, text cut off, images and fonts that did not load, small tap targets, leftover placeholders); and pictures of the whole page. For a prototype or a website it also gives the anti-slop findings and whether the page wears the space's brand or a design system: every must_fix is fixed before you hand over. Call it once the page is built, not after every edit. steps clicks and types through it in order — { click: "#add" }, { type: { selector: "#email", text: "a@b.co" } }, { press: "Enter" }, { scroll: 800 }, { wait: 1000 } — and shows it after them. Fix every JavaScript error before you hand a page over.
Parameters
item_idstringrequiredwidthintegerheightintegerfrom_yintegerpicturesbooleanstepsobject[]Show child attributes
clickstringtypeobjectShow child attributes
selectorstringrequiredtextstringrequiredpressstringscrollnumberwaitnumber