CLI: add gateway verbose flag
This commit is contained in:
@@ -9,10 +9,13 @@ Last updated: 2025-12-09
|
|||||||
|
|
||||||
## How to run (local)
|
## How to run (local)
|
||||||
```bash
|
```bash
|
||||||
clawdis gateway --port 18789
|
pnpm clawdis gateway --port 18789
|
||||||
|
# for full debug/trace logs in stdio:
|
||||||
|
pnpm clawdis gateway --port 18789 --verbose
|
||||||
```
|
```
|
||||||
- Binds WebSocket control plane to `127.0.0.1:<port>` (default 18789).
|
- Binds WebSocket control plane to `127.0.0.1:<port>` (default 18789).
|
||||||
- Logs to stdout; use launchd/systemd to keep it alive and rotate logs.
|
- Logs to stdout; use launchd/systemd to keep it alive and rotate logs.
|
||||||
|
- Pass `--verbose` to mirror debug logging from the log file into stdio when troubleshooting.
|
||||||
- Optional shared secret: pass `--token <value>` or set `CLAWDIS_GATEWAY_TOKEN` to require clients to send `hello.auth.token`.
|
- Optional shared secret: pass `--token <value>` or set `CLAWDIS_GATEWAY_TOKEN` to require clients to send `hello.auth.token`.
|
||||||
|
|
||||||
## Remote access
|
## Remote access
|
||||||
|
|||||||
@@ -227,7 +227,9 @@ Examples:
|
|||||||
"--token <token>",
|
"--token <token>",
|
||||||
"Shared token required in hello.auth.token (default: CLAWDIS_GATEWAY_TOKEN env if set)",
|
"Shared token required in hello.auth.token (default: CLAWDIS_GATEWAY_TOKEN env if set)",
|
||||||
)
|
)
|
||||||
|
.option("--verbose", "Verbose logging to stdout/stderr", false)
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
|
setVerbose(Boolean(opts.verbose));
|
||||||
const port = Number.parseInt(String(opts.port ?? "18789"), 10);
|
const port = Number.parseInt(String(opts.port ?? "18789"), 10);
|
||||||
if (Number.isNaN(port) || port <= 0) {
|
if (Number.isNaN(port) || port <= 0) {
|
||||||
defaultRuntime.error("Invalid port");
|
defaultRuntime.error("Invalid port");
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import path from "node:path";
|
|||||||
import { loadConfig } from "../config/config.js";
|
import { loadConfig } from "../config/config.js";
|
||||||
import { loadSessionStore, resolveStorePath } from "../config/sessions.js";
|
import { loadSessionStore, resolveStorePath } from "../config/sessions.js";
|
||||||
import { info } from "../globals.js";
|
import { info } from "../globals.js";
|
||||||
import { makeProxyFetch } from "../telegram/proxy.js";
|
|
||||||
import type { RuntimeEnv } from "../runtime.js";
|
import type { RuntimeEnv } from "../runtime.js";
|
||||||
|
import { makeProxyFetch } from "../telegram/proxy.js";
|
||||||
import { resolveHeartbeatSeconds } from "../web/reconnect.js";
|
import { resolveHeartbeatSeconds } from "../web/reconnect.js";
|
||||||
import {
|
import {
|
||||||
createWaSocket,
|
createWaSocket,
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import {
|
|||||||
type SessionEntry,
|
type SessionEntry,
|
||||||
} from "../config/sessions.js";
|
} from "../config/sessions.js";
|
||||||
import { info } from "../globals.js";
|
import { info } from "../globals.js";
|
||||||
import { getHealthSnapshot, type HealthSummary } from "./health.js";
|
|
||||||
import { buildProviderSummary } from "../infra/provider-summary.js";
|
import { buildProviderSummary } from "../infra/provider-summary.js";
|
||||||
import { peekSystemEvents } from "../infra/system-events.js";
|
import { peekSystemEvents } from "../infra/system-events.js";
|
||||||
import type { RuntimeEnv } from "../runtime.js";
|
import type { RuntimeEnv } from "../runtime.js";
|
||||||
@@ -17,6 +16,7 @@ import {
|
|||||||
logWebSelfId,
|
logWebSelfId,
|
||||||
webAuthExists,
|
webAuthExists,
|
||||||
} from "../web/session.js";
|
} from "../web/session.js";
|
||||||
|
import { getHealthSnapshot, type HealthSummary } from "./health.js";
|
||||||
|
|
||||||
export type SessionStatus = {
|
export type SessionStatus = {
|
||||||
key: string;
|
key: string;
|
||||||
@@ -198,11 +198,7 @@ export async function statusCommand(
|
|||||||
|
|
||||||
if (opts.json) {
|
if (opts.json) {
|
||||||
runtime.log(
|
runtime.log(
|
||||||
JSON.stringify(
|
JSON.stringify(health ? { ...summary, health } : summary, null, 2),
|
||||||
health ? { ...summary, health } : summary,
|
|
||||||
null,
|
|
||||||
2,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user