- Shell — Run commands on the SPIN runtime
- SSH — Run commands on a remote host via SSH connection
- Local Shell — Run commands on your local machine
Shell Mode
The default mode executes commands directly on the SPIN runtime container.Executing Scripts
- You can execute multiple commands on separate lines.
- Commands run in the runtime’s environment with access to installed tools and packages.
SSH Mode
SSH mode allows you to execute commands on remote hosts using pre-configured SSH connections.- Select SSH from the Type dropdown
- Choose an SSH connection from the dropdown (or Runtime Host if Host SSH Access is enabled)
- Enter your shell commands
- Run the cell
Local Shell Mode
Local Shell mode executes commands directly on your local machine, not on the SPIN runtime. This is useful when you need to:- Run commands that require local resources or files
- Interact with local development tools
- Execute scripts that need access to your local environment
Local Shell requires a small daemon (
spinlocalsh) to be running on your machine. This daemon acts as a bridge between SPIN and your local shell.Setting Up Local Shell
- Add a Shell cell to your notebook
- Select Local Shell from the Type dropdown
- Click the Settings icon (gear) next to the type selector
- In the settings dialog:
- Download the
spinlocalshbinary for your platform (macOS Apple Silicon or Linux x64) - Copy the Run Command and execute it in your terminal
- Click Test Connection to verify the daemon is running
- Download the
How It Works
When you run a Local Shell cell:- SPIN sends the command to the
spinlocalshdaemon on your machine - The daemon executes the command in your local shell
- Output is streamed back to SPIN in real-time
- Results appear in the cell output just like any other shell cell
Security
Communication between SPIN andspinlocalsh is secured with a bearer token:
- A unique token is automatically generated and stored in your browser
- The same token must be provided when starting
spinlocalsh - All requests between SPIN and the daemon require this token
Configuration Options
| Setting | Description | Default |
|---|---|---|
| Port | The port spinlocalsh listens on | 8866 |
| Init Timeout | Time to wait for command initialization (seconds) | 10 |
| Idle Timeout | Maximum idle time between command outputs (seconds) | 600 |
Troubleshooting
“spinlocalsh is not running” Make sure the daemon is running. Open the Local Shell Settings dialog, copy the Run Command, and execute it in your terminal. “Token mismatch” The runningspinlocalsh process has a different authentication token than what’s stored in your browser. Copy the new Run Command from the settings dialog and restart spinlocalsh:
xattr -d com.apple.quarantine ./spinlocalsh to automatically clear this flag. If you still see issues:
- Open System Settings > Privacy & Security
- Look for a message about
spinlocalshbeing blocked - Click Allow Anyway
- Run the command again
- Verify
spinlocalshis running:ps aux | grep spinlocalsh - Check that the port matches what’s configured in the settings
- Ensure no firewall is blocking localhost connections on the configured port