upstash/context7 · info
Generation cancelled
Error message
Generation cancelled
What it means
The 'Describe the expertise:' input prompt threw, which in practice means the user cancelled it (Ctrl+C or Escape in the @clack-style prompt) or stdin hit EOF in a non-TTY environment. The catch block treats any prompt rejection as cancellation, warns, and returns cleanly — no API calls or files happen.
Source
Thrown at packages/cli/src/commands/generate.ts:138
log.blank();
console.log(pc.red(' ✕ "Build OAuth with NextAuth"'));
console.log(pc.green(' ✓ "OAuth authentication patterns and pitfalls with NextAuth.js"'));
}
log.blank();
let motivation: string;
try {
motivation = await input({
message: "Describe the expertise:",
});
if (!motivation.trim()) {
log.warn("Expertise description is required");
return;
}
motivation = motivation.trim();
} catch {
log.warn("Generation cancelled");
return;
}
log.blank();
console.log(
pc.dim(
"To generate this skill, we will read relevant documentation and examples\nfrom Context7.\n"
)
);
console.log(
pc.dim(
"These sources are used to:\n• extract best practices and constraints\n• compare patterns across official docs and examples\n• avoid outdated or incorrect guidance\n"
)
);
console.log(pc.dim("You can adjust which sources the skill is based on.\n"));
const searchSpinner = ora("Finding relevant sources...").start();
const searchResult = await searchLibraries(motivation, accessToken);View on GitHub (pinned to 5284672feb)
Solutions
- Nothing to repair — simply re-run `context7 skill generate` and answer the prompt
- Run the command in a real interactive terminal (TTY), since it is a guided wizard
- Do not pipe or redirect stdin when invoking it
Defensive patterns
Strategy: try-catch
Type guard
function isCancelSignal(e: unknown): boolean {
// @clack prompts expose isCancel(); raw Ctrl+C surfaces as a cancel/abort rejection
return typeof e === "object" && e !== null && "name" in e && (e as { name?: string }).name === "Cancel";
} Try / catch
try {
motivation = await input({ message: "Describe the expertise:" });
} catch (err) {
if (isCancelSignal(err)) { console.info("Generation cancelled"); return; } // graceful exit
throw err; // real errors should not be silenced
} Prevention
- Run `context7 skill generate` in an interactive terminal
- Do not pipe or redirect stdin into the wizard
- Treat cancellation as expected control flow, not an error
When it happens
Trigger: Pressing Ctrl+C or Esc at the expertise prompt; running the interactive command in a pipeline/CI job where stdin closes and the prompt aborts.
Common situations: Users backing out of the wizard after seeing the prompt; running `context7 skill generate` from scripts where no interactive terminal is attached.
Related errors
- Expertise description is required
- Failed to write to ${skillPath}: ${error.message}
- searchResult.message || "Try a different description"
- Please try again
- downloadData.error || "no files"
AI-assisted analysis of upstash/context7@5284672feb (2026-08-18).
Data as JSON: /api/errors/b21709dd3c3dedcd.
Report an issue: GitHub.