CLI
Discover the catalogue for an API key, then deploy defineWorkflow, defineAgent, and defineEntityType definitions.
The @lunnoa/client CLI does two jobs: discover what a key can see, and deploy local define* files so they appear in Automate. Prefer the CLI for both. Thin SDK upsert helpers exist as an implementation detail.
Auth is the same everywhere: --url / LUNNOA_URL, --api-key / LUNNOA_API_KEY, optional --access-token, and --project-id / LUNNOA_PROJECT_ID where a project is required. Optional lunnoa.config.ts (or .mjs / .js / .json) in the working directory can supply the same values. Use --json when a coding agent is reading the output.
Discover
tools list is compact. tools get prints inputConfig, field summaries, and a defineAction({ id, appId, input }) sketch. --for-agent keeps only catalogue entries marked availableForAgent. --app scopes tools and connections to one workflow app.
Typical coding-agent loop: tools list or tools search → tools get for the schema → write defineAction → deploy. connections list supplies the Connection instance UUID when a tool needsConnection. projects list supplies --project-id for workflow and agent deploy.
There is no actions run CLI command. Run catalogue actions from code (actions.run / runs.start). See Run actions and Discovery.
Deploy
| Definition | Upsert key | Scope | CLI |
|---|---|---|---|
defineWorkflow | project-scoped slug | Project | workflows deploy |
defineAgent | project-scoped slug | Project | agents deploy |
defineEntityType | workspace-scoped slug | Workspace | entity-types deploy |
You can also list what is already deployed: workflows list, agents list, entity-types list. Redeploying the same slug updates the row and keeps managedByCode: true.
For TypeScript definition files, run under Node with --experimental-strip-types (Node ≥ 22) or use tsx.
Definition file shape
Export defineWorkflow(…), defineAgent(…), or defineEntityType(…) as default, or as workflow / agent / entityType. Nested defineWorkflow tools on an agent are deployed first, then linked via workflowIds.
What gets written
- Real
Workflow/Agent/ObjectTyperows (visible in Automate) slug+managedByCodeset for code-managed identity- Workflow graph: manual trigger → linear catalogue-action steps
- Entity types:
attributeSchema/ optionalstateSchema,schemaRevisionbumped on schema changes,allowUnknownAttributesdefaultfalse