MiCyte

← The wiki

83 — Running the shell on your own machine

GuideRendered from 83-running-the-shell-locally.md in the public repository. Edits belong there.

The shell a hosted portal serves (its page, scripts, stylesheet, icons and container renderers) ships in the package, in micyte/ui/. micyte.ui.local_host serves it over a store on your own disk, with no hosting service and no sign-in. Use it to look at your own data, or to see a tool you are writing draw in the browser.

Install and serve

The ui extra adds Flask, which the local host needs:

pip install "micyte[ui]"
python -m micyte.ui serve --db path/to/store.sqlite3

The command prints the address, http://127.0.0.1:6200/. Options:

  • --db (required): the SQLite store to open. A missing file is refused before anything serves.
  • --host (default 127.0.0.1): the address to bind. The local host signs nobody in, so a wider address shows the store to anyone who can reach the port.
  • --port (default 6200): the port.
  • --rail (default none): comma-separated tool ids that keep a cell on the rail.

What it draws

Everything is on the system root's page, /portal/compendium:

AddressDraws
/portal/compendiumThe tools index: every registered tool, each name a link that opens it
?tool=<id>That tool's panel in the workbench, with its rail cell lit
?sandbox_filter=<name>The sandbox a tool reads; the index's links keep it
?msn_filter=<msn>The instance a tool reads, for a store that holds more than one

The rail always holds the index's cell. A tool you open gets a lit cell; --rail keeps others there.

What it does not do

  • Sign anyone in. Bind it to the loopback address unless you mean to share the store.
  • Write. It answers no write route, so a panel's Save reports the refusal and nothing changes. Writing goes through the write doors of a host that authorizes them.
  • Carry a host's extensions. A hosted portal can add its own containers with a ShellExtension (micyte/ui/manifest.py); the local host adds none, so a panel whose container only a host draws says that no renderer is registered.

How it is built

Two pieces are shared with every host, so the local page draws a tool exactly as a hosted one does:

PieceModuleWhat a host adds
The panel loopmicyte.ui.panels.build_panels(engine, tool_ids, ...)gate (which tools it runs), finish (its last word on a payload), host_context (facts a tool cannot reach)
The envelopemicyte.ui.envelope.build_portal_runtime_envelope(...)Nothing: every host answers the shell in this frame

A tool is handed the engine (micyte.engine.Engine), never the store's file. See 80 for the tool contract and 82 for building a store to develop against.