Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>TinkerPadNew to Visual Studio Code? Get it now.
TinkerPad

TinkerPad

Pêagá

|
5 installs
| (0) | Free
Run Laravel Tinker scratch files directly from VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

TinkerPad

Run Laravel Tinker scratch files from VS Code without pasting file contents into the terminal.

TinkerPad looks for .php files inside a workspace .tinkerpad directory, starts an interactive Artisan Tinker session, requires the current file, and leaves the session open for follow-up commands.

Quick start

  1. Create a .tinkerpad directory in a Laravel workspace.
  2. Add a PHP scratch file, for example .tinkerpad/scratch.php.
  3. Open the file and run Tinkerpad: Run Current File from the Command Palette, or use the Run Tinkerpad CodeLens above the file.

By default TinkerPad runs:

php artisan tinker

Commands

  • Tinkerpad: Run Current File
    • Starts Tinker and requires the active .tinkerpad/*.php file.
  • Run Tinkerpad CodeLens
    • Appears at the top of .php files inside .tinkerpad.
  • Tinkerpad: Diagnose CodeLens
    • Writes CodeLens diagnostics to the Tinkerpad Diagnostics output channel.

Requirements

  • A Laravel workspace with php artisan tinker available, or a custom command configured in .tinkerpad/config.json or .tinkerpad/config.local.json.
  • PHP files must live inside a .tinkerpad directory.
  • Kubernetes mode requires kubectl to be installed and authenticated for the configured context.
  • The VS Code workspace must be trusted before TinkerPad will run commands.

Configuration

Create .tinkerpad/config.json in your workspace to customize the local command used to start Tinker and enable verbose mode:

{
  "mode": "local",
  "localCommand": "./vendor/bin/sail artisan tinker",
  "verbose": false
}

To run Tinker inside a Kubernetes container, set mode to kubernetes:

{
  "mode": "kubernetes",
  "kubernetesCommand": "php artisan tinker",
  "verbose": false,
  "kubernetes": {
    "context": "",
    "namespace": "apps-prod",
    "podNamePrefix": "backend-",
    "container": "php-fpm",
    "remoteTempDirectory": "/tmp"
  }
}

If the file, localCommand, or kubernetesCommand value is missing, Tinkerpad uses php artisan tinker. If mode is missing, Tinkerpad uses local. If mode is null, Tinkerpad asks whether to run locally or in Kubernetes. If verbose is missing, Tinkerpad uses false. Legacy command configs are still accepted as a fallback for both commands.

Create .tinkerpad/config.local.json for machine-specific overrides. TinkerPad reads .tinkerpad/config.json first, then deep-merges .tinkerpad/config.local.json over it, so nested values such as kubernetes.namespace can be overridden without repeating the full Kubernetes object:

{
  "verbose": true,
  "kubernetes": {
    "namespace": "apps-local"
  }
}

Custom localCommand and kubernetesCommand values are executable workspace configuration. Only use them in projects you trust; TinkerPad asks for confirmation before running a custom command for the first time in the current VS Code session.

You can also disable the editor CodeLens from VS Code settings:

{
  "tinkerpad.codeLens.enabled": false
}

Behavior

  • Only runs when the active file is a .php file inside a .tinkerpad directory.
  • Shows Run Tinkerpad at the top of runnable files when tinkerpad.codeLens.enabled is enabled.
  • Closes the previous Tinkerpad terminal before each run.
  • Saves and executes the current .tinkerpad file by path, so the file code is not printed in the terminal.
  • Starts an interactive Tinker session, runs the current file inside it, and keeps that same session open.
  • Reads .tinkerpad/config.json and .tinkerpad/config.local.json to customize local/Kubernetes Tinker commands and verbose mode.
  • Does not run in untrusted VS Code workspaces.
  • Asks for confirmation before running a custom command from workspace configuration.
  • In Kubernetes mode, uploads the current file to a temporary file in the container, requires it inside Tinker, and keeps the remote Tinker session open.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft