NylorunDocsBeta
Get startedBuildRunDeployReferenceMore

Your project

Understand the generated application, its scripts, and where state lives.

npm create @nylorun/agent writes an ordinary TypeScript application. Agents live under agents/; src/main.ts connects them to the Runtime.

my-agent/
  agents/
    assistant/agent.ts       # the Order assistant and its lookup_order tool
    index.ts                 # exports every agent and workflow
  src/main.ts                # connectAgents({ agents })
  package.json
  tsconfig.json
  .env.example
  .nylorun/
    .gitignore               # contains *
    link.json                # Runtime URL, Host id, Tenant id
    credentials.json         # application key; mode 0600
src/main.ts
import { connectAgents } from "@nylorun/agents";
import { agents } from "../agents/index.js";

await connectAgents({ agents }).ready;

This process is your executor. connectAgents registers the agents with the Tenant, then waits for the Runtime to ask it to run a tool. Your tools always run here, in your code, with your dependencies. It does not serve HTTP; to put agents in front of people, add an app server.

Scripts

ScriptCommandRole
devtsx watch --env-file-if-exists=.env src/main.tsWatch and reconnect the application.
buildcopy assets and run tscProduce dist/agents/ and dist/src/main.js.
startnode dist/src/main.jsConnect the compiled application.
checktsc --noEmitTypecheck without emitting files.

Production dependencies are @nylorun/agents and zod. Development dependencies are tsx, typescript, and @types/node. The project does not install the CLI, Studio, or Runtime; run them with npx.

Where state lives

LocationContentsCommit?
Project .nylorun/Tenant link and application key.No
Host root (NYLORUN_HOME or ~/.nylorun)host.json, host-credentials.json, stack/, and Tenant files.No
Docker volumesPostgres schemas, S2 streams, Restate state, and workspaces.No
.envOne-time model seed and application configuration.No

Sessions and history live in the Runtime's Docker volumes, not in your project. Deleting .nylorun/ unlinks the project without deleting its Tenant; run nylo tenant create or nylo tenant use to link again.

Outside your machine, replace the link with three environment variables: NYLORUN_RUNTIME_URL, NYLORUN_SERVER_KEY, and NYLORUN_TENANT. See App server.

Next step

On this page