Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/banner-api-docs-link.md
Original file line number Diff line number Diff line change
@@ -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 `<apiBase>/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`).
5 changes: 4 additions & 1 deletion packages/cli/src/utils/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand All @@ -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 + '/'));
}
Expand Down