Skip to main content
lua apps creates and runs web apps: pages and typed routes that belong to the agent. new writes a new app into the project; dev runs one on your machine. Neither pushes anything. Use lua test webapp to call one route and lua push webapp to create a version. Requires lua-cli 3.42.0 or later.

Synopsis

Description

lua apps new

lua apps new <name> runs in the root of an agent project, where lua.skill.yaml is. It writes src/apps/<name>/: It then edits two project files:
  • src/index.ts: imports the app and adds it to webApps on your new LuaAgent({...}), creating the property when it is missing. When it cannot find the agent, or webApps is not an array, it leaves the file as it is and prints the two lines to add.
  • tsconfig.json: adds src/apps/*/web to exclude, so the agent’s TypeScript build never loads the page project. When the file is not plain JSON (it has comments or trailing commas), it prints the line to add instead.
The name must be lower-case letters, digits, and dashes, starting with a letter. The command never overwrites anything: when src/apps/<name> exists it stops. Run npm install in web/ afterwards; the command prints the next steps.
lua-cli 3.42 to 3.45 also write the page client into web/src/lua/client.ts. To use the @lua-ai-global/app-client package instead, run npm install @lua-ai-global/app-client in web/, change from './lua/client' to from '@lua-ai-global/app-client' in web/src/main.tsx and web/src/App.tsx, and delete web/src/lua/client.ts.

lua apps dev

lua apps dev <name> compiles the project and runs the app locally:
  • The pages are served by the app’s own Vite (the one installed in web/), with hot reload. The command prints the URL.
  • Every route call from the page runs in the sandbox on your machine, as you. Data and env() are the live ones, as for lua test, so writes are real. The project’s .env is loaded once for the whole session.
  • Route files are watched. A change recompiles the routes, and the next call runs the new code. When the recompile fails, the previous routes keep serving and the error is printed.
There is no handoff from a shell locally: the page runs as you without signing in. Ctrl+C stops the server.

Arguments

Options

Examples

Scaffold an app and install its page project:
Output
Run it on a fixed port:
Call one route, then push a version:

Exit codes

See also