diff --git a/src/actions/portal/quickstart.ts b/src/actions/portal/quickstart.ts index dd519002..75dbc7e4 100644 --- a/src/actions/portal/quickstart.ts +++ b/src/actions/portal/quickstart.ts @@ -260,7 +260,7 @@ export class PortalQuickstartAction { const portalDirectory = inputDirectory.join('portal'); const portalServeAction = new PortalServeAction(this.configDir, this.commandMetadata, null); const result = await portalServeAction.execute(sourceDirectory, portalDirectory, defaultPort, true, false, () => { - this.prompts.nextSteps(); + this.prompts.nextSteps(prunedConfig.hasAiIntegration()); }); if (result.isFailed()) { diff --git a/src/commands/portal/generate.ts b/src/commands/portal/generate.ts index 47535208..a789d420 100644 --- a/src/commands/portal/generate.ts +++ b/src/commands/portal/generate.ts @@ -6,7 +6,7 @@ import { format, intro, outro } from "../../prompts/format.js"; import { CommandMetadata } from "../../types/common/command-metadata.js"; export class PortalGenerate extends Command { - static summary = "Generate an API Documentation portal"; + static summary = "Generate Context Plugins and API Documentation Portal with AI Assist Features."; static description = "Generate an API Documentation portal. Requires an input directory containing API specifications, a config file and optionally, markdown guides. For details, refer to the [documentation](https://docs.apimatic.io/platform-api/#/http/guides/generating-on-prem-api-portal/build-file-reference)"; diff --git a/src/commands/quickstart.ts b/src/commands/quickstart.ts index 8c90d176..8fea41e1 100644 --- a/src/commands/quickstart.ts +++ b/src/commands/quickstart.ts @@ -10,7 +10,7 @@ import { QuickstartCompletedEvent } from "../types/events/quickstart-completed.j export default class Quickstart extends Command { static description = "Get started with your first SDK or API Portal in four easy steps."; - static summary = "Create your first SDK or API Portal using APIMatic."; + static summary = "Create your first API Portal, Context Plugins and SDKs, or a standalone SDK, using APIMatic."; static cmdTxt = format.cmd("apimatic", "quickstart"); diff --git a/src/prompts/portal/generate.ts b/src/prompts/portal/generate.ts index e644ecad..8f6b2c5f 100644 --- a/src/prompts/portal/generate.ts +++ b/src/prompts/portal/generate.ts @@ -38,7 +38,12 @@ export class PortalGeneratePrompts { } public generatePortal(fn: Promise>) { - return withSpinner("Generating portal", "Portal generated successfully.", "Portal Generation failed.", fn); + return withSpinner( + "Generating API Portal", + "Portal generated successfully.", + "Portal Generation failed.", + fn + ); } public portalGenerationError(error: string) { diff --git a/src/prompts/portal/quickstart.ts b/src/prompts/portal/quickstart.ts index 2f04cf63..c0a24f76 100644 --- a/src/prompts/portal/quickstart.ts +++ b/src/prompts/portal/quickstart.ts @@ -136,7 +136,7 @@ export class PortalQuickstartPrompts { const languages = (await multiselect({ message: - "Your API Portal will contain SDKs and SDK Documentation in the following Languages (HTTP is enabled by default). Press enter to continue with all languages, or use the arrow keys and space to customize your selection:", + "Your API Portal can contain Context Plugins for AI agents, SDKs, and SDK documentation in the following languages (HTTP is enabled by default). Press Enter to continue with all languages, or use the arrow keys and Space to customize your selection", options: available.map(({ label, value }) => ({ label, value })), initialValues: available.map(({ value }) => value), required: false @@ -187,7 +187,7 @@ export class PortalQuickstartPrompts { removed.push("API Copilot"); } if (report.removedAiIntegration) { - removed.push("AI context plugins (Cursor / VS Code / Claude Code)"); + removed.push("Context plugins (Cursor / VS Code / Claude Code)"); } if (removed.length === 0) { return; @@ -256,8 +256,15 @@ export class PortalQuickstartPrompts { ); } - public nextSteps(): void { - const message = `Use the API Playground or an SDK to call your API. + public nextSteps(hasAiIntegration: boolean): void { + const message = hasAiIntegration + ? `Your API Portal is ready with Context Plugins enabled. + +Install your API's Context Plugins in Cursor, VS Code, or Claude Code to help AI coding agents understand your API and generate more accurate code. + +Explore customization options, including Portal themes and API Recipes. +${f.link(referenceDocumentationUrl)}` + : `Use the API Playground or an SDK to call your API. Customize the Portal theme, add API recipes and enable AI features ${f.link(referenceDocumentationUrl)}`; noteWrapped(message, "Next Steps"); @@ -292,7 +299,7 @@ ${f.link(referenceDocumentationUrl)}`; public copilotEnabled(key: string) { const message = `API Copilot is enabled with key ${f.var(key)}. ` + - `Any existing AI context associated with this key will be overwritten when the portal is generated.`; + `Any existing Copilot context associated with this key will be overwritten when the portal is generated.`; log.warn(message); } diff --git a/src/prompts/quickstart.ts b/src/prompts/quickstart.ts index 23ad6573..0c0aad44 100644 --- a/src/prompts/quickstart.ts +++ b/src/prompts/quickstart.ts @@ -5,16 +5,16 @@ export type QuickstartFlow = "sdk" | "portal" | undefined; export class QuickstartPrompts { public welcomeMessage() { log.info(`Welcome to the APIMatic quickstart wizard.`); - log.message(`This wizard will guide you through creating your first SDK or API Documentation Portal in just four easy steps. + log.message(`This wizard will guide you through creating your first Context Plugins, API Documentation Portal or SDK in just four easy steps. Let's get started!`); } public async selectQuickstartFlow(): Promise { const option = await select({ - message: "What would you like to create?", + message: "How do you want to get started?", options: [ - { value: "portal", label: "API Documentation Portal", hint: "Generate API docs + SDKs" }, - { value: "sdk", label: "SDK" } + { value: "portal", label: "API Portal + Context Plugins + SDKs", hint: "" }, + { value: "sdk", label: "SDK Only", hint: "Add the API Portal and Context Plugins later" } ] }); diff --git a/src/prompts/sdk/quickstart.ts b/src/prompts/sdk/quickstart.ts index 790d15fd..f866787b 100644 --- a/src/prompts/sdk/quickstart.ts +++ b/src/prompts/sdk/quickstart.ts @@ -252,6 +252,8 @@ export class SdkQuickstartPrompts { '${f.cmdAlt("apimatic", "sdk", "generate")} ${inputDirectoryFlag}${f.flag("language", language)}' to regenerate your SDK. +Explore API Portals and Context Plugins next to enhance your API experience. + To learn more about customizing your SDK, visit: ${f.link(sdkCustomizationUrl)}`; noteWrapped(message, "Next Steps"); diff --git a/src/types/build/build.ts b/src/types/build/build.ts index dac4f12c..5d9dca2e 100644 --- a/src/types/build/build.ts +++ b/src/types/build/build.ts @@ -198,6 +198,20 @@ export class BuildConfig { return this.data.apiCopilotConfig != null; } + // True when at least one language has an AI editor integration (Context Plugin) + // enabled in the portal settings. AI integration cannot exist without Copilot, but + // Copilot can be present with AI integration disabled — so this is a distinct check. + public hasAiIntegration(): boolean { + const languageSettings = this.data.generatePortal?.portalSettings?.languageSettings; + if (!languageSettings) { + return false; + } + return Object.values(languageSettings).some((setting) => { + const ai = setting.aiIntegration; + return ai != null && [ai.cursor, ai.claudeCode, ai.vscode].some((editor) => editor?.isEnabled === true); + }); + } + /** Returns a copy with the portal's languageConfig set from the selected friendly language ids. */ public withPortalLanguages(languages: string[]): BuildConfig { const portal = this.data.generatePortal!;