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
2 changes: 1 addition & 1 deletion src/actions/portal/quickstart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/portal/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)";
Expand Down
2 changes: 1 addition & 1 deletion src/commands/quickstart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
7 changes: 6 additions & 1 deletion src/prompts/portal/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ export class PortalGeneratePrompts {
}

public generatePortal(fn: Promise<Result<NodeJS.ReadableStream, ServiceError | NodeJS.ReadableStream>>) {
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) {
Expand Down
17 changes: 12 additions & 5 deletions src/prompts/portal/quickstart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Comment thread
mehnoorsiddiqui marked this conversation as resolved.
${f.link(referenceDocumentationUrl)}`;
noteWrapped(message, "Next Steps");
Expand Down Expand Up @@ -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);
}

Expand Down
8 changes: 4 additions & 4 deletions src/prompts/quickstart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<QuickstartFlow> {
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" }
]
});

Expand Down
2 changes: 2 additions & 0 deletions src/prompts/sdk/quickstart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
14 changes: 14 additions & 0 deletions src/types/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!;
Expand Down
Loading