Command-line interface
Run scripts, read logs, and move files from your terminal or a coding agent.
ChatGPT, Claude, and other AI assistants
Run your scripts and check runs from another AI assistant.
Script file structure
Each script is a folder in a workspace, with aSKILL.md definition, source files, and optional assets.
Script definition
SKILL.md is the script’s definition. It follows the Agent Skills format: YAML frontmatter, then a Markdown body. Each fenced yaml block in the body declares one block. Prose between the fences is the script’s documentation in the app.
Frontmatter fields
Legacy scripts may still contain
flow.script.yaml. Importing one converts it to SKILL.md.
Block fields
Don’t write
type, outputs, or integrations in a fence. Script.it reads them from the block’s source.
Writing a block in Python
A block is a Python file with a function decorated with@block(). Its typed Inputs class is what people see and edit on the block’s card. Returning a dict succeeds, and each key becomes an output later blocks can read. Raising an exception fails the block.
- Inputs.
titleis the field’s label anddescriptionits help text.json_schema_extra={"ui_hint": {...}}picks a widget, such asdropdown,slider,checkbox,file-reference,folder-picker, ordate-picker. Defaults belong on theInputsfields. - Outputs. An optional
Outputsclass declares the files the block writes, so the app can show them. - Integrations.
ctx.http(url, "<integration>", ...)calls an API through a connected integration and takes the usualrequestsarguments. Your code never handles credentials. - Logging.
ctx.log(message)adds a line to the block’s timeline.ctx.log_artifact(path, name=...)names a file on it. - Folders. The working directory is the block’s output folder (
ctx.data_dir).ctx.script_data_diris the script’sassets/.
Python packages
Common packages come pre-installed, includingpandas, numpy, httpx, openpyxl, python-docx, pypdf, beautifulsoup4, jinja2, and pyyaml. For anything else, add a line to the workspace’s requirements.txt. Script.it installs it for everyone who uses the workspace, including triggered runs.
Expressions
Use${{ ... }} in a block’s source_file, output_directory, inputs, and env, and in script input defaults.
A value that is only an expression keeps its type, so
${{ inputs.replicas }} stays a number. An expression inside a longer string makes a string.
Functions
link(path) returns the app link that opens a script on its page, or a file or folder in the file view, beside the session. Use it when a script sends someone a link to something it made, instead of building app URLs by hand:
link() takes two options: layout — "split" (the default, beside the session) or "full" — and session — "current" (the default) or "new".
To write a literal ${{ text }}, escape it as $${{ text }}.
What people see of a block’s results
- Summary. A file named
output.mdoroutput.htmlin a block’s output folder is shown as that block’s summary on its card. - HTML.
.htmlfiles render in a sandboxed frame with JavaScript on. Browser storage and cookies aren’t available inside it. - JSON.
.jsonfiles open in an editor that can show tables, record pages, and boards.
Agents and permission files
A script can run an Agent: an AI agent with its own instructions, model, time limit, and permission, invoked from a Python block. An Agent is defined in an.agent.md file, usually in the script’s assets/:
.agent.md, is its name. See Agents.
A permission file (*.permission.yaml) holds a permission in its own file, so several Agents can share one. The same format defines the permission profiles you pick for a session in the composer. The app shows a permission file as a form, with a toggle to see the YAML. See Permission profiles.
Runtime files
Script files and session files are separate:- Script files live in the script’s folder and are shared with everyone who can see the workspace.
- Script assets live in
assets/and persist across sessions. - Session files live in the session’s
data_files/: block outputs (each in its block’soutput_directory), attachments, and trigger payloads. - Run records and logs belong to the session that ran them.
Agent context fields
The script header’s Agent Context setting maps to the frontmatter:
See Agent context for user-facing guidance.
Trigger payloads
When a trigger runs a script, Script.it runs it in a session and passes the event data into that session.- Webhook triggers receive the HTTP request body.
- App event triggers receive event data from the connected tool.
- Schedule triggers receive schedule metadata such as the scheduled time.
${{ session.data_files }}/trigger_event.json.
Schedules and cron
Schedule triggers can use presets or a custom five-field cron expression:
Cron expressions use the timezone configured on the trigger.
Integrations and credentials
Integrations use OAuth, API keys, or custom headers depending on the service. Script.it stores integration credentials encrypted and never writes them into script source files or chat history. Blocks call integrations throughctx.http, so code never sees the credentials.
Custom integrations use a two-layer model:
- The integration type defines the API shape: base URL, auth mode, OAuth URLs, docs URL, logo, and schema.
- The connection stores one user’s credentials for that type.
Versioning
Scripts in a workspace are version-controlled. Script.it saves a version at the end of every agent turn that changed a script. To go back, click the history button beside Run in the script header, pick a version, click Restore version, and confirm with Restore this version. Restoring brings backSKILL.md and the script’s source files as they were in that version, and removes source files added since. Assets, logs, and run outputs stay as they are. The restore is saved as a new version, so nothing in the history is lost. You can also ask the agent to undo a change. See Outlines, comments, and history.