Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,093 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kit

Toolkit for developing on Hyperware.

Documentation in the Hyperware Book; example usage here.

Installing

Install with cargo:

cargo install --git https://github.com/hyperware-ai/kit --locked

Updating

To update, re-run

cargo install --git https://github.com/hyperware-ai/kit --locked

or use

kit update

Usage

# Create a Rust package template (default no UI):
kit new my_package

# Build the package:
kit build my_package

# Start a fake node, by default, on port 8080:
kit boot-fake-node

# Start the package in a running node (requires a node or fake node running at, default, localhost:8080; can specify port of a localhost node with `--port` or can specify entire URL with `--url`):
kit start-package my_package

# Or build, start a node, and start a package from inside the project...
cd my_package
kit build
kit boot-fake-node
kit start-package

# Bonus: create a Python package template (it `build`s & `start-package`s just like a Rust package!):
kit new my_py_package -l python
cd my_py_package
kit build
kit start-package

# Bonus: create a Rust package template with UI (it `build`s & `start-package`s just like a Rust package!):
kit new my_package_with_ui --ui
cd my_package_with_ui
kit build
kit start-package

# Print usage

kit --help

kit boot-fake-node can also accept a --runtime-path argument that compiles the fake node binary from a local Hyperdrive repository. Use like (substituting path to Hyperdrive repo):

kit boot-fake-node --runtime-path ~/git/hyperdrive

kit also contains tools for running tests. For details and examples, please see

  1. Hyperdrive Book's example code.
  2. kits templates, available through kit new or here.
  3. https://github.com/hyperware-ai/core_tests.

UI Development

The simplest way to work on the UI is to use kit dev-ui which develops against a running node. Under the hood, kit dev-ui is just cd ui && npm install && npm run dev.

The UI should open on port 3000 (or next available port) and will proxy all websocket and HTTP requests to http://localhost:8080 by default. You can choose to proxy to any URL using the -u flag:

kit dev-ui my_package -u http://localhost:8081

This is the same as prepending the environment variable:

VITE_NODE_URL=http://localhost:8081 npm run dev

NodeJS (v18 or higher) and NPM are required to build and develop the UI.

The UI is written in React with Vite as the bundler + reloader.

To use npm start instead of npm run dev, use kit dev-ui --release.

Appendix: Deps for Debian/Ubuntu

apt update
DEBIAN_FRONTEND=noninteractive apt install -y curl git build-essential pkg-config libssl-dev libclang-dev python3 python3-venv

curl https://sh.rustup.rs -sSf | sh -s -- -y
. ~/.bashrc
cargo install --git https://github.com/hyperware-ai/kit --locked
kit setup -d --non-interactive
. ~/.bashrc

Appendix: Deps for macOS

xcode-select --install
brew install pkg-config llvm openssl@3 python@3.12 libusb

curl https://sh.rustup.rs -sSf | sh -s -- -y
. ~/.bashrc
cargo install --git https://github.com/hyperware-ai/kit --locked
kit setup -d --non-interactive
. ~/.bashrc

About

Development toolkit for Hyperware

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages