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

To install the XDN CLI run

npm i -g @xdn/cli

Or with yarn:

yarn global add @xdn/cli

Creates a build of your app optimized for production

NameDescription
--skip-frameworkAlias: "-s". Skips the framework (Next.js, Vue, Angular, etc..) build and simply rebundles your router
--disable-permanent-assetsSet this to true to suppress errors like "Immutable file (...) content was changed" during deployment.
--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.

xdn build

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

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.

xdn cache-clear --team=my-team --site=my-site --environment=production --path=/p/*

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

xdn completion

xdn completion >> ~/.zshrc

xdn completion >> ~/.bashrc

Builds and deploys your site on the Moovweb XDN.

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.

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.
--disable-permanent-assetsSet this to true to suppress errors like "Immutable file (...) content was changed" during deployment.

xdn deploy my-team --environment=production

Open the XDN documentation in your browser.

xdn docs

Runs your project in development mode, simulating the XDN cloud environment. This command is a simplified version of xdn run, with only the --cache option being supported.

NameDescription
--cacheEnables caching during local development so that you can test the caching logic in your router.

xdn dev

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

xdn init

NameDescription
--connectorThe name of a specific connector package to install, or a path to a directory that implements the connector interface.

Logs into the XDN via the developer console.

xdn login

Logs out of the XDN

xdn logout

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.

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 so that you can test the caching logic in your router. By default caching is turned off in local development to ensure you don't see stale responses as you make changes to your code.

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.

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

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