On this page
PixelWeaver CLI.
#server.src.pixelweaver.cli
#server.src.pixelweaver.cli
PixelWeaver CLI.
#build_vite_command
def build_vite_command(vite_port: int) -> strBuild the vite dev command, forwarding the port explicitly.
--strictPort forbids vite's silent auto-increment when the port is occupied: instead vite exits loudly, which the wrapper surfaces. Without forwarding the port, vite starts on its config default while the readiness probe waits on vite_port and times out.
#platform_summary
def platform_summary() -> strOS name and machine architecture, as diagnose prints them.
Reads platform.uname() once instead of calling platform.system() and platform.machine(), which are projections of exactly that record -- the value is identical (see test_cli.py) and it is one in-process read rather than two.
The spelling also matters: strictcli's effects-bypass lint bans the call leaf system on any receiver, because os.system starts a shell. platform.system collides with that ban while starting no process at all, and ctx.effects has no method for an in-process observe -- routing it would mean shelling out to uname, a real process where there was none, and losing Windows. platform.uname() carries the same information with no collision, so nothing here is suppressed or hidden from the lint.
#_pkg_version
def _pkg_version(package_name: str, module_name: str | None=None) -> strGet package version, trying module attr first then importlib.metadata.
#cmd_serve
def cmd_serve(ctx, *, host: str, port: int, data_dir: str, reload: bool) -> None#cmd_new
def cmd_new(ctx, name: str, *, width: int, height: int, data_dir: str) -> None#cmd_list
def cmd_list(ctx, *, data_dir: str) -> None#cmd_export_parts
def cmd_export_parts(ctx, name: str, *, out: str, data_dir: str) -> None#cmd_mcp
def cmd_mcp(ctx, *, data_dir: str, server_url: str) -> None#cmd_dev
def cmd_dev(ctx, *, host: str, port: int, data_dir: str, vite_port: int) -> None#cmd_open
def cmd_open(ctx, *, host: str, port: int, data_dir: str, browser: bool) -> None#cmd_diagnose
def cmd_diagnose(ctx) -> None#cmd_stop
def cmd_stop(ctx) -> None#main
def main() -> None