@apprun/shiqu 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,7 +13,8 @@ Turn Chinese classics into your own illustrated storybooks. Read in your browser
13
13
  | You want generation and reading access to continue after closing the control window | Desktop app: stays in the system tray until you stop the service or quit the app |
14
14
  | You need startup parameters, environment overrides, or non-interactive operation | CLI: prepare provider configuration and a library path in advance |
15
15
  | You use Linux, an Intel Mac, or Windows ARM64 | CLI: install Node 24 yourself; no desktop installer is provided for these platforms. Windows supports API providers or read-only mode |
16
- | You want QR codes for phone access or built-in internet tunnel controls | Desktop app: internet access requires a separate cloudflared installation. CLI supports trusted LAN access with `--host 0.0.0.0`, without a built-in internet tunnel |
16
+ | You want phone access on the same Wi-Fi | Both entries: CLI prints phone QR codes on startup; desktop shows them in its control window |
17
+ | You need built-in internet tunnel controls | Desktop app: requires a separate cloudflared installation. CLI has no built-in internet tunnel |
17
18
 
18
19
  **Shared features:** Both entry points provide the same browser interface for story creation, generation queues, pause/resume, reading, library organization, and PDF / PNG export. The desktop window adds library, queue, settings, and service controls; full reading and story creation happen in the browser. Both support OpenAI API, Gemini, and read-only mode. Codex generation is supported on macOS / Linux and requires a separately installed, logged-in Codex CLI; the Shiqu CLI and Codex CLI are different tools.
19
20
 
@@ -35,7 +36,7 @@ Requires **Node 24** (recommended: 24.22.1) and its bundled npm / npx. No separa
35
36
  npx @apprun/shiqu
36
37
  ```
37
38
 
38
- On first use, npx may ask to download the package; confirm to continue. Open the printed URL, normally `http://127.0.0.1:3000`. Keep the terminal running; stop with Ctrl+C. No checkout, build, Docker, or desktop app is needed.
39
+ On first use, npx may ask to download the package; confirm to continue. Open the printed URL, normally `http://127.0.0.1:3000`, or scan a terminal QR code from a phone on the same trusted Wi-Fi. LAN access is enabled by default. Keep the terminal running; stop with Ctrl+C. No checkout, build, Docker, or desktop app is needed.
39
40
 
40
41
  If you already use pnpm, `pnpm dlx @apprun/shiqu` starts the same app. You can also install it globally with pnpm for a permanent `shiqu` command:
41
42
 
@@ -83,14 +84,14 @@ No `.env` is loaded automatically. Existing shell variables beat the selected fi
83
84
 
84
85
  ```bash
85
86
  npx @apprun/shiqu --port 3100 --data-dir ./my-library
86
- npx @apprun/shiqu --host 0.0.0.0
87
+ pnpm dlx @apprun/shiqu --host 127.0.0.1
87
88
  npx @apprun/shiqu --version
88
89
  ```
89
90
 
90
91
  | Option | Environment | Default |
91
92
  | --- | --- | --- |
92
93
  | `--port` | `PORT` | `3000` |
93
- | `--host` | `SHIQU_BIND_IP` | `127.0.0.1` |
94
+ | `--host` | `SHIQU_BIND_IP` | `0.0.0.0` (LAN access) |
94
95
  | `--data-dir` | `SHIQU_DATA_DIR` | Saved desktop library; otherwise find or ask below |
95
96
  | `--config` | — | No env file |
96
97
 
@@ -112,7 +113,7 @@ Relative paths resolve from the launch directory. Both entries use the same SQLi
112
113
 
113
114
  Older CLI releases used `shiqu/library` rather than `com.shiqu.desktop/library` (Windows used LOCALAPPDATA, falling back to APPDATA). Existing data is never moved or merged automatically; pass the old directory with `--data-dir` to continue using it. CLI and desktop now share saved credentials; explicit invocation overrides remain separate and are not saved.
114
115
 
115
- Loopback is the default. `--host 0.0.0.0` enables access from other devices on a trusted LAN; every connected device shares the library and generation permissions. Keep the computer awake while reading from a phone. This CLI does not provide the desktop app's internet tunnel or native control window.
116
+ The CLI listens on `0.0.0.0` by default and prints LAN URLs and phone QR codes when a network interface is available. Every connected device shares the library and generation permissions; use a trusted LAN. Use `--host 127.0.0.1` (or `SHIQU_BIND_IP=127.0.0.1`) for local-only access without phone QR codes. Keep the computer awake while reading from a phone. This CLI does not provide the desktop app's internet tunnel or native control window.
116
117
 
117
118
  ## Sources and license
118
119
 
@@ -5623,6 +5623,15 @@ async function startServer({ root, variables = process.env, localAccess = false
5623
5623
  }
5624
5624
  })();
5625
5625
  }
5626
+ function listen(host2) {
5627
+ return new Promise((resolve, reject) => {
5628
+ server.once("error", reject);
5629
+ server.listen(config.port, host2, () => {
5630
+ server.off("error", reject);
5631
+ resolve();
5632
+ });
5633
+ });
5634
+ }
5626
5635
  function stop() {
5627
5636
  if (stopping) return;
5628
5637
  stopping = true;
@@ -5632,13 +5641,11 @@ async function startServer({ root, variables = process.env, localAccess = false
5632
5641
  void Promise.all([closed, stopCodexProcesses()]).then(closeApplication).then(() => process.exit(0));
5633
5642
  }
5634
5643
  try {
5635
- await new Promise((resolve, reject) => {
5636
- server.once("error", reject);
5637
- server.listen(config.port, config.host, () => {
5638
- server.off("error", reject);
5639
- resolve();
5640
- });
5641
- });
5644
+ if (config.host === "0.0.0.0") {
5645
+ await listen("127.0.0.1");
5646
+ await new Promise((resolve) => server.close(() => resolve()));
5647
+ }
5648
+ await listen(config.host);
5642
5649
  } catch (error) {
5643
5650
  await closeApplication();
5644
5651
  throw error;
@@ -6022,7 +6029,7 @@ async function cliConfiguration(options, context = {}) {
6022
6029
  return {
6023
6030
  ...variables,
6024
6031
  PORT: options.port ?? variables.PORT ?? "3000",
6025
- SHIQU_BIND_IP: options.host ?? variables.SHIQU_BIND_IP ?? "127.0.0.1",
6032
+ SHIQU_BIND_IP: options.host ?? variables.SHIQU_BIND_IP ?? "0.0.0.0",
6026
6033
  SHIQU_DATA_DIR: directory
6027
6034
  };
6028
6035
  }
@@ -6033,7 +6040,7 @@ var help = `Usage: shiqu [options]
6033
6040
  Start \u62FE\u8DA3 and open the printed URL in your browser. Requires Node 24.
6034
6041
 
6035
6042
  --port <number> HTTP port (PORT, default: 3000)
6036
- --host <address> Bind address (SHIQU_BIND_IP, default: 127.0.0.1)
6043
+ --host <address> Bind address (SHIQU_BIND_IP, default: 0.0.0.0)
6037
6044
  --data-dir <path> Persistent library (SHIQU_DATA_DIR, saved desktop library, otherwise ask)
6038
6045
  --config <env-file> Load this env file; existing environment variables take precedence
6039
6046
  --configure Select/edit the shared saved provider, then exit
@@ -6042,7 +6049,8 @@ Start \u62FE\u8DA3 and open the printed URL in your browser. Requires Node 24.
6042
6049
  -v, --version Show version
6043
6050
 
6044
6051
  Relative paths use the directory you launched from. No .env file is loaded automatically.
6045
- Use --host 0.0.0.0 for trusted LAN access; connected devices share the library.
6052
+ LAN access and phone QR codes are enabled by default; use the same trusted Wi-Fi.
6053
+ Connected devices share the library. Use --host 127.0.0.1 for local-only access.
6046
6054
  Saved provider settings are shared with the desktop app. First use asks for setup.
6047
6055
  Environment/config overrides apply to this invocation only and are never saved automatically.
6048
6056
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apprun/shiqu",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Turn Chinese classics into illustrated stories in a local browser app.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Yiyi Sun",