Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Path CopierNew to Visual Studio Code? Get it now.
Path Copier

Path Copier

Bianca Power

|
15 installs
| (0) | Free
Copy file paths to terminal with optional prefixes and restrictions
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Path Copier

A VS Code extension for copying file paths to the terminal with optional command prefixes and path restrictions.

Features

This extension provides two commands:

  • Copy filepath to terminal: Copies the current file's path to the terminal
  • Copy filepath to terminal with command prefix: Copies the path with a configurable command prefix

Example use cases:

  • Running tests for specific files
  • Executing commands that need file paths
  • Working with path-dependent CLI tools

Extension Settings

This extension contributes the following settings:

  • pathCopier.excludePrefix: Path prefix to exclude when copying filepath (e.g., '/Users/name/project/')
  • pathCopier.commandPrefix: Command to prefix before the filepath (e.g., 'rails test:rspec spec=')
  • pathCopier.restrictToPath: Only allow commands to run on files within this path (e.g., '/test/spec/')

Examples

If you have a file at /Users/name/project/test/spec/models/user_spec.rb and configure:

{
"pathCopier.excludePrefix": "/Users/name/project/test/spec",
"pathCopier.commandPrefix": "rails test:rspec spec=",
"pathCopier.restrictToPath": "/test/spec/"
}

Using "Copy filepath to terminal with command prefix" will output:

rails test:rspec spec=models/user_spec.rb
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft