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

JSON Path Copier

reza kalbali

|
1 install
| (0) | Free
Copy internal key paths from JSON files with a single click or keyboard shortcut
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

JSON Path Copier

Version License VS Code

A VS Code/Cursor extension that allows you to quickly copy the internal key path of any JSON key by simply right-clicking or using a keyboard shortcut.

Features

  • 🚀 Quick Copy: Copy JSON key paths with a single click
  • 📋 Smart Detection: Automatically detects the key at your cursor position
  • 🔍 Nested Support: Works with deeply nested JSON structures
  • ⌨️ Keyboard Shortcut: Fast access via Command Palette
  • 🎯 Context Menu: Right-click integration for easy access

Installation

Method 1: Install from VSIX File

  1. Download the json-path-copier-0.1.0.vsix file
  2. Open VS Code or Cursor
  3. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)
  4. Type Extensions: Install from VSIX... and select it
  5. Choose the downloaded .vsix file
  6. Reload VS Code/Cursor when prompted

Method 2: Development Mode

  1. Clone or download this repository
  2. Open the folder in VS Code/Cursor
  3. Press F5 to launch Extension Development Host
  4. The extension will be active in the new window

Usage

Method 1: Right-Click Menu

  1. Open any JSON file (.json or .jsonc)
  2. Place your cursor on the key you want to copy
  3. Right-click and select "Copy JSON Path"
  4. The path is now copied to your clipboard!

Method 2: Command Palette

  1. Place your cursor on the key you want to copy
  2. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)
  3. Type Copy JSON Path and press Enter
  4. The path is copied to your clipboard!

Examples

Example 1: Simple Nested Object

{
  "user": {
    "profile": {
      "name": "John Doe",
      "email": "john@example.com",
      "settings": {
        "theme": "dark",
        "language": "en"
      }
    }
  }
}

Results:

  • Cursor on "name" → Copies: user.profile.name
  • Cursor on "email" → Copies: user.profile.email
  • Cursor on "theme" → Copies: user.profile.settings.theme
  • Cursor on "language" → Copies: user.profile.settings.language

Example 2: Configuration File

{
  "app": {
    "name": "My Application",
    "version": "1.0.0",
    "database": {
      "host": "localhost",
      "port": 5432,
      "credentials": {
        "username": "admin",
        "password": "secret"
      }
    },
    "features": {
      "darkMode": true,
      "notifications": {
        "enabled": true,
        "sound": false
      }
    }
  }
}

Results:

  • Cursor on "name" → Copies: app.name
  • Cursor on "host" → Copies: app.database.host
  • Cursor on "username" → Copies: app.database.credentials.username
  • Cursor on "enabled" → Copies: app.features.notifications.enabled

Example 3: API Response Structure

{
  "status": "success",
  "data": {
    "users": [
      {
        "id": 1,
        "name": "Alice"
      }
    ],
    "pagination": {
      "page": 1,
      "totalPages": 10,
      "itemsPerPage": 20
    }
  },
  "metadata": {
    "timestamp": "2024-01-01T00:00:00Z",
    "version": "v2.1"
  }
}

Results:

  • Cursor on "status" → Copies: status
  • Cursor on "users" → Copies: data.users
  • Cursor on "page" → Copies: data.pagination.page
  • Cursor on "timestamp" → Copies: metadata.timestamp

Example 4: Complex Nested Structure

{
  "company": {
    "name": "Tech Corp",
    "departments": {
      "engineering": {
        "team": {
          "frontend": {
            "lead": "Sarah",
            "members": 5
          },
          "backend": {
            "lead": "Mike",
            "members": 8
          }
        }
      },
      "marketing": {
        "budget": 50000,
        "campaigns": {
          "active": 3,
          "planned": 5
        }
      }
    }
  }
}

Results:

  • Cursor on "name" → Copies: company.name
  • Cursor on "frontend" → Copies: company.departments.engineering.team.frontend
  • Cursor on "lead" (in frontend) → Copies: company.departments.engineering.team.frontend.lead
  • Cursor on "budget" → Copies: company.departments.marketing.budget
  • Cursor on "active" → Copies: company.departments.marketing.campaigns.active

How It Works

The extension:

  1. Detects your cursor position in the JSON file
  2. Parses the JSON structure to find the key at that position
  3. Builds the complete path from root to the selected key
  4. Copies the path in dot notation (e.g., parent.child.key)

Requirements

  • VS Code or Cursor version 1.74.0 or higher
  • JSON or JSONC file format

Keyboard Shortcut

  • Windows/Linux: Ctrl+Shift+J (or Ctrl+Shift+P → Type "Copy JSON Path")
  • Mac: Cmd+Shift+J (or Cmd+Shift+P → Type "Copy JSON Path")

Troubleshooting

Path not found

  • Make sure your cursor is positioned on a key name (the left side of the colon)
  • Ensure the JSON file is valid (no syntax errors)
  • Try placing the cursor directly on the key name text

Extension not working

  • Reload VS Code/Cursor after installation
  • Check that the file has .json or .jsonc extension
  • Verify the extension is enabled in the Extensions panel

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Version

Current version: 0.1.0

License

This extension is licensed under the MIT License.

Support

If you encounter any issues or have feature requests, please open an issue on GitHub.


Enjoy faster JSON navigation! 🎉

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft