diff --git a/apps/desktop/src/lib/cmds/system.ts b/apps/desktop/src/lib/cmds/system.ts new file mode 100644 index 0000000..cd7221f --- /dev/null +++ b/apps/desktop/src/lib/cmds/system.ts @@ -0,0 +1,4 @@ +import { getSystemCommands } from "@kksh/api/commands" +import type { SysCommand } from "@kksh/api/models" + +export const systemCommands: SysCommand[] = getSystemCommands() diff --git a/apps/desktop/src/lib/components/main/CommandPalette.svelte b/apps/desktop/src/lib/components/main/CommandPalette.svelte index 8e117e4..c9256f9 100644 --- a/apps/desktop/src/lib/components/main/CommandPalette.svelte +++ b/apps/desktop/src/lib/components/main/CommandPalette.svelte @@ -3,6 +3,7 @@ passing everything through props will be very complicated and hard to maintain. --> + + + {#each systemCommands as cmd} + { + cmd.function() + }} + > + + {#if cmd.icon} + + {/if} + {cmd.name} + + + {/each} + diff --git a/packages/ui/src/components/main/index.ts b/packages/ui/src/components/main/index.ts index 7ff257d..cb38b5e 100644 --- a/packages/ui/src/components/main/index.ts +++ b/packages/ui/src/components/main/index.ts @@ -2,4 +2,5 @@ export { default as BuiltinCmds } from "./BuiltinCmds.svelte" export { default as CustomCommandInput } from "./CustomCommandInput.svelte" export { default as GlobalCommandPaletteFooter } from "./GlobalCommandPaletteFooter.svelte" export { default as ExtCmdsGroup } from "./ExtCmdsGroup.svelte" +export { default as SystemCmds } from "./SystemCmds.svelte" export * from "./types"