Commands: diff, deploy, test, chat and more
The deploy API and the Autessa CDK are in preview and not yet released. Names and shapes may change before they are generally available.
A few commands cover the whole loop, from a new project to a deploy. They work the same way in every language. Only the way you call them and a few flag names differ.
The commands
| Command | What it does | Deploy key scope |
|---|---|---|
pull --stage X [--resources ...] | Exports one tenant into autessa.yaml plus tool sources and app files. Use it to start from what you already built in the UI. | DEPLOY_PULL |
build | Writes .autessa/manifest.json and .autessa/files/. Runs locally. No key needed. | none |
diff --stage X | Asks the server what would change. Prints creates, updates, deletes and permission changes. | DEPLOY_DIFF |
deploy --stage X [--prune] | Previews, uploads only the files Autessa does not have yet, applies the change and waits for it to finish. Removes resources you deleted from code only with --prune. | DEPLOY_APPLY |
rollback --stage X [--to <deploymentId>] | Returns the stage to the last good deployment, or to the one you name. | DEPLOY_ROLLBACK |
deployments --stage X | Lists recent deployments for the stage. | a deploy key for the stage |
adopt-app <app> --stage X [--dir folder] | TypeScript only. Brings an app built in the web app under a repo. Writes a project with the app and what it uses, a README and a GitHub deploy workflow, then checks it offline. Only reads from the tenant, and never overwrites a file. The first deploy takes the app over with --adopt. | DEPLOY_PULL |
chat <AgentLogicalId> --stage X | Chats with the agent in the stage's tenant, with the tools deployed there. Nothing is deployed. See Chat with it in a stage's tenant. | HARNESS_CHAT |
These run on your machine, with no account or network unless noted:
| Command | What it does |
|---|---|
init agent <name> | Writes a new agent project. Never overwrites a file. See Build an agent in code. |
test [--only text] | Runs tests/**/*.test.yaml against a local fake Autessa. |
test --before-deploy | Runs the offline checks a deploy runs first, and exits 7 on a problem. |
dev [--port n] [--apps a,b] | Serves the project's apps locally from port 5400, with sample data from autessa.dev.yaml. |
chat <AgentLogicalId> | Talks to a project agent here: Autessa's models answer and the project's tools run locally. Needs a key; --stub runs without one. See Chat with it on your machine. |
Run them anywhere
# Python
autessa-cdk diff --stage dev
# TypeScript
npx autessa-cdk diff --stage dev
# Java (Maven)
mvn autessa-cdk:diff -Dautessa.stage=dev
# Java (Gradle)
./gradlew autessaDiff -Pautessa.stage=dev
Maven goals are autessa-cdk:<command>: build, diff, deploy, rollback, deployments, pull, test, dev, chat and init. Gradle tasks are autessa<Command>, for example autessaDiff or autessaChat. Options are properties: -Dautessa.<option> in Maven, -Pautessa.<option> in Gradle.
The deploy action and Autessa Pipelines run the same commands.
Flags
| What | Python | TypeScript | Maven / Gradle |
|---|---|---|---|
| Stage | --stage dev | --stage dev | autessa.stage=dev |
| Fan-out group | --stage customers | --fanout customers (add --tenant <id> for one tenant) | autessa.stage=customers |
| Delete removed resources | --prune | --prune | autessa.prune |
Fail diff when access widens | --fail-on-widen | --fail-on-widen | autessa.failOnWiden |
| Deploy a change that widens access | --allow-widen | --allow-widen | autessa.allowWiden=true |
| Deploy a change that costs money | --allow-purchase | --allow-purchase | autessa.allowPurchase=true |
| Take over a resource already in the tenant | --adopt | --adopt | autessa.adopt=true |
| Drop columns and their data | --allow-destructive | --allow-destructive | autessa.allowDestructive=true |
| Skip the offline checks | --skip-checks | --skip-checks | autessa.skipChecks=true |
| Skip app builds | --no-build | --skip-build | |
| Don't wait for the deploy | --no-wait | autessa.wait=false | |
| Deploy without a prompt | --yes | not needed | not needed |
| Rollback target | --to <id> | --to <id> | autessa.to=<id> |
| Project folder | --dir <dir> | -C <dir> | autessa.projectDir |
| Machine-readable output | --json (diff) | --json |
autessa-cdk deploy in Python asks before it deploys. In CI, pass --yes.
deploy runs the preview first and stops, without changing anything, when a change widens access, costs money, takes over an existing resource, or deletes data, unless you pass the matching flag. Review the diff, then run it again with the flag. Buying a phone number also needs allowPhonePurchase: true on the stage.
Exit codes
The same in the Python and TypeScript command lines and the deploy action:
| Code | Meaning |
|---|---|
| 0 | OK |
| 1 | Error: a request failed, or a deployment ended FAILED |
| 2 | Usage: bad flags, arguments or project files |
| 3 | Refused: a change widens access (deploy without --allow-widen, or diff --fail-on-widen) |
| 4 | Refused: a change costs money (deploy without --allow-purchase) |
| 5 | Refused: a change takes over an existing resource (deploy without --adopt) |
| 6 | Refused: a change deletes data (deploy without --allow-destructive) |
| 7 | Refused: the offline checks found a problem (test --before-deploy, or deploy) |
When several refusals apply, the lowest code wins. Maven and Gradle fail the build instead, with a message that names the flag to add.
Reading a diff
$ autessa-cdk diff --stage dev
Changes for stage dev
+ create Agent FaqAgent
+ create Grant ReadersUseAgent
! access Grant ReadersUseAgent none -> ROLE:Readers USE WIDENS
+ create Role Readers
+ create Table Faq
4 to create, 0 to update, 0 to delete, 1 access change(s), 1 change WIDENS access.
Review before you deploy. These give more access than before:
- Grant ReadersUseAgent
+,~and-are create, update and delete.WIDENSmarks any change that gives someone more access than they have now. The TypeScript CLI and the deploy action printWIDENS ACCESS.- Permissions changed in the tenant outside the project are listed separately as drift.
- The exact layout differs a little between runners.
- Nothing changes until you run
deploy.
Deploy behavior
- Idempotent. Running
deploytwice makes no second change. Resources are matched bylogicalId. - Published. A deploy publishes each resource, so apps and API calls use the new version.
- Safe by default. Without
--prune, a resource you remove from code stays in the tenant. - Tracked. Each deploy gets a
deploymentId. Status moves fromRUNNINGtoSUCCEEDED,FAILEDorROLLED_BACK.
Watch deployments
Every deploy and rollback shows up in Autessa, whichever way you ran it:
- Build > Deployments lists the company's deployments: the stage, status, who or what started it, and when.
- A deployment's page shows its progress step by step, live while it runs, then every change it made, grouped by kind, with access changes, purchases, adopted resources and deleted data called out. If it stopped, it says at which step.
- Organization deployments, in the Company group of the navigation, shows deployments across all your tenants, and your Autessa Pipelines as chains of stages with each stage's latest run.
Each deployment says where it came from: the command line, the API, a pipeline, or a GitHub Actions run. A deploy from the deploy action shows the repository, the commit and a link to the run. Only names and links are sent, never a secret.
Taking over what's already in a tenant
A resource in the project with the same name as one already in the tenant isn't copied. The diff marks it ADOPT, and a deploy stops until you pass --adopt. The project's version then replaces it, and the stage owns it from then on.
- Only what you can read in the tenant is matched, and never what another stage of the same company owns.
- If two resources share the name, the deploy stops and asks you to rename one.
- Columns on an adopted table that the project doesn't declare are left alone, and the diff names them.
Changing a table
| Change | What happens |
|---|---|
| Add a column | Applied. |
| Drop a column | Shown as -column name (deletes its data) and marked DELETES DATA. Needs --allow-destructive. A rollback never deletes a column. |
| Turn an index on or off, add a select option | Applied. |
| Change a column's type, mask or unmask a column, remove a select option, change any other column setting, rename a table | Refused on the preview, with what to do instead: add a new column, copy the data across, then drop the old one. |
A project that uses masked columns needs them turned on for the company. The preview says so before anything changes.
Edits made in the tenant
diff compares with the tenant as it is, not only with the last deploy. A tool, agent, table or schedule edited by hand since the last deploy shows as edited in the tenant, and the next deploy puts the project's version back. Files in an app aren't compared this way.
Pull
pull works on one tenant. It writes autessa.yaml and downloads tool sources and app files.
Pull with --stage, and anything that stage deployed and nobody has edited comes back as your project wrote it, with its logical ids, {{ref:...}} tokens and variables, so the next diff shows no changes. Anything edited in the tenant comes back as it is there, and diff shows it. --resources takes logical ids, resource kinds such as tools, or both, and a logical id brings what it depends on.
- Python stops if
autessa.yamlor a source file already exists. Pass--forceto replace them. - TypeScript, Maven and Gradle write
autessa.pulled.yamlwhen a project file already exists, and skip existing source files. Pass--force(autessa.force) to overwrite. --include source,apps(Python and TypeScript) picks what to download. Both are the default.
API reference
The commands call the Deploy API: files to upload the build's files, preview for diff, apply for deploy, rollback, deployments, and export for pull.
Example
Run these commands against a complete app, autessa-cdk-sample, or a whole tenant: autessa-as-code-tenant.