Skip to content
Documentation
On this page

Build an app

Write a TypeScript Executor app with index.ts and package.json, create it with executor apps create, and deploy it with executor apps deploy.

An Executor app is a TypeScript package with a root index.ts and a package.json pinning the exact apps framework version. Create apps with executor apps create, activate them with executor apps deploy, and update them with executor apps source, executor apps commit, or Git. This works on Local, Self-host, and Cloud.

The command that matters most: run executor apps framework for the exact apps version, then executor apps create --name "<Name>" --files ./my-app and executor apps deploy --app <app-id> --files ./my-app.

Prerequisites and permissions: install executor (2.0.0-beta.79). Local needs no sign-in. On Cloud and Self-host, any organization member can create an app; editing and deploying an existing app requires being its creator or an admin or owner.

You’ll know it worked when… executor apps deploy returns a version JSON object and the app’s tools run from the Tools tab or MCP.

How to use it

Every app starts with two files:

  • package.json with dependencies.apps pinned to the exact version printed by executor apps framework (no ^ or ~ range).
  • index.ts exporting defineApp(requirements, definition) as the default export.

Local

The CLI targets the local background Executor by default and starts it if needed.

Check the host's apps version

executor apps framework

Copy the returned version (for example 0.0.1-beta.148) into dependencies.apps in package.json.

Create and deploy the app

Pass your app directory to executor apps create, then deploy the returned app id:

APP_ID=$(executor apps create --name "Hello" --files ./hello | node -pe 'JSON.parse(require("fs").readFileSync(0, "utf8")).id')
executor apps deploy --app "$APP_ID" --files ./hello

If you run a manual local server instead of the background service, pass --host http://127.0.0.1:4312 and set EXECUTOR_API_KEY.

Cloud

Sign in for app commands

executor apps login

Open the printed URL in your browser and approve the code. executor apps login defaults to https://api.executor.sh and remembers both the host and the organization you approved. For non-interactive scripts, set EXECUTOR_ACCESS_TOKEN and pass --organization <org-id> with --host https://api.executor.sh.

Pin the version, create, and deploy

executor apps framework
APP_ID=$(executor apps create --name "Hello" --files ./hello | node -pe 'JSON.parse(require("fs").readFileSync(0, "utf8")).id')
executor apps deploy --app "$APP_ID" --files ./hello

Self-host

Sign in against your self-hosted origin first, then run the same create and deploy commands:

executor apps login --host https://executor.example.com
executor apps framework
APP_ID=$(executor apps create --name "Hello" --files ./hello | node -pe 'JSON.parse(require("fs").readFileSync(0, "utf8")).id')
executor apps deploy --app "$APP_ID" --files ./hello

You can also set EXECUTOR_HOST=https://executor.example.com instead of passing --host on each command.

Deploying

executor apps create saves source files without building or running them. executor apps deploy compiles the app, runs any SQL migrations, and activates the new version only if the build succeeds. A failed build leaves the active version running and reports the failing stage, file, and line.

Updating an existing app

To edit an existing app safely from a shell:

  1. Download the working source into an empty directory with executor apps source --app <app-id> --out ./hello.
  2. Edit files locally, then either deploy directly with executor apps deploy --app <app-id> --files ./hello, or save a commit first with executor apps commit --app <app-id> --files ./hello --expected <commit> --message "Update greeting" and deploy it with executor apps deploy --app <app-id> --commit <new-commit>.
  3. Inspect previous commits with executor apps history --app <app-id>.

executor apps commit saves a complete snapshot: any file omitted from --files is deleted from the working source, and the command reports removed.count and up to 100 removed paths.

For apps larger than 16 MiB (for example with large binary assets in ui/public/), push through the app’s Git remote instead. Print the remote URL with executor apps git --app <app-id> and configure executor apps credential as the Git credential helper (credential.useHttpPath=true after an empty credential.helper), then deploy the pushed commit with executor apps deploy --app <app-id> --commit <sha>.

Deploying through an agent over MCP

Agents with access to the built-in Executor app can create, read, commit, and deploy apps directly through MCP tools:

  • tools.executor.framework.release({}) returns the exact apps version for package.json.
  • tools.executor.apps.create({ name, files }) creates an app from { path, content } pairs.
  • tools.executor.apps.source({ app }) reads the working source and current commit revision.
  • tools.executor.apps.commit({ app, expected, message, files }) saves a new commit.
  • tools.executor.apps.deploy({ app, commit }) builds and activates that commit.

Example

Save these two files in ./hello, replacing 0.0.1-beta.148 with the version executor apps framework prints for your host:

{
  "name": "hello-app",
  "private": true,
  "dependencies": {
    "apps": "0.0.1-beta.148"
  }
}
import { defineApp, object, query, router, string } from "apps";

const greet = query(
  {
    description: "Greet someone by name",
    input: object({ name: string() }),
    output: object({ message: string() }),
  },
  async (_ctx, { name }) => ({
    message: `Hello, ${name}!`,
  }),
);

export default defineApp({}, { tools: router({ greet }) });

Create and deploy the folder:

APP_ID=$(executor apps create --name "Hello" --files ./hello | node -pe 'JSON.parse(require("fs").readFileSync(0, "utf8")).id')
executor apps deploy --app "$APP_ID" --files ./hello

Limits

  • Host resolution order: executor apps commands resolve their target in this order: --host, then EXECUTOR_HOST, then the last host signed in with executor apps login, then the local background Executor. Pass --host or EXECUTOR_HOST explicitly if you switch between Local and Cloud.
  • Exact apps version: package.json must declare dependencies.apps as an exact version string. Omitting it or using a range fails the build.
  • Source size bounds: code outside ui/public/ must be UTF-8 text, at most 4,096 files and 16 MiB total, and each of your own JavaScript or TypeScript files is at most 2,000,000 bytes (JSON files and imported npm packages are outside the per-file JS/TS limit). Files under ui/public/ may be binary: up to 10,000 files, at most 32 MB per file, and 1 GB total.
  • Git push size on hosted servers: a source directory over 16 MiB is pushed with Git rather than sent inline. On hosted Executor, a single Git push larger than about 64 MiB of packed data fails; split large ui/public/ additions across smaller commits.
  • No secrets in source: never hardcode API keys or tokens in app files. If you later publish the app to the registry, the chosen commit’s source files are shared publicly. Use Accounts and providers for credentials.

Was this page helpful?