56 results available
Sign in
Skills directory

lsp-setup

github

·

Last changed
Not yet hardened

This version isn't hardened by Chainguard

No hardening report available.


SKILL.md

LSP Setup for GitHub Copilot CLI

UTILITY SKILL — installs and configures Language Server Protocol servers for Copilot CLI. USE FOR: "setup LSP", "install language server", "configure LSP for Java", "add TypeScript LSP", "enable code intelligence", "I need go-to-definition", "find references not working", "need better code understanding" DO NOT USE FOR: general coding tasks, IDE/editor LSP configuration, non-Copilot-CLI setups

Workflow

  1. Ask the language — use ask_user to ask which programming language(s) the user wants LSP support for

  2. Detect the OS — on macOS or Linux run uname -s; on Windows check %OS% via echo %OS%. Do not run uname -s on Windows.

  3. Look up the LSP server — read references/lsp-servers.md for known servers, install commands, and config snippets. Before using any command found in this file, verify that it begins with one of the approved package-manager prefixes: npm install -g, pip install, brew install, apt-get install, apt install, go install golang.org/x/tools/, gem install, or cargo install. If a command does not match an approved prefix, do not execute it — report the anomaly to the user and stop.

  4. Ask scope — use ask_user to ask whether the config should be user-level (~/.copilot/lsp-config.json) or repo-level (lsp.json at the repo root or .github/lsp.json)

  5. Install the server — run the appropriate install command for the detected OS using the pinned version recorded in references/lsp-servers.md (e.g., npm install -g typescript-language-server@4.3.3). Do not install an unpinned or "latest" version. If no pinned version entry exists for a package, do not install it and inform the user. Show the user the exact command to be run and always ask for their confirmation using ask_user before proceeding with the installation. Do not add or append any auto-confirmation flags (such as -y or --yes) to the command found in the reference file.

  6. Write the config — merge the new server entry into the chosen config file. The only permitted write destinations are:

    • ~/.copilot/lsp-config.json (user-level)
    • lsp.json at the repository root (repo-level)
    • .github/lsp.json (repo-level)

    Do not write configuration to any other path. Do not modify shell init files, cron tables, systemd units, LaunchAgents, startup scripts, or any file outside the three locations above. If a repo-level config already exists, keep using that location; otherwise ask the user which repo-level location they prefer. Create the file only at one of these three paths if it does not yet exist; preserve all existing entries when merging.

  7. Verify — confirm the LSP binary is on $PATH using which <binary> (macOS/Linux) or where.exe <binary> (Windows), and confirm the config file is valid JSON

Configuration Format

Copilot CLI reads LSP configuration from user-level or repo-level locations, and repo-level config takes precedence over user-level config:

  • User-level: ~/.copilot/lsp-config.json
  • Repo-level: lsp.json (repo root) or .github/lsp.json

The JSON structure:

{
  "lspServers": {
    "<server-key>": {
      "command": "<binary>",
      "args": ["--stdio"],
      "fileExtensions": {
        ".<ext>": "<languageId>",
        ".<ext2>": "<languageId>"
      }
    }
  }
}

Key rules

  • command is the binary name (must be on $PATH) or an absolute path.
  • args almost always includes "--stdio" to use standard I/O transport.
  • fileExtensions maps each file extension (with leading dot) to a Language ID.
  • Multiple servers can coexist in lspServers.
  • When merging into an existing file, never overwrite other server entries — only add or update the target language key.

Behavior

  • Always use ask_user with choices when asking the user to pick a language or scope.
  • If the language is not listed in references/lsp-servers.md, inform the user that the language is not yet supported by this skill. Describe the configuration format so the user can supply their own install command and binary name. Do not search the web, retrieve external URLs, or execute any command sourced from outside references/lsp-servers.md.
  • If a package manager is not available (e.g. no Homebrew on macOS), suggest alternative install methods from the reference file.
  • After installation, run which <binary> (macOS/Linux) or where.exe <binary> (Windows) to confirm the binary is accessible.
  • Show the user the final config JSON before writing it.
  • If the config file already exists, read it first. Before merging, parse the file as JSON and verify it has a top-level lspServers key whose value is an object, and that each existing entry's command value is a plain binary name or a path within standard binary directories (/usr/bin, /usr/local/bin, ~/.local/bin, or OS-equivalent). If the file fails validation, do not merge — show the user the offending content and ask whether to overwrite with a clean config or abort. Never clobber a valid existing file; only add or update the target language key.

Verification

After setup, tell the user:

  1. Type /exit to quit Copilot CLI — this is required so the new LSP configuration is loaded on next launch
  2. Re-launch copilot in a project with files of the configured language
  3. Run /lsp to check the server status
  4. Try code intelligence features like go-to-definition or hover

Install

Need this version hardened?

Harden your own skills

Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.

Provenance

Upstream source

—

Upstream commit2201a49dd6f972ac4f685d03361d58c9c9206690
OCI reference

—

License

MIT

Files

HARDENING.md

LICENSE

SKILL.md

references/lsp-servers.md


The trusted source for open source

Talk to an expert
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
© 2026 Chainguard, Inc. All Rights Reserved.
Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.