diff --git a/src/commands/complete.ts b/src/commands/complete.ts index a23b05c..72c7365 100644 --- a/src/commands/complete.ts +++ b/src/commands/complete.ts @@ -5,11 +5,12 @@ import os from "node:os"; import { Command } from "commander"; import { Shell } from "../utils/shell.js"; import { initializeRuntime } from "../runtime/initialize.js"; +import { SuggestionBlob } from "../runtime/model.js"; const action = async (input: string) => { const shell = os.platform() === "win32" ? Shell.Cmd : Shell.Bash; const { getSuggestions } = await initializeRuntime(shell); - const suggestions = await getSuggestions(input, process.cwd(), shell); + const suggestions: SuggestionBlob = (await getSuggestions(input, process.cwd(), shell)) ?? { suggestions: [] }; process.stdout.write(JSON.stringify(suggestions)); process.exit(0); };