Skip to main content

Scripts

The SCRIPTS tab lets you save, manage, and run shell scripts on your server — with support for secret variables, variable substitution, and PTY mode for interactive commands.

Creating a Script

  1. Click + NEW SCRIPT in the SCRIPTS tab
  2. Fill in:
FieldDescription
NameDisplay name
DescriptionOptional — shown in the script list
Working directoryDefault ~ — directory where the script runs
ContentShell script body
  1. Click SAVE

Variables

Scripts support {{VARIABLE}} substitution. Define variables in the Variables section of the script editor:

TypeBehaviour
PlainValue shown in UI, passed as-is
SecretValue stored encrypted in vault; always masked in UI — shown as ••••••

Example

#!/bin/bash
echo "Deploying to {{ENV}}"
aws s3 sync ./dist s3://{{BUCKET}}/{{ENV}}/ --delete

Variables panel: ENV = production, BUCKET = myapp-assets (or use a secret for credentials).

When you click RUN, KoreShell substitutes all {{VAR}} placeholders before sending the script to the server.

Running a Script

Click ▶ RUN on any script card:

  • Output streams live to the log panel
  • Exit code is shown when the script finishes
  • Full output is saved in run history

PTY Mode

Enable Run in PTY for scripts that require a pseudo-terminal — interactive prompts, sudo, vim, progress bars with ANSI escape codes.

In PTY mode the script runs in a full terminal session. The output panel becomes an interactive terminal — you can type responses to prompts.

:::note PTY mode and secrets In PTY mode, secret variable values are substituted before the script runs — they never appear in the terminal echo. :::

Script History

Each script keeps a log of all runs: timestamp, exit code, and full output. Click a script → HISTORY.

Deleting a Script

Right-click a script → Delete. Scripts are soft-deleted — they disappear from the list but their run history is preserved in the database.

Tips

Use scripts for recurring tasks: database dumps, log rotation, health checks, cleanup jobs.

Chain scripts: call one script from another by referencing its path on the server.

Schedule via backup cron: if you need a script to run on a schedule, add it as a custom rclone "job" with the script as the deploy command, or set up a cron entry directly via the terminal.