Skip to content
Browse documentation

Commands

Every nanodev command, with its options. Run nanodev <command> --help for the same information in your terminal.

Options for every command

Option What it does
--json Prints the result as JSON, for scripts and AI agents.
--verbose Shows the git and network calls the command makes.
--api <origin> Uses another NanoSite server. You can also set NANODEV_API.
-C, --cwd <folder> Runs as if you started it in folder.
--help Shows help and examples for the command.

Commands never wait for input when they're not run in a terminal (for example from an AI agent or a script). If a command needs an answer, it stops and tells you which option to pass instead.

npm create @nanosite/nanodev

npm create @nanosite/nanodev@beta [folder]

Creates a new store (or a website, with a subscription) from a template or the starter kit, downloads it into folder, installs its packages and starts the dev server. Logs you in first if needed. It runs nanodev create and takes the same options.

nanodev create

nanodev create [folder]

Same as npm create @nanosite/nanodev, for when nanodev is already installed. The project gets AGENTS.md, CLAUDE.md and .claude/settings.json for your AI agent.

  • -t, --template <id>: the template to start from. Asks when you leave it out.
  • -n, --name <name>: the project name. By default, the folder name or the template's name.
  • --type <type>: only offer store or website templates.
  • --org <orgId>: create it in your organization (by default, your organization if you belong to one).
  • --skip-install: don't install the packages.
  • --no-dev: don't start nanodev dev afterwards.
  • --no-browser: don't open a browser (for the login or the running store).
  • -p, --port <port>: the local port for nanodev dev. By default, 5173.

nanodev login

nanodev login

Logs you in through your browser and sets up git credentials for NanoSite.

  • --no-browser: print the approval link instead of opening a browser.
  • --with-token: read a token (ndv_…) from stdin instead, for CI.
  • --no-git-helper: don't set up git credentials.

nanodev logout

nanodev logout

Revokes the saved token on NanoSite, forgets it and removes its git credentials. Run inside a project folder, it also removes the git name and email nanodev set there from your login.

nanodev whoami

nanodev whoami

Shows the account you're logged in as, and on which NanoSite server.

nanodev link [project]

Downloads a project into a folder, installs its packages, and writes AGENTS.md, CLAUDE.md and .claude/settings.json for your AI agent. Without project, lists your projects to pick from.

  • -d, --dir <folder>: the folder to download into. By default, the project name.
  • --skip-install: don't install the packages.

nanodev dev

nanodev dev

Runs the project locally. The page updates as you save. Stores are rendered on the server, like your live store, and show live store data. Checkout is disabled. Prints "↓ N new commits on nano-site, run nanodev pull" when the shared code moves on; it never changes your files on its own.

  • -p, --port <port>: the local port. By default, 5173.
  • --open: open the project in your browser once it's running.
  • --no-watch: don't check NanoSite for new commits.

nanodev pull

nanodev pull

Fetches new commits and rebases (puts your local commits on top of the latest code). Runs npm ci when package-lock.json changed. Brings in the latest AGENTS.md too.

  • --autostash: put your uncommitted changes aside during the pull and bring them back after.
  • --skip-install: don't run npm ci, even when package-lock.json changed.

nanodev push

nanodev push

Commits your edits (or uses your existing commits), pulls first if you're behind, adds missing Linux entries to package-lock.json, and pushes. The Linux entries are only the Linux builds of packages you already have; their versions never change. If git doesn't know your name and email yet, the folder commits as your NanoSite login, and nanodev says so (see nanodev config).

  • -m "<message>": the commit message. By default, one made from the changed files.
  • --no-rebase: stop instead of pulling when NanoSite has new commits.
  • --no-fix-lockfile: only check package-lock.json for missing Linux entries, don't add them.

nanodev status

nanodev status

Shows which project the folder is linked to, how many commits you're ahead or behind, your uncommitted files, your private preview (from nanodev preview) and your live URL.

  • --offline: don't contact NanoSite, use what git already knows.

nanodev preview

nanodev preview

Builds your folder as it is now, commits and uncommitted changes, as a private preview in the production runtime and prints its URL. It never changes the shared code, your branch or your files. Only people who can open the project on NanoSite can view it, and it expires after 7 days without a new preview.

  • --open: open the preview in your browser when it's ready.
  • --no-wait: send your code and return without waiting for the build.
  • --timeout <seconds>: how long to wait for the build. By default, 900 seconds (15 minutes).

nanodev publish

nanodev publish

Pushes your commits, then publishes that exact commit to your live site and shows the build progress.

  • -m "<message>": commit message for uncommitted changes, as with nanodev push.
  • --no-push: publish the commit you're on without pushing. It must already be on nano-site.
  • --preview-link: build the commit to your project's preview link (<id>-preview.nanosite.live) instead of the live site. It doesn't create a version and doesn't change the live site. The preview link is part of a plan.
  • --as <version>: the version to publish as. By default, the next patch of the live version. Not with --preview-link.
  • --no-wait: start the publish and return without following the build.
  • --timeout <minutes>: stop following the build after this long. By default, 20 minutes.

nanodev open

nanodev open [web | preview | live]

Opens the project on NanoSite in your browser: the editor with the AI chat (web, the default), your private preview from nanodev preview, or your live site.

  • --no-browser: print the URL instead of opening it.

nanodev config

nanodev config --unset-identity

When git has no name and email on your computer, nanodev sets them for each project folder from your NanoSite login, and tells you when it does. Once you set your own (git config --global user.email), nanodev removes its copy on the next command.

  • --unset-identity: remove the name and email nanodev set for this folder now.

nanodev doctor

nanodev doctor

Checks git, Node.js, your login and your network connection to NanoSite, and tells you what to fix.