From a0b40ec2b126ccf322f0d2ddd9b2a1e311479638 Mon Sep 17 00:00:00 2001 From: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Date: Tue, 2 Jun 2026 11:36:16 +0800 Subject: [PATCH] fix(cli): link dev banner to interactive API docs instead of root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ready banner's `API:` line pointed at `/` — the server root, not the API. Replace it with an `API Docs:` link to `/docs`, the interactive Scalar/OpenAPI explorer, which is the actual human entry point into the running API. The bare `/api/v1` index is a machine-facing route list and isn't worth a banner line. Adds an optional `apiBasePath` (default `/api/v1`). ➜ API Docs: http://localhost:3999/api/v1/docs ➜ Console: http://localhost:3999/_console/ Co-Authored-By: Claude Opus 4.8 --- .changeset/banner-api-docs-link.md | 10 ++++++++++ packages/cli/src/utils/format.ts | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .changeset/banner-api-docs-link.md diff --git a/.changeset/banner-api-docs-link.md b/.changeset/banner-api-docs-link.md new file mode 100644 index 000000000..2edeba62e --- /dev/null +++ b/.changeset/banner-api-docs-link.md @@ -0,0 +1,10 @@ +--- +"@objectstack/cli": patch +--- + +fix(cli): point the dev startup banner at the interactive API docs. + +The ready banner's `API:` line pointed at `/` (the server root, not the API). +Replace it with an `API Docs:` link to `/docs` — the interactive +Scalar/OpenAPI explorer — which is the useful human entry point into the +running server's API. Adds an optional `apiBasePath` (default `/api/v1`). diff --git a/packages/cli/src/utils/format.ts b/packages/cli/src/utils/format.ts index 038dab5a0..ed7e138b8 100644 --- a/packages/cli/src/utils/format.ts +++ b/packages/cli/src/utils/format.ts @@ -183,6 +183,8 @@ export interface ServerReadyOptions { pluginNames?: string[]; uiEnabled?: boolean; consolePath?: string; + /** REST API base path (default '/api/v1'). Drives the API Docs link. */ + apiBasePath?: string; /** Resolved storage driver display name (e.g. "MongoDBDriver", "SqlDriver(pg)"). */ driverLabel?: string; /** Resolved DB URL with credentials redacted. */ @@ -202,7 +204,8 @@ export function printServerReady(opts: ServerReadyOptions) { console.log(''); console.log(chalk.bold.green(' ✓ Server is ready')); console.log(''); - console.log(chalk.cyan(' ➜') + chalk.bold(' API: ') + chalk.cyan(base + '/')); + const apiBase = opts.apiBasePath ?? '/api/v1'; + console.log(chalk.cyan(' ➜') + chalk.bold(' API Docs: ') + chalk.cyan(base + apiBase + '/docs')); if (opts.uiEnabled && opts.consolePath) { console.log(chalk.cyan(' ➜') + chalk.bold(' Console: ') + chalk.cyan(base + opts.consolePath + '/')); }