2025-11-11 21:07:14 +01:00
# JanusXR cli
2025-11-11 22:02:56 +01:00
Portable swiss-army knife to automate [janusXR ](https://janusxr.org ) / JML things on a server
2025-11-11 22:05:20 +01:00
> *What is [janusXR](https://janusxr.org)?* It's an open, user-operated immersive web layer, open-sourced by the JanusVR company, that seamlessly lives within websites, even 12 years later thanks to [janusweb](https://github.com/jbaicoianu/janusweb). It provides a highly viable and easy-to-adopt ecosystem of portals, enabling immersive experiences that challenge the traditional app store paradigm. Get started with [this guide](https://madjin.github.io/janus-guide/#/).
2025-11-11 22:02:56 +01:00
2025-11-11 21:09:14 +01:00
# Usage
2025-11-11 23:21:21 +01:00
```
2025-11-12 14:58:03 +01:00
Usage: ./janusxr health < room_url > [--max-time-per-asset 5]
./janusxr scrape < room_url > < outdir >
./janusxr optimize < room_url >
2025-11-11 23:21:21 +01:00
```
## Examples
2025-11-11 21:14:33 +01:00
> scan a room URL for broken links in JML+HTML
2025-11-11 21:11:09 +01:00
2025-11-11 23:21:21 +01:00
```bash
2025-11-12 14:58:03 +01:00
$ ./janusxr health http://localhost:8790/models/m5gr26w0wqqs
2025-11-11 21:09:14 +01:00
✅ http://localhost:8791/templates/xrfragment/%232/website.glb
✅ http://localhost:8790/models/assets/offscreen_renderer-186b8c52.js
✅ https://lychee.co/static/metas/favicon-32x32.png
✅ https://raw.githubusercontent.com/supermerill/SuperSlicer/refs/heads/master_27/resources/icons/SuperSlicer.svg
✅ http://localhost:8790/models/models/m5gr26w0wqqs/model_files/website.glb
✅ https://raw.githubusercontent.com/ELEGOO-3D/ElegooSlicer/refs/heads/main/resources/images/ElegooSlicer.svg
✅ http://localhost:8790/models/assets/roundel-1d688b1e.svg
✅ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/webp/orcaslicer.webp
✅ http://localhost:8790/models/models/m5gr26w0wqqs/model_files/gjc0jp33r6zl.jpg?derivative=carousel
✅ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/webp/cura.webp
✅ http://localhost:8790/models/assets/application-01a8ec1d.js
✅ http://localhost:8790/models/assets/janusxr.svg
⚕️ health: 100%
```
2025-11-11 23:25:46 +01:00
> scrape a room URL and rewrite JML to serve local assets (usecase: preservation/local-first/prototyping)
2025-11-11 23:21:21 +01:00
```bash
2025-11-12 14:58:03 +01:00
$ ./janusxr scrape https://www.janusxr.org/newlobby/index.html mydir
2025-11-11 23:21:21 +01:00
🔗 http://dizzket.com/archive/dotmatrix/
🔗 https://vesta.janusvr.com/nazrin/minecraft-sandbox
✅ http://www.janusvr.com/newlobby/scripts/home.txt
...
$ ls -la mydir
index.html
home.txt
...
```
2025-11-12 14:58:03 +01:00
> optimize a room by adding tags to your JML
```bash
$ ./janusxr optimize https://janusvr.com/newlobby/index.html
<!-- copy/paste below into your HTML/JML - file -->
< a href = 'http://www.janusvr.com/newlobby/scripts/home.txt' / >
2025-11-12 15:19:15 +01:00
< a href = 'http://timigi.com' / >
< link rel = 'preconnect' href = 'http://timigi.com' / >
< a href = 'http://janusvr.thevirtualarts.com/random1.php' / >
< link rel = 'preconnect' href = 'http://janusvr.thevirtualarts.com' / >
< a href = 'http://www.janusvr.com/newlobby/images/windmill1.png' / >
2025-11-12 14:58:03 +01:00
...
```
* `preconnect` speeds up loading remote resources (DNS lookup, TCP handshake, TLS negotiation)
2025-11-12 14:59:34 +01:00
* < a href=".."> allows archive.org to fully capture the room (resources)
2025-11-12 14:58:03 +01:00
2025-11-11 23:21:21 +01:00
## Awk?
2025-11-11 21:07:14 +01:00
Why not some superfancy scripting for this task?
* awk is great for all things text and templating usecases
2025-11-11 21:11:09 +01:00
* dependencyfree
* lightweight to add to docker-image for automation