Skip to content

Add project and global custom scripts for terminal workflows #28

@germanescobar

Description

@germanescobar

Summary

Add support for custom scripts that users can define and quickly access from the terminal UI.

A custom script should have:

  • name
  • description
  • command
  • scope: project-specific or global

Project scripts apply only to one project. Global scripts apply to all projects.

User experience

In the project terminal area, show a scripts entry point near the terminal controls. This could be:

  • an icon button near the terminal that opens a dropdown/list of scripts, or
  • an icon button that opens a command palette/dialog with fuzzy search

The UI should include both project scripts and global scripts. It should be easy to distinguish which scripts are project-specific vs global.

When the user selects/clicks a script:

  • default behavior: paste the script command into the terminal input, but do not run it
  • there should also be a visible play/run button for each script that executes it immediately

There should also be a keyboard shortcut to open the scripts list / fuzzy search dialog.

Requirements

Script model

Each script should include:

  • id
  • name
  • description
  • command
  • scope: project or global
  • projectId when scope is project
  • timestamps

Project scripts

Users should be able to create, edit, delete, and list scripts for a specific project.

Global scripts

Users should be able to create, edit, delete, and list global scripts that are available in every project.

Terminal integration

  • Selecting a script should paste the command into the active terminal, without pressing Enter.
  • The run/play action should paste and execute the command immediately.
  • If no terminal session is active, the app should handle this gracefully, either by creating/focusing one or showing a clear message.

Shortcut

Add a keyboard shortcut to open the scripts picker. Proposed default: Cmd/Ctrl + Shift + K or similar, as long as it does not conflict with existing shortcuts.

Acceptance criteria

  • Users can manage project-specific scripts.
  • Users can manage global scripts.
  • Scripts are accessible from a UI element near the terminal.
  • Scripts can be searched or filtered quickly, preferably with fuzzy search.
  • Clicking a script pastes its command into the terminal but does not execute it.
  • A play/run button executes a script immediately.
  • Project and global scripts are visually distinguishable.
  • A keyboard shortcut opens the script picker.
  • The empty state explains how to create a script.
  • Terminal behavior is safe by default: no accidental execution when simply selecting a script.

Open questions

  • Should scripts support variables/placeholders later, such as {branch}, {projectPath}, or {sandboxId}?
  • Should scripts be ordered manually, by recent use, or alphabetically?
  • Should run history be tracked?
  • Should scripts be importable from package.json, Makefile, or similar files in the project?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions