CLI configuration
Options every command accepts, how authentication works, the files stored locally, and compute settings.
Common options
Options you can add to any ntro command.
| Option | What it does |
|---|---|
--team <id or slug> | Choose the team for this command. Without it, your default team is used. |
--json | Print results as JSON. Also turns off prompts and the automatic app link from apps create. Errors still print as text, not JSON. |
--verbose | Show each HTTP response's request ID (request-id) on stderr. Include it when you report a problem. |
--no-color | Turn off colors. Colors are also off with the NO_COLOR environment variable (even if empty), with TERM=dumb, and when output is not a terminal. |
--token <token> | Set the credential for this command. See Authentication. |
--api <url> | Change the API address. Default https://api.nitroship.co |
--identity <url> | Change the login server address. Default https://auth.nitroship.co |
--help, --version | Show usage and examples for a command, or the CLI version. |
You rarely need --api or --identity. If you do, the first value found wins: flag → environment variable (NITROSHIP_API_URL, NITROSHIP_IDENTITY_URL) → saved value → default.
Interactive mode and automation
ntro asks for missing arguments and double-checks actions such as deleting or promoting. These prompts appear only when all of the following hold:
- Both stdin and stderr are terminals.
--jsonis not set.- The
CIenvironment variable is not set. (Even an empty value counts as set, meaning automation.)
Automation cannot answer prompts, so:
- Provide every required argument, such as app, team, and deployment IDs, and member emails and roles.
- Add
--yesto actions that need confirmation (delete, cancel, promote, roll back, and so on). - Add
--app <app>when deploying a folder that is not linked.
Authentication
The CLI uses the first credential it finds, in this order:
- The
--tokenflag - The
NITROSHIP_TOKENenvironment variable - The login saved by
ntro login
- For people: log in with
ntro login. See Log in. - For automation: pass an
ntro_API token inNITROSHIP_TOKEN. See API tokens. - Log out:
ntro logoutinvalidates the saved login on the server and removes it from local files.
Either way, the CLI sends a five-minute access token with API requests and renews it automatically when it expires.
Files stored locally
| File | Contents |
|---|---|
~/.nitroship/credentials.json | Your login. The folder is created with 0700 and the file with 0600 permissions. Never commit it to a repository. |
~/.nitroship/update-check.json | The result of the new-version check, cached for 24 hours. |
<project>/.nitroship/app.json | IDs of the app and team this folder is linked to |
Set NITROSHIP_CONFIG_DIR to use another folder instead of ~/.nitroship.
App links
Link a folder to an app and commands run in that folder no longer need --app. The link stores the app ID, so changing the app's slug never requires relinking.
ntro apps create my-app # create an app and link the current folder
ntro link my-app # link the current folder to an existing app (or switch)
ntro unlink # remove the current folder's linkapps createlinks the current folder by default. Add--no-linkto skip it;--jsonalso skips it.- Run
ntro linkwithout an argument to pick from your apps. Automation must name the app. ntro unlinkonly deletes.nitroship/app.json(and the older.nitroship/project.json). It never deletes the app, needs no login, and succeeds even with no link.- Relink if you switch to an app in another team or the linked app moves to a different team.
Which folder's link is read?
ntro deploy <folder> reads the link of the folder being deployed. Every other command reads the link of the folder you are in. That is why ntro deploy ./dist from the project root needs --app: ./dist has no link.
Build framework
Set build.framework in nitroship.json at the deployment root to choose a managed framework explicitly:
{
"build": {
"framework": "nuxt"
}
}The accepted values are exactly:
nextjs,staticnuxt,solidstart,analog,tanstack-start,sveltekit,astro,react-router,remix,angular,qwikgatsby,docusaurus,vitepress,eleventy,hugo,jekyll,mkdocsnestjs,express,fastify,hono,koavite,create-react-applaravel,symfony,wordpress,rails,django,phoenixfastapi,flask,spring-boot,dotnet,go,rust,php
An explicit build.framework wins over automatic detection, even when a root Dockerfile.nitroship or Dockerfile exists. You cannot set both build.framework and build.dockerfile; that combination is an error. To use your own Dockerfile instead, remove build.framework. See Dockerfile.
Without build.framework, detection uses this order:
- The file configured by
build.dockerfile, otherwise a rootDockerfile.nitroship, then a rootDockerfile. - Next.js, using its dedicated adapter.
- The managed framework registry.
- Generic static files if no framework is detected.
Managed presets produce one of four output kinds:
| Kind | Deployment |
|---|---|
static | Static files on the CDN only; no server runtime. |
node-server | A managed Node.js server bundle plus CDN assets. |
container | A generated, non-root OCI image plus CDN assets extracted from /nitroship/static. |
container-static | A generated toolchain image that exports only a static site to the CDN; no server runtime. |
The kind depends on the framework and its configuration; it is not a value for build.framework. For example, Astro can produce static files or a standalone Node.js server. Local deployment supports static and Node.js outputs, including managed Next.js builds; container and container-static presets require hosted builds.
Compute settings
The region and size used to run servers (Next.js, managed Node.js and container presets, or your Dockerfile). Set them under App Settings > Compute in the console or in compute in nitroship.json at the deployment root. Static-only deployments do not need compute settings.
{
"compute": {
"regions": ["kr-icn"],
"tier": "standard",
"minInstances": 0,
"maxInstances": 4,
"port": 3000
}
}| Field | Meaning | Default |
|---|---|---|
regions | Regions to run the server in | None (required) |
tier | CPU and memory size of one instance | standard |
minInstances | Instances kept running per region for the production deployment. Does not apply to previews. | 0 |
maxInstances | The most instances one deployment can scale to per region | 4 |
port | The port your server listens on. Managed preset servers bind to 0.0.0.0:$PORT. | 3000 for managed presets; automatic for your own Dockerfile |
healthPath | The readiness check path. Set only in nitroship.json; the console has no such setting. | /__nitroship/health for new Next.js builds, otherwise none (port connection check only) |
Generated Go/Rust images set PORT (default 3000), but Go/Rust apps must read it and bind to 0.0.0.0:$PORT themselves; the preset cannot change a hard-coded bind address.
On a normal deploy, when a field is set in several places, the first value found for that field wins:
- CLI flags (direct uploads with
--local,--image, or--bundle-dironly) nitroship.json- App settings saved through App Settings > Compute in the console or the compute settings API
- Defaults
Values are locked in when a build starts; saving app settings alone does not change an existing deployment. Console/API editing is always allowed, including regions, tier, instance limits, and port declared in nitroship.json. Use Apply now to redeploy production without rebuilding: non-null console/API values win over the previous deployment's file- or flag-sourced values for that redeploy, while fields left unset retain their previous values.
On every normal deploy, nitroship.json re-applies its declared fields over console/API settings; supported CLI flags still win over the file. Thus Apply now can temporarily override file values, but the next normal deploy restores the precedence above. See Managing deployments.
Cron settings
Declare crons at the top level of nitroship.json, or manage jobs in App Settings > Cron Jobs or through the Cron jobs API. Console/API edits are always allowed and apply immediately. On every production deploy that declares crons (including an empty array), the deployment's list overrides the console list again. A production deployment that does not declare crons falls back to the saved console list; remove the crons key and deploy to hand control back to the console. See Cron jobs.
How readiness is checked
Before a new instance takes requests, Nitroship checks that your app is ready.
- With an empty
healthPath(not set, or""): the app counts as ready once its server port accepts connections. - With a
healthPath(including/): Nitroship sends that path aGETrequest;2xx,3xx, and404count as ready. Each attempt waits up to 2 seconds for response headers and is retried. - Either way, the overall limit is 30 seconds.
A healthPath you set yourself overrides the framework default (/__nitroship/health for Next.js). Older deployments that stored / keep the HTTP check through redeploys, promotions, and rollbacks.