nnesly

nesly CLI

Every command, its flags and what it prints.

Quick start

nesly loginsign in (opens the console)
nesly deploy --yesbuild and publish this directory (creates the project)

Later, nesly link <project> points this directory at an existing project.

Account

nesly loginSign in with the device flow and store the token.
nesly whoamiShow the signed-in account and which API is in use.
nesly logoutRemove the stored credentials from this machine.
nesly token create <name>Create an access token for CI (shown once).
nesly token listList 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 listList your projects.
nesly project delete <name> --yesDelete a project, its deployments and its addons.
nesly project infoEverything about one project on a single screen: address, what is live, domains, databases.
nesly project rename <project> <new-name>Change a project's name. Its address does not change, so no link breaks.
nesly project transfer <project> --to <account> --yesTransfer a project to another account you belong to. The site stays up.
nesly link <project>Link this directory to a project (writes .nesly/project.json).
nesly openOpen the project's URL in your browser.

Deploying

nesly deployBuild and publish the current directory; prints the live URL.
nesly deploy --previewDeploy to an address of its own; the live site is left exactly as it is.
nesly deploy https://github.com/owner/repo --yesDeploy a public git repository by URL (also owner/repo, .../tree/<branch>, any https clone URL; --branch, --commit). The platform clones it: nothing is cloned or uploaded from your machine. A public GitLab URL works the same. A private repository goes through `git connect` (GitHub App, or `--provider gitlab`).
nesly deploy --prodDeploy to the live site. This is what a deploy does anyway; the flag says so in a script.
nesly deploy --yesSame, creating and linking the project if it does not exist (the second quick-start step). A deploy that creates the project says so before the build (`project_created: true` in --json); when the account has a project named almost the same, it names it, so a mistyped --project is caught.
nesly deploy --dockerfile deploy/DockerfileBuild the Dockerfile you name (relative to the build root) instead of ./Dockerfile. [build] dockerfile in nesly.toml says the same for every deploy.
nesly deploy --root apps/webBuild a sub-directory of the directory you deploy: a monorepo's app. [build] root in nesly.toml says the same for every deploy.
nesly deploy --temporary --dir distPublish a static site with no account: live at once, deleted after an hour unless claimed. Prints a claim token and the URL last. Containers are refused (exit 2); 3 a day per address.
nesly claim <token>After login: move a temporary project into your account so it stays (a token works once).
nesly deploy --detach --yes --jsonStart the deployment and return at once with its id (state queued or building) and, for a production deploy, the address it will answer at; the platform keeps building.
nesly wait <deployment-id> --timeout 30mWait until the deployment is ready or has ended (failed, cancelled, superseded), then print the same result deploy does. Exit 0 when ready, 1 otherwise. When --timeout runs out the exit code is 1 with reason WAIT_TIMEOUT and the deployment keeps running; wait again.
nesly deploy cancel <deployment-id>Stop a queued or in-progress build before it goes live (`cancel <id>` is the same command). The status becomes cancelled, not failed. Ctrl-C on a waiting deploy does not cancel it: the platform keeps building.
nesly redeploy <deployment-id> --yesStart a new build from the same source as an existing deployment.
nesly deploy --retry <deployment-id>Run a failed production deployment again on the image it built, with the variables as they are now; its release command runs again.
nesly lsList deployments, newest first, with their ids.
nesly inspect [deployment-id]Status, tier, failure reason and URLs for one deployment; without an id, the one serving the project now.
nesly rollback [deployment-id]Repoint traffic at a previous deployment, instantly, with the production variables it last ran with (--keep-env to leave yours); with no id, the release before the live one.
nesly deploy --percent 10Give the new release a tenth of your visitors; the rest stay on the one that is live.
nesly rolloutHow the two releases are doing: the share each has, what it served, what failed.
nesly rollout set 50Change how much of your traffic the new release takes (1-99).
nesly rollout promoteGive the new release everything. You can still roll back to the one it replaced.
nesly rollout abortSend every visitor back to the release that is live. It keeps its address and its logs.
nesly maintenance onShow visitors a page instead of the site — every address, previews included.
nesly maintenance on --message "..."Say it in your own words, in your visitors' language.
nesly maintenance offServe the site again.
nesly maintenanceWhether the page is up, and how long it has been.
nesly logsWhat your application wrote, including after it stopped running (kept for 7 days).
nesly logs --followStream build and runtime output.
nesly psEvery process this project runs, whether it is running, and how much CPU and memory it is using against what it is allowed.
nesly logs --worker <name>Stream one background process instead of the server.
nesly logs drains add <url>Forward everything your application writes to your own log system, signed.
nesly logs drains listWhere this project's logs go, and whether they are arriving.
nesly logs drains test <id>Send one line now and see what your receiver answered.
nesly trafficWhich routes your project served, and which of them failed.
nesly traffic --sort errorsRank routes by how many requests failed inside your application.
nesly traffic failuresThe individual failed requests: the exact status, when, and how long it took.
nesly traffic failures --status 502Only the requests where your application could not be reached.
nesly scanKnown vulnerabilities in the image your deployment runs: the package, the version you have, and the version that fixes it. No finding holds a deploy back; the ones in a package your own lockfile pins are marked.
nesly scan --min-severity highOnly the findings at that severity or above. The totals still describe the whole image.
nesly deps update --yes [--package name]Open a pull request on the project's connected repository that moves the vulnerable packages of your own manifests to the versions that fix them (Go, npm and bun, requirements.txt, pyproject.toml, Pipfile, Gemfile, Composer, Cargo.toml, .NET project files). Only when you ask; a new branch, never merged, never the production branch. The lockfile is regenerated in an isolated build environment and only these packages move; if that fails, the pull request says why and which command to run.
nesly diagnoseExplain a failed deployment: findings, missing env vars, the fix.
nesly mcp setupConnect the AI assistants installed here, so one can deploy and read logs for you.
nesly mcp remove --client <name>Disconnect an assistant again (`--all` for every one, `--dry-run` to look first).
nesly mcpServe the platform as MCP tools on stdio, for MCP clients.

Builds

nesly initDetect the framework here and write nesly.toml.
nesly init --agents-mdAlso create an AGENTS.md that tells an AI assistant how to deploy and what is not its to change; only a new file, never over an existing one.
nesly build showShow the build settings and what this directory would build.
nesly build set --output distChange a build setting (root, install, command, output, start, release, memory); --worker name="command" adds a background process.
nesly build clear [field...]Return a setting to nesly.toml and detection.

Protecting your site

nesly protect showWhether a rate limit is set, and whether it is being applied.
nesly protect set --per-minute 600 --burst 100Limit how quickly one visitor address may load the site. Off by default; the platform never limits your visitors on its own.
nesly protect offRemove the limit.
nesly protect countries --allow TRServe the site only in the countries you list. Visitors whose country cannot be determined are always served.
nesly protect countries --block RU,CNServe everyone except the countries you list.
nesly protect countries --offRemove the country rule.

Deploy hooks

nesly hooks create "contentful, production"Make a URL that rebuilds this project. It is shown once; paste it into the system that should trigger the build.
nesly hooks lsThe project's hooks, how many builds each has started, and when it last fired.
nesly hooks rm <id> --yesRemove one. Its URL stops working immediately.

Scheduled jobs

nesly cron add nightly --schedule "0 3 * * *" -- php artisan schedule:runRun a command inside your application on a clock. Add --timezone to set it in your own time.
nesly cron lsThe schedules on this project and when each one runs next.
nesly cron run <name>Run a schedule now, without waiting for its next time, and print what it printed.
nesly cron run <name> --detachStart it and return, instead of waiting for it to finish.
nesly cron runs <name>The recent runs, with how long each took and what it exited with.
nesly cron logs <name>What the most recent run printed; --run reads an older one.
nesly cron pause <name>Stop it firing without losing the schedule.
nesly cron resume <name>Start firing again.
nesly cron rm <name>Remove the schedule.

Configuration

nesly env set KEY=VALUESet variables; they roll out to the running app within seconds (the old revision serves until the new one is ready).
nesly env set KEYRead the value from standard input instead — a secret written as an argument is visible to anyone who can list processes, and your shell keeps it in its history.
nesly env set --from-file .envImport KEY=VALUE lines from a file, the way another platform exported them.
nesly env set KEY=V --env previewSet a value for one environment only; it wins over the general one.
nesly env ls [--reveal]List variables; values are hidden unless --reveal.
nesly env ls --env previewShow what a preview actually resolves to.
nesly env rm KEY [--env preview]Remove a variable, everywhere or from one environment.
nesly env share KEY --with previewLet previews use production's value for KEY, on purpose.
nesly env request KEY… [--env preview]Ask the person for a secret only they have: prints a console URL where they type it; the value never reaches whoever runs this.
nesly auth protectClose this project's addresses to everyone but your team, at the edge, before your app sees a request.
nesly auth allow ada@client.comLet somebody outside your team in; a whole domain works too (@client.com).
nesly auth clearRemove the sign-in requirement.
nesly auth statusWhether the gate is on, and who may pass it.
nesly auth provider set --kind oidc --issuer https://accounts.google.com --client-id ... --client-secret ...Sign your visitors in with your own Google, Microsoft, OIDC or GitHub app. Your application writes no auth code — it reads X-Nesly-User-Id / Email / Name from the request.
nesly auth provider showWhich provider a project uses, and the one redirect URI to register with it.
nesly auth provider clearGo back to platform sign-in.
nesly protect preview set --password ...Ask for a password before anyone opens your preview addresses.
nesly protect preview tokenCreate a token so CI can reach a protected preview; shown once.
nesly protect preview offOpen preview addresses to anyone with the link again.
nesly protect ip block <addr|range>Block one address or range; allow does the opposite.
nesly protect rule block --path /wp-admin/*Block requests by what they ask for rather than where they come from — a path, a header, or the client's name.
nesly protect rule lsThe request rules on this project, in the order they apply.
nesly activityWho did what in this account, denied attempts included.
nesly bisect --good X --bad Y -- <cmd>Find which release broke something; your command decides.
nesly certs add --cert ... --key ...Serve your own certificate on one of your domains.
nesly deploy --image ghcr.io/...Deploy an image you already built; nothing is uploaded or built.
nesly registry set ghcr.io --username USER --password-stdin --yesStore a pull login for a private third-party registry used by deploy --image. Password from stdin or --password-file.
nesly registry lsList saved private-registry hosts (passwords are never shown).
nesly registry rm ghcr.io --yesRemove a saved private-registry pull login.
nesly logs --request req_...Only the log lines mentioning one request.
nesly run --tty -- bashOpen a shell in a new container from the deployment's image.
nesly env pull [file]Write the variables to a local .env — real secrets, keep it out of git.
nesly env get KEYPrint one value and nothing else, for scripts.
nesly env run -- <cmd>Run a local command with the project's variables, writing nothing to disk.
nesly addon add postgresAttach a managed PostgreSQL database (injects DATABASE_URL).
nesly addon add mysqlAttach a managed MySQL database (injects DATABASE_URL; Laravel DB_* derived).
nesly addon add mssqlAttach a managed SQL Server database (also injects ConnectionStrings__Default for .NET).
nesly addon add valkeyAttach a Redis-compatible key-value store (injects REDIS_URL and VALKEY_URL).
nesly addon add bucketAttach an S3-compatible object-storage bucket (injects AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ENDPOINT_URL, AWS_BUCKET).
nesly fix dsn [--yes]Point a database connection string written for localhost at the project's own variable. Prints the diff; --yes changes the files.
nesly fix show [--deployment id]Print the connection-string change a deployment's build made on its own copy of your code.
nesly fix pr [--deployment id]Open a pull request with that change on the project's connected repository (GitHub, GitLab or Forgejo). Only when you ask; never the production branch.
nesly proxyOpen the project's database on a local port, for TablePlus, DBeaver or any tool you already use.
nesly dbOpen a database prompt using the client installed on this machine (psql, sqlcmd).
nesly addon lsList attached addons.
nesly addon rotate postgres --yesRotate credentials without deleting data; redeploy so the app picks up the new env.
nesly addon rm postgres --yesDetach an addon.
nesly backup createCopy the project's database now (nightly copies happen anyway).
nesly backup lsList backups, newest first, with sizes.
nesly backup restore <id> --yesReplace 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 delegate <fqdn>Manage the domain's DNS here: prints the nameservers to set at your registrar, and after that you create no records at all.
nesly domain verify <fqdn>Check the DNS records now instead of waiting for the next automatic round.
nesly domain verify <fqdn> --waitKeep checking until the domain is live — what you want right after creating the records.
nesly domain lsList domains, their status, and any release they are pinned to.
nesly dns ls <fqdn>List DNS records in a zone whose nameservers point here (after domain delegate + verify).
nesly dns add <fqdn> --type TXT --name mail --value "…"Create or update one DNS record (A, AAAA, CNAME, TXT, MX). Platform records that keep the site online cannot be overwritten.
nesly dns rm <fqdn> --type TXT --name mail --yesDelete DNS records of that type and name. Platform A/challenge records cannot be removed.
nesly domain pin staging.example.com <deployment-id>Make one address serve a specific release while every other address follows new deployments.
nesly domain unpin staging.example.comLet the address follow whatever is live again.
nesly certsThe HTTPS certificate each of your addresses actually serves, and when it expires.
nesly usageRequests, egress and build time for the last 30 days.
nesly limitsWhat your plan allows and how much of it you have used.
nesly egressShared outbound IP addresses for bank and payment-gateway allow lists.
nesly statusActive platform notices (shared engine maintenance). Empty means none. Not project maintenance.
nesly operator notices lsOperator: list platform notices (requires operator grant).
nesly operator notices publish --title T --body B --yesOperator: publish a tenant-visible notice. Optional --severity and --engine.
nesly operator notices resolve ID --yesOperator: hide a notice from tenants.
nesly account lsThe accounts you can work in, and which one commands act on.
nesly account use <name>Work in one of them; remembered until you change it or sign in again.
nesly team lsWho is in this account, their role, and who has not signed in yet.
nesly team invite <email> --role memberInvite a user; they join when they sign in with that address.
nesly team invite <email> --project shopGive a user one project instead of the account. They see nothing else here.
nesly team ls --project shopWho was given that one project.
nesly team remove <email>Remove access, or withdraw an invitation. Their tokens stop working too.
nesly team remove <email> --project shopTake away that one project.
nesly team leaveGive up your own access to the account you are working in.
nesly account exportDownload everything the platform holds about your account.
nesly rm <deployment-id>Remove one deployment and the files it published.
nesly account notifications lsThe messages we sent you, and whether they arrived.
nesly account notifications showWhich messages reach you right now.
nesly account notifications setChoose which messages reach you, and in which language.
nesly account close --confirm <email> --yesClose 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: .).
--jsonPrint exactly one JSON object on stdout — for scripts and agents.
--yesConfirm destructive actions and create a missing project.
--api <host:port>Point at another platform (or set NESLY_API).
--account <name>Work in one of your other accounts for this command only.

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_TOKENAn access token. Set it in CI and every command uses it — no browser sign-in.
NESLY_APIThe platform API address, when it is not the default.
NESLY_ACCOUNTThe account a pipeline works in, when it is not your own.

Exit codes

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

0success
1error (also: a deployment that did not go live — failed, cancelled or superseded — whether `deploy` or `wait` reports it)
2usage error (also: the packed source is over the upload limit; the message names the heaviest directories and what to put in .neslyignore)
3not signed in, or not allowed
4not found
5conflict (already exists, wrong state; a deployment that failed is exit 1, not this)
6approval pending: the action waits for a person's approval; repeat the command with the --approval id it prints

Progress stream

With --json a deploy writes its progress on stderr, one JSON object per line, and nothing else. stdout stays the one result object.

{"step":"build","state":"running","at":"2026-11-18T01:00:01.2Z","detail":"resolving source and starting build"}
{"step":"build","state":"done","at":"2026-11-18T01:00:41.9Z","detail":"","elapsed_s":40.7}

Keys: step, state (running, done, failed or stopped),at (UTC time), detail (text) and, on a done or failedline, elapsed_s: the measured seconds since that step's first line. There is no percentage: nothing measures one. stopped is a step that was still under way when the command stopped waiting (--timeout, Ctrl-C): nothing failed, the deployment keeps going. A step is written only when something happened for it, so a step that did not apply (no push for a static site) is absent, never faked. Without --json the same events are shown as the steps a person reads.

sourcewhat the command was given: a directory, an image or a repository; for a directory also each upload part
detectthe platform's detection line ("detected: <language> (<file> at <dir>), reason: …") or its build plan line ("build plan: …"); a deploy of a ready-made image makes no plan, so there is none
preflightthe start-rule advice from the server (one detail per line, done when the build goes on) and the build's warnings; a passing check with no advice logs nothing, so nothing is written
envhintwritten only when the code reads a variable only an addon provides and the project lacks it; the line names the `nesly addon add` that fixes it
buildthe platform started building
pushthe built image is being pushed to the registry, then pushed; static sites have no push
deploythe platform is starting the new revision
readythe deployment is live; the detail is the URL

Output contract

Without --json the last line of stdout is the address:URL: https://…. What to do next is printed on stderr, ahead of it.

With --json, a successful deploy prints one object (the MCP tooldeploy returns the same one):deployment_id, project, url, state (alwaysready), elapsed_s and, for a container, image_digest: the registry digest of the image the deployment runs. inspect prints the same one, and a rollback or a promote of that deployment runs the same digest. A static site has none. More keys may appear; none of these is removed. A failure prints one object with error, exit_code (the process exit code) and, when known,reason, next (the command that moves forward) and, for a plan limit,upgrade_url. A deployment that did not go live is exit code 1 and carries thereason of its cause (for example START_CRASHLOOP orBUILD_COMPILE_FAILED): the same code diagnose --json reports andthe error list explains. A project that does not exist is exit code 4 with reason PROJECT_NOT_FOUND and the command that creates it. Both are JSON Schemas:/schema/cli-deploy-success.json and/schema/cli-error.json.

deploy --detach prints deployment_id, project, state(queued or building), next and, for a production deploy,url. wait <id> prints the success object when the deployment is ready and an error object (exit code 1) when it ended without going live or when--timeout ran out: that one has reason WAIT_TIMEOUT and the deployment keeps running.

Scripting and agents

With --json every command prints one object on stdout and nothing else; progress and logs stay on stderr.

nesly deploy --json | jq -r .url