/cli

💻 Decentraland Command Line Interface

Primary LanguageTypeScript

Decentraland CLI

CLI tool for parcel management.

  • Quickly create new projects
  • Uploading scenes to IPFS
  • Linking Ethereum to the scene
  • Pinning scene to Decentraland IPFS node
  • Compiling scripts
  • Warnings and linting of scenes
  • Hot reloading
  • Optimizing objects, textures
  • Generating bundles of assets
  • Test framework for scripting

Requirements

NodeJS Installation

MacOS/Linux:

You need to have NodeJS (version 8 or greater) installed on your system to use the CLI. You can use official NodeJS installer, but on MacOS/Linux we recommend to use NVM for managing your NodeJS installation. Please follow the installation instructions.

$ npm install -g decentraland

This should install CLI tool and make it available globally. Please proceed to usage documentation.

Windows:

Thanks @HAZARDU5 for this guide

  1. Install Node.js v8 LTS from https://nodejs.org/en/download/

  2. Search Windows for cmd and right click the Command Prompt app and select Run as Administrator

  3. Install windows-build-tools: npm install --global --production windows-build-tools

  4. Wait for both the Visual Studio Build Tools and Python installers to both read Successfully installed xxxx. When everything is done it will return you to the command prompt.

  5. Download git (you'll likely want the 64-bit Windows version): https://git-scm.com/download/win

  6. Install git and when prompted choose to install git bash

  7. When prompted for a default text editor select Use the Nano editor by default

  8. When prompted to adjust your path environment, select Use Git from the Windows Command Prompt

  9. When prompted to choose the SSH executable, select Use OpenSSH

  10. When prompted to choose the HTTPS transport backend, select Use the OpenSSL library

  11. When prompted to configure the line ending conversions, select Checkout Windows-style, commit Unix-style line endings

  12. When prompted to configure the terminal emulator to use with Git Bash select Use MinTTY

  13. On the final installation screen select the following options: Enable file system caching and Enable Git Credential Manager and Enable symbolic links

  14. Run npm install -g decentraland

Documentation

Usage

  • Initialize new Decentraland project from working directory:
$ dcl init
  • Start local development server and serve your scene:
$ dcl preview
  • Deploy scene to IPFS and the Ethereum Blockchain:

First, you need to have IPFS installed locally. Download it here. Note: You need to have IPFS daemon running for this to work!

$ dcl deploy

Updating

If you encounter a message Ethereum linker app is outdated! Please run dcl upgrade!, you need to update the Ethereum linker inside your Decentraland project:

  1. cd your-dcl-project
  2. dcl upgrade

To update the CLI tool:

$ npm update -g decentraland

Building

  1. Clone the repo: git clone https://github.com/decentraland/cli.git
  2. Go into the CLI directory: cd cli
  3. Run npm install
  4. Link the CLI with: npm link

dcl command should now be available.

For CLI tool development, run npm run watch in your terminal and npm link in order to use it anywhere. The CLI will use the mainnet address for the LANDProxy contract by default. If you want to change it, you can define the LAND_REGISTRY_CONTRACT_ADDRESS environment variable. You can also use DCL_ENV=dev to point to the Ropsten contract. Contract addresses are available here.

For the Decentraland IPFS node, we are getting the url from here. If you want to set a different url set the IPFS_GATEWAY var in the .env file.

You can do incremental compilations by running npm run watch, but you will need to run npm run build at least once before.