@hiber3d/hdk-cli
v1.1.28
Published
Hiber3D HDK's own CLI to perform various actions
Downloads
379
Readme
Hiber3D HDK CLI
Hiber3D HDK is a Typescript library for creating web-based 3D experiences. Powered by the lightweight Hiber engine it is compatible across all major mobile, tablet, and desktop browsers. It features built-in multiplayer, character controls, gameplay mechanics, customizable avatars and more, allowing you to create interactive 3D worlds rapidly.
The hdk-cli
is used to perform actions like running a local dev server, and publishing worlds on hiberworld.com.
Installation
Install with NPM:
npm i @hiber3d/hdk-cli
or with yarn:
yarn add @hiber3d/hdk-cli
Commands
`hdk dev``
This runs a local development server from the current directory. The server starts at the nearest available port from 5173 and upwards.
The development server looks for an index.tsx
file or an index.html
. If it finds an index.html file, it serves it as plain HTML, if it finds an index.tsx it wraps it in a Hiber3D canvas and calls the code it contains.
Optionally, the development server can be used to generate a scene.json after rendering the scene. That is necessary for publishing the world on hiberworld.com.
Usually, you will run this indirectly via a yarn dev
or npm dev
from within a project created with the create-hiber-world
command.
hdk upload
This command does the following:
- Make sure we have a
DEVELOPER_TOKEN
set in.env
(Prompts the user for one if missing) - Reads a
scene.json
that should contain the world json (Gives error if it doesn't exist) - Reads an
app.json
or a user chosen file name that should contain an id for an existing project on hiberworld - If no
app.json
is found, prompt the user for a project title and run an api call to/project/codekit/create
to create a new project. Save the response id and title toapp.json
- Run an api call to
/project/{id-from-app.json}/save_v3
with the contents ofscene.json
to upload the world data. - Log the link to the world on hiberworld.com
Usage
Please see the Publishing Guide for examples of using HDK CLI to run and upload Hiber3D worlds.
Documentation
See Hiber3D HDK