Concat Files — VS Code extension
Concatenate selected files and copy the combined output to the clipboard. Each file is wrapped with simple markers that show the original path.
Quick summary
- Command:
Concat Files
(command id: extension.concatFiles
)
- Activation: on startup and when the command is invoked
Features
- Concatenate one or more files and copy the result to the system clipboard
- Files are annotated with start/end markers that include a path relative to the workspace root (or absolute if outside a workspace)
- Skips non-file resources and shows warnings for files that cannot be read
Usage
- In Explorer, select one or more files, right-click and choose "Concat Files".
- Or open the Command Palette (Ctrl+Shift+P) and run "Concat Files".
- The combined text is copied to your clipboard. Paste where needed.
Development
Install dependencies and build the extension:
npm install
npm run build
The build produces the compiled output under out/
(the extension entry point is out/main.js
).
Package & publish
This repository includes npm scripts to package and publish with vsce
.
Package a .vsix locally:
npx vsce package
Publish to the Visual Studio Marketplace using a Personal Access Token (PAT):
Recommended interactive flow (safer):
npx vsce login <publisher>
# paste the token when prompted
npx vsce publish
Or, use a local token file without printing it to the console (example that reads .personal-access-token
):
$token = Get-Content -Raw -Path .personal-access-token
npx vsce publish -p $token
Important: Keep the PAT secret. Do not commit it. This repo already contains a .gitignore
entry to exclude .personal-access-token
.
Versioning
- Increment the
version
field in package.json
before publishing. The Marketplace requires a new semver for each release. You can use npm version patch
to bump the version and create a git tag.
Troubleshooting
- If publishing fails with authentication errors, confirm the
publisher
field in package.json
matches the publisher you registered on the Marketplace and that the PAT has publish permissions.
- If packaging fails, run the build and verify
out/main.js
exists.
Next steps I can take for you
- Build and package a
.vsix
locally.
- Publish to the Marketplace using the token in
.personal-access-token
(I will read it locally and not print it).
- Remove any accidentally committed token from git history and help rotate it.
Tell me which of the next steps you'd like me to run now.