CLI

This guide shows you everything you can do with the XDN command line interface.

Installation

To install the XDN CLI run

npm i -g @xdn/cli

Or with yarn:

yarn global add @xdn/cli

Commands

build

Creates a build of your app optimized for production

Options
NameDescription
--skip-buildSkips the framework (Next.js, Vue, Angular, etc..) build and simply rebundles your router
Example
xdn build

cache-clear

Clears the cache. If neither --path nor --surrogate-key is specified, the entire cache for the specified environment will be cleared.

Options
NameDescription
--team(Required) The team name
--site(Required) The site name.
--environment(Required) The environment name.
--pathA path to clear. Use "*" as a wildcard.
--surrogate-keyClears all responses assigned to the specified surrogate key.
Example
xdn cache-clear --team=my-team --site=my-site --environment=production --path=/p/*

completion

Creates a script that provides autocompletion for xdn cli commands that can be installed in your shell.

Example
xdn completion
Using ZSH
xdn completion >> ~/.zshrc
Using BASH
xdn completion >> ~/.bashrc

deploy

Builds and deploys your site on the Moovweb XDN.

Parameters
NameDescription
teamThe name of the team under which the site will be deployed. The site will be deployed to your private space will be used if omitted.
Options
NameDescription
--siteThe name of the site to deploy. By default the name field in package.json is used.
--environmentThe environment to deploy to. By default the default environment is used.
--branchThe name of the source control branch. This is automatically set when using Git.
--skip-buildSkips the build step
--tokenAuthenticates using a deploy token rather than your user credentials. Use this option when deploying from CI.
--commit-urlThe URL at which the commit can be viewed in your source control provided. If your package.json provides the repository attribute the commit URL will be derived automatically if you use GitHub, GitLab, or BitBucket.
--include-sourcesIncludes all non-gitignored source files in the bundle uploaded to the XDN. This can be helpful when debugging, especially when working with Moovweb support. You can limit the files that are uploaded using the sources config in xdn.config.js.
Example
xdn deploy my-team --environment=production

docs

Open the XDN documentation in your browser.

Example
xdn docs

init

Run in an existing app to add all required packages and files need to publish your app on the Moovweb XDN

Example
xdn init

login

Logs into the XDN via the developer console.

Example
xdn login

logout

Logs out of the XDN

Example
xdn logout

run

Runs your app locally. Uses port 3000 by default. You can change this by setting the PORT environment variable. For example: PORT=5000 xdn run.

Options
NameDescription
--productionRuns a production build of your app, simulating the cloud environment. This can also be achieved by setting the NODE_ENV environment variable to true. You need to run xdn build first.
--cacheEnables caching during local development. By default caching is turned off in local development to ensure you don't see stale responses as you make changes to your code. Enable caching to test the caching logic in your router.
Example
xdn run --production

Or to run a deployment bundle downloaded from the XDN Developer Console, use:

xdn run /path/to/bundle.zip

Production mode is always used whe running downloaded bundles.

use

Switches the version of all @xdn/* packages in your project.

Example

To install a particular version:

xdn use 1.45.0

To install the latest stable:

xdn use latest

To install the latest preview:

xdn use next