Writes the local development settings of an app project
Synopsis
Updates the local development settings of an app project in its gitignored env file, so the app can be run locally (e.g. F5 in vscode, cargo run, go run ., uv run app, pnpm dev) against the configured instance.
What gets written:
- the access token: always replaced. For portal instances (*.wandelbots.io) it is refreshed first, like 'nova login token' does (starts a login if needed). Other hosts need no token, it is left empty.
- the instance settings (instance url, cell, base path): only added if missing, so values you edited by hand are kept. --reset replaces them with the targeted instance ('nova config view').
- everything else in the file (comments, your own variables) stays untouched.
When to run it:
- the app gets "Error 401: Unauthorized" from the instance (portal tokens are valid for 24h). The python and nextjs apps may only hang or retry instead, run it first if they don't connect.
- with --reset after switching the instance or cell ('nova instance select', 'nova config set cellname'). 'nova app create' already runs it (with --reset) for a new project.
File and variables per project type (detected by Cargo.toml, go.mod, package.json, pyproject.toml): rust_app, golang_app .env.local token ACCESS_TOKEN, instance NOVA_API CELL_NAME BASE_PATH, LOG_LEVEL if missing nextjs_app .env.local token NOVA_DEV_ACCESS_TOKEN, instance NOVA_DEV_INSTANCE_URL CELL_ID python_app .env token NOVA_ACCESS_TOKEN, instance NOVA_API CELL_NAME BASE_PATH
The apps read the file on startup: restart the app after updating (nextjs dev reloads it by itself). The token is never printed. The output lists the instance settings in effect and notes the ones that differ from the targeted instance. -o json names the file (absolute path), what happened to the token (refreshed; not_needed; missing: the instance needs one but the login has none; unused) and each variable of the layout as set or kept, with differs for instance settings that differ from the targeted instance; it holds no values.
nova app update-env [path] [flags]
Examples
# refresh the access token of the app project in the current directory
nova app update-env
# after 'nova instance select <other-instance>': point the app to the selected instance
nova app update-env --reset
# point the app to another registered instance without selecting it
nova --instance lab-ipc app update-env --reset
# app project in another directory
nova app update-env path/to/your-nova-app
Options
-h, --help help for update-env
-o, --output format Output format: text or json (default text)
--reset Also replace NOVA_API, CELL_NAME and BASE_PATH (or the project type's equivalents) with the values of the targeted instance, e.g. after 'nova instance select'.
Options inherited from parent commands
--debug Write diagnostic output to stderr: HTTP requests and responses, external commands, the resolved instance. Known secrets are redacted, but bodies (app environments, kubeconfigs) can still contain some: don't share the output unreviewed (env: NOVA_DEBUG=1)
--env string (Wandelbots internal) Portal environment for this invocation: prod, stg or dev (default: the environment of the cloud instance, else of the last 'nova login'; env: NOVA_ENV)
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity (disables TLS verification for all requests)
--instance string Name of the instance to work against for this invocation (overrides the selected instance; env: NOVA_INSTANCE)
SEE ALSO
- nova app - Create and install apps on Wandelbots NOVA OS