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 + '/')); }