Save and run local shell scripts in Frog

Scripts keeps small local shell tasks ready to run from their page or the command bar. Saving or searching a script does not execute it; Run or selecting its command-bar result is the execution action.

Create and run a script

With Command bar enabled, selecting a saved script opens its document and runs it. The page disables Run while a script is active. Results are associated with the originating script rather than displayed on whichever document you happen to open.

  1. Enable Scripts in Features and open Scripts.
  2. Choose New, give the script a title, and enter its shell commands. Changes save to the private document store.
  3. Press Run. Frog shows Running and the output as it arrives, then the exit status.
  4. Use Copy output to copy a completed result, or Stop to cancel active execution.
printf 'Current folder: '
pwd
printf '\nCurrent date: '
date '+%Y-%m-%d'

Execution environment and limits

The process inherits Frog’s environment, with the Homebrew folders /opt/homebrew/bin and /usr/local/bin added to the front of its PATH. Your interactive Terminal aliases and setup may differ. Use explicit paths and an explicit cd when a task depends on a particular tool or directory. A script can read or change files and access the network according to the commands you saved.

  • Shell: /bin/zsh -f -c, with the saved text passed as the script.
  • Working directory: your home folder, not a project folder or the script’s export location.
  • Permissions: your user’s permissions; this is ordinary local shell execution, not a sandbox or automatic administrator session.
  • Input: standard input is /dev/null, so this runner is not an interactive Terminal session.
  • Time: up to 60 seconds per run.
  • Output: combined stdout and stderr, captured up to 256 KiB (shown as 256 KB in the app); excess output is discarded and marked as limited.
  • Script text: at most 100,000 UTF-8 bytes for execution, with no null characters.

Stop and process-group cleanup

Stop, disabling Scripts, a timeout, and quitting Frog cancel execution and clean up the owned process group. Normal completion also terminates remaining descendants in that group so a child does not keep the output pipe or task alive.

This makes the runner appropriate for bounded one-shot tasks. Starting a background service with & does not turn it into a persistent Frog service. A nonzero exit status or timeout is reported in the script view.

What is saved?

Script titles and commands persist alongside notes in ~/.config/frog/Toolkit/toolkit-documents.json. They are excluded from configuration exports. The item overflow menu can explicitly export script text as a .sh file.

Captured output and run status stay in memory and are not saved with the script. Copy output explicitly places it on the system clipboard, where enabled clipboard tools can observe it. Commands within a script can independently write their own files or logs.

Disabling Scripts stops active execution but keeps saved script definitions for when you enable it again.

Source documentation