Hiber3D HDK's own CLI to perform various actions
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.
Install with NPM:
``bash bash copy`
npm i @hiber3d/hdk-cli
or with yarn:
`bash bash copy`
yarn add @hiber3d/hdk-cli
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.yarn dev
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 or npm devfrom within a project created with the create-hiber-worldcommand.
This command does the following:
1. Make sure we have a DEVELOPER_TOKEN set in .env (Prompts the user for one if missing)scene.json
2. Reads a that should contain the world json (Gives error if it doesn't exist)app.json
3. Reads an or a user chosen file name that should contain an id for an existing project on hiberworldapp.json
4. If no 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 to app.json/project/{id-from-app.json}/save_v3
5. Run an api call to with the contents of scene.json` to upload the world data.
6. Log the link to the world on hiberworld.com
Please see the Publishing Guide for examples of using HDK CLI to run and upload Hiber3D worlds.
See Hiber3D HDK