n nesly

nesly CLI

Every command, its flags and what it prints.

Account

nesly login Sign in with the device flow and store the token.
nesly whoami Show the signed-in account and which API is in use.
nesly logout Remove the stored credentials from this machine.
nesly token create <name> Create an access token for CI (shown once).
nesly token list List your access tokens and when they were last used.
nesly token revoke <id> Revoke a token immediately.

Projects

nesly new [template] [dir] Start from a template (no argument lists the gallery).
nesly project create <name> Create a project and print its address.
nesly project list List your projects.
nesly project delete <name> --yes Delete a project, its deployments and its addons.
nesly link <project> Link this directory to a project (writes .nesly/project.json).
nesly open Open the project's URL in your browser.

Deploying

nesly deploy Build and publish the current directory; prints the live URL.
nesly deploy --yes Same, creating and linking the project if it does not exist.
nesly ls List deployments, newest first, with their ids.
nesly inspect <deployment-id> Status, tier, failure reason and URLs for one deployment.
nesly rollback <deployment-id> Repoint traffic at a previous deployment, instantly.
nesly logs --follow Stream build and runtime output.
nesly diagnose Explain a failed deployment: evidence, missing env vars, the fix.
nesly mcp Serve the platform as MCP tools on stdio, for AI agents.

Builds

nesly init Detect the framework here and write nesly.toml.
nesly build show Show the build settings and what this directory would build.
nesly build set --output dist Change a build setting (root, install, command, output, start).
nesly build clear [field...] Hand a setting back to nesly.toml and detection.

Configuration

nesly env set KEY=VALUE Set variables; they apply to the next deployment.
nesly env ls [--reveal] List variables; values are hidden unless --reveal.
nesly env rm KEY Remove a variable.
nesly addon add postgres Attach a managed PostgreSQL database (injects DATABASE_URL).
nesly addon add mssql Attach a managed SQL Server database (also injects ConnectionStrings__Default for .NET).
nesly addon ls List attached addons.
nesly addon rm postgres --yes Detach an addon.
nesly backup create Copy the project's database now (nightly copies happen anyway).
nesly backup ls List backups, newest first, with sizes.
nesly backup restore <id> --yes Replace the database's contents with that copy.
nesly backup download <id> Download the archive; pg_restore reads it anywhere.
nesly run -- <cmd> Run a command in the deployed image; exits with its exit code.
nesly domain add <fqdn> Add a custom domain (root domains get A records) and print what to create.
nesly domain verify <fqdn> Check the DNS records and activate the domain.
nesly domain ls List domains and their status.
nesly usage Requests, egress and build time for the last 30 days.
nesly limits What your plan allows and how much of it you have used.
nesly account export Download everything the platform holds about your account.
nesly account notifications ls The messages we sent you, and whether they arrived.
nesly account notifications set Choose which messages reach you, and in which language.
nesly account close --confirm <email> --yes Close the account and destroy everything in it.

Flags on every command

--project <name> Act on this project instead of the linked one.
--dir <path> Use another directory as the project root (default: .).
--json Print exactly one JSON object on stdout — for scripts and agents.
--yes Confirm destructive actions and create a missing project.
--api <host:port> Point at another platform (or set NESLY_API).

Environment variables

For CI: create a token with nesly token create "github actions", store it as a secret, and the pipeline deploys as you — with your role in the team. Leave the team and the token stops working.

NESLY_TOKEN An access token. Set it in CI and every command uses it — no browser sign-in.
NESLY_API The platform API address, when it is not the default.

Exit codes

Stable, so scripts can branch on them. Errors go to stderr; results go to stdout.

0 success
1 error
2 usage error
3 not signed in, or not allowed
4 not found
5 conflict (already exists, wrong state)

Scripting and agents

With --json every command prints one object on stdout and nothing else; progress and logs stay on stderr. That, plus the exit codes above, is the whole contract — no output parsing required.

nesly deploy --json | jq -r .url