gamelet-cli
Help to download project from code.gamelet.com, edit/test in vscode and sync back to server.
Create Local Workspace of your CG Project
You can download your CG project files to local and create a nice workspace of VSCode to develop locally.
Download Project Token File
Before creating the workspace, you need to download a token file in your project page.
- Open your project page on code.gamelet.com
- Open the "Project Info" panel from the right-side toolbar.
- Click the "Npm" button above the project code.
- Toggle the "Allow local dev with npm"
- Click the "Download dev-token" button to download
Use the Project Token
Make sure you have the token file in a proper folder, and the apps below are installed
npm install -g gamelet-cli
- Create workspace of your project
Run the command in the folder of the token file:
gamelet download
Choose a token file when the command prompts you a list of choices.
The command will create the workspace in a default folder that is named by the project code.
If custom folder of workspace is desired, use the flag --dir
gamelet download --dir=testfolder
gamelet download myProject.token --dir=testfolder
cd your-project-folder-just-created
npm install
- Transpile and run a local server
npm start
The command will transpile your typescripts
and re-transpile when any file is changed.
It also creates a local server so you can test
the project at http://localhost:3000
Open the "Run and Debug" on the left-side-toolbar of your vscode,
find and click the "Play Game" button to run the game.
Change the button to "Test Module" to run the testbed.
- Sync the workspace from the CG project
After the workspace is built, you can run the below command to sync resources
from your CG project on code.gamelet.com
gamelet merge
gamelet merge --item=source
gamelet merge --item=source --force
gamelet merge --item=resource
gamelet merge --item=item,badge
- Upload the sources back to CG
Once you are satisfied with the codes, you can upload the source back to the CG server.
Before uploading, make sure you have merge the latest sources from server by running the
command "gamelet merge".
gamelet merge
gamelet upload