kit icon indicating copy to clipboard operation
kit copied to clipboard

Problems with args choice based actions shortcuts & search

Open slavik-chapelskyi opened this issue 4 months ago • 0 comments

I have a script that lists my projects with the ability to open them in multiple places using CMD+K actions.

In my case, the actions are built dynamically based on the projects I fetch from an external resource, so I create them as part of arg({choices[x].actions}).

  1. The first problem appears with the shortcuts, which do not work by default until you open the actions with CMD+K for the first time. After that, you can trigger an action with a hotkey without opening the actions menu. This also works fine when defining actions as the 3rd argument of arg (which lacks the ability to build actions based on the choice data).

  2. I'm not sure if this is a bug or a feature request. The fuzzy search inside the actions is not working correctly. For example, it fails to find git* or ci*.

Script example

// Name: action bug test

import "@johnlindquist/kit";

await arg({
  choices: [
    {
      name: "First",
      value: "first",
      actions: [
        {
          name: "Open in github",
          shortcut: "cmd+g",
          async onAction() {
            console.log("Opening git.");
          },
        },
        {
          name: "Open in circleci",
          shortcut: "cmd+c",
          async onAction() {
            console.log("Opening circleci.");
          },
        },
      ],
    },
  ],
});

https://github.com/user-attachments/assets/10586e0e-6db9-475b-b934-e59f81523829

PS: I am using ScriptKit 3.45.1

slavik-chapelskyi avatar Aug 14 '25 16:08 slavik-chapelskyi