.niteshift/. When
a task starts, Niteshift checks out your repository and any other repositories it needs. Then it
runs your setup and brings up your declared services automatically.
The .niteshift directory may contain these files:
.niteshift/setup: finite work for a fresh environment. Installs, builds, migrations, seeds..niteshift/resume: recovery work that runs each time a suspended task resumes..niteshift/services.yaml: the long-running processes Niteshift supervises. Dev servers, databases, workers. Ports declared here become preview URLs..niteshift/instructions.md: custom instructions added to every task’s system prompt on this repository..niteshift/settings.yaml: additional repositories, cloud integrations, and other settings.
settings.yaml file is the only required file, though it only needs to contain a version: 1
entry to be valid.
The agent may add additional helpers as needed (scripts, container definitions) under
.niteshift/files/.
Configuring an environment
You don’t write these files by hand. From Settings → Environments → [environment], click Set up with agent. A task works out how to install, run, and verify your project. It tests the setup and then opens a PR committing the .niteshift/ files. Nothing changes for other tasks until you merge it. To change the configuration later, ask the agent in any task: agents know how to edit and verify.niteshift/ files, and the change arrives as a PR. The settings section also shows the committed
files on any branch, with two shortcuts:
- Edit with agent starts a task pre-prompted to change the configuration.
- Test in a sandbox provisions an environment from the selected branch and reports whether its committed configuration boots cleanly, so you can validate a configuration PR before merging it.
Environment variables
Secrets stay out of the repository. Configure them at Settings → Environments → [environment], in two scopes:- Setup script scope: sourced while
.niteshift/setupand.niteshift/resumerun. - Agent scope: available to the agent process and its terminal.
secret entry in services.yaml. Values are
encrypted at rest and never shown back in plaintext after save.
Previews and tunnels
Each service that declares aport gets a secure URL:
Classic setup
Environments configured before.niteshift/ became the default use the
classic Niteshift setup script: a single
niteshift-setup.sh stored in Niteshift settings. It keeps working, and nothing forces a migration.
For classic environments, settings shows a Migrate to Config v2 action that starts a task to
translate the existing setup into committed .niteshift/ files and open a PR; the environment
switches over once a .niteshift/ directory lands on the default branch.
Going deeper
- Setup and resume: the lifecycle scripts, the toolchain they run in, environment cache.
- Services: the manifest format, ports, per-service environment, tunnels.
- Integrations: OIDC tokens, AWS and Azure identities, and environment variable secrets.
- Browser authentication: how the agent and previews authenticate into your app.
- Docker support: Docker-in-Docker, image caching.
- Database branches: per-task isolated Postgres branches via Neon.