Using the CLI
To create, preview, deploy and deal with a Decentraland scene you can either use
- The Decentraland Editor
- The command line
Although the Editor is easier to use, using the command line allows you more flexibility, and can be easily used in automated processes.
📔 Note: The Editor runs the same command-line operations behind the curtains.
💡 Tip: See Instalation guide for instructions on how to install the Editor.
Before you Begin #
To deal with the scene via the command line, please install the following dependencies before you run CLI commands with the scene:
- Node.js (version 8 or later)
Initiate a new project #
npx @dcl/sdk-commands init on an empty folder to populate it with the default files of a Decentraland project.
The CLI then prompts you to chose what kind of project, if you want to build a scene , a workspace or a smart wearable . If selecting a scene, the CLI prompts you about what base project to use as a starting point.
Update the SDK version of a scene #
Run the following command on the scene folder:
npm i @dcl/sdk@latest
You can confirm that it worked by checking the
package.json file for the scene, and looking for the
@dcl/sdk version there.
Run a preview #
npm run start on the root level of a scene, workspace, or smart wearable project to open a preview in a browser window.
See preview scenes for details and special options when running a preview.
for more details.
The build command is optional, as it also runs in the background before deploying (although you can add a flag to skip it).
The build command runs more rigurous type checks than those that run with
npm run start, running it can sometimes be helpful to debug a scene.
Deploy a scene #
npm run deploy to publish your scene to Decentraland. This command opens a browser window where you can sign with your wallet to authorize the deployment.
See publishing for details and special options when publishing a scene.
If you run into issues, see the troubleshooting section.