Short description
Save, search, and share individual snippets and packs via GitHub Gists — create packs, import packs, and paste snippets back into your editor in one keystroke.
What is SnipShare?
SnipShare is a lightweight VS Code extension that helps you capture code from your editor, store it as GitHub Gists, and quickly re-insert or share those snippets with others. It supports single snippets and multi-snippet packs (a pack is a Gist containing multiple files and a manifest.json).
Key features
Create snippets from your selection or whole file
Search and insert snippets at the cursor
Share snippets (copy Gist link / raw URL / Markdown / open in browser)
Create / import packs (manifest-based bundles)
Simple PAT-based authentication (no OAuth device flow required in the MVP)
Local cache (VS Code globalState) for faster access and offline reads
How to get a GitHub PAT (Personal Access Token)
Go to GitHub: Settings → Developer settings → Personal access tokens → Tokens (classic) → Generate new token.
Give it a descriptive name: e.g. SnipShare - VS Code.
Expiration (recommended): choose a sensible expiry (30/90 days) if you prefer rotating tokens or choose custom/no expiration.
Scopes: check gist (this is required). You do not need to give repo scope unless you plan to publish to a team repo.
Click Generate token and copy the token.
Add PAT to SnipShare
Preferred: run Ctrl+Shift+P → SnipShare: Setup and paste the PAT when asked.
Manual (Settings JSON): open Preferences: Open Settings (JSON) and add:
Treat your GitHub Personal Access Token (PAT) like a password — do not commit it to source control.
The extension stores the PAT in your user settings (snipshare.githubToken) and in extension globalState (memento) for convenience and offline functionality.
Quick start
Open the project in VS Code and press F5 to start an Extension Development Host (or install the built .vsix).
Run SnipShare: Setup from the Command Palette and paste a GitHub Personal Access Token (PAT) with the gist scope.
Use the commands (Command Palette or the configured keybindings):
SnipShare: Create Snippet — save selected code or entire file into a private Gist.
SnipShare: Search Snippet — find snippets by title/description and insert at the cursor.
SnipShare: Share Snippet — copy the Gist link, raw URL, Markdown, or open in browser.
SnipShare: Create Pack — bundle selected snippets into one Gist with manifest.json.
SnipShare: Import Pack — import a pack from a Gist URL or local JSON.
SnipShare: Help — open this README inside VS Code.
Usage
Create a snippet
Select code in the editor (or leave nothing selected to capture the whole file).
Run SnipShare: Create Snippet (or press Ctrl+Alt+C if keybinding enabled).
Enter a title — SnipShare creates a private (secret) Gist and caches it locally.
Behavior: when creating, SnipShare will use your selected text. If nothing is selected, it captures the entire active document.
Create a snippet
Select code and run commandSnippet saved as private Gist
Search & insert
Click the editor where you want the snippet inserted (cursor must be active).
Optionally select some text — SnipShare will use the selection as the search query automatically.
Run SnipShare: Search Snippet (or press Ctrl+Alt+S).
Choose a snippet from the QuickPick — it will be inserted at your cursor.
Search results QuickPickSnippet inserted at cursor
Share a snippet
Run SnipShare: Share Snippet.
Pick one snippet, then choose one of:
Copy Gist link (html_url)
Copy Raw URL (useful for programmatic consumption)
Copy Markdown (wrapped in triple-backticks for Slack/GitHub)
Open in Browser
Note: Private (secret) Gists are accessible to anyone who has the URL.
Packs (bundle multiple snippets)
Create Pack: choose snippets to include; SnipShare will create one Gist containing multiple files and a manifest.json.
Import Pack: paste a pack Gist URL or open a local manifest; SnipShare imports the included snippets into your cache.
Network errors contacting GitHub — ensure https://api.github.com is reachable. If behind a corporate proxy, configure http.proxy in VS Code or set HTTP(S)_PROXY env vars for the Extension Development Host.
Invalid token / 401 — re-generate a PAT and ensure it has the gist scope.
No active editor — open a file before creating or inserting snippets.
Insert not appearing — make sure an editor is focused before running Search; use the keyboard shortcut so selection/cursor do not get lost.
Device Flow / OAuth errors — the current MVP uses PATs only (no device flow by default).
This repository is licensed under the MIT License (see LICENSE). MIT allows reuse and redistribution.
If you prefer a proprietary (All Rights Reserved) model, replace LICENSE with your chosen license text.
Support
Open an issue on GitHub with steps to reproduce and any logs printed in the SnipShare Debug output channel.
Credits
Created by suryansh-it
Privacy note (short)
The extension stores your PAT locally in user settings and the extension globalState.
Snippet content is sent only to GitHub (as Gist content) and not to any other third party.
No analytic tracking or telemetry is collected by default (you can add this later with explicit opt-in).