nao deploy command packages a local nao project and uploads it to a remote nao instance. It is the bridge between a project built locally with nao init / nao sync and a Cloud (or self-hosted) instance that will run chats, scheduled jobs, and integrations against that project.
Use it to push the same context folder you work on locally to the instance your team chats with.
Prerequisites
- A remote nao instance URL (Cloud workspace or your self-hosted deployment).
- An organization-level API key. Create one from Settings -> Organization -> API Keys. See Per-organization API keys.
- A local project that contains a valid
nao_config.yamlwith aproject_namefield.
Command
Run from the project directory (the folder that containsnao_config.yaml):
Flags
| Flag | Description |
|---|---|
<url> | URL of the remote nao instance (positional). Example: https://cloud.nao.com. |
-k, --api-key | Organization API key used to authenticate the upload. |
-p, --path | Project directory. Defaults to the current working directory. |
What gets uploaded
nao deploy builds a gzipped tarball of the project folder and uploads it to <url>/api/deploy. The server extracts the archive, reads project_name from nao_config.yaml, and either creates a new project in the organization or updates the existing one with the same name.
Default exclusions
These paths are always skipped when building the archive:.git.venv.envnode_modules__pycache__repos*.pyc
.naoignore
Add a .naoignore file at the project root to exclude extra files. One pattern per line, # for comments. Patterns are matched against path parts (directory or file names). Example:
Create vs update
The server looks up a project by(organization, project_name):
- If no project with that name exists in the organization, a new one is created and the response reports
status: "created". - If a project with that name already exists, its context folder is replaced with the uploaded content and the response reports
status: "updated".
Example
Errors
Authentication failed. Check your API key.- the API key is missing, revoked, or does not belong to the target organization.No nao_config.yaml found in current directory- run the command from a project root or pass--path.nao_config.yaml is missing a 'project_name' field- addproject_name: my_projectat the top ofnao_config.yaml.Could not connect to <url>- check the URL and that the instance is reachable from your network.