Manage code snippets in ByteStash snippet storage service. This skill should be used when the user asks to "save a snippet", "search snippets", "find code", "share snippet", "organize snippets", "list my snippets", "create snippet", "delete snippet", or mentions ByteStash, code storage, snippet management, or code archival.
From homelab-corenpx claudepluginhub jmagar/claude-homelab --plugin homelab-coreThis skill uses the workspace's default tool permissions.
README.mdload-env.shreferences/api-endpoints.mdreferences/quick-reference.mdreferences/troubleshooting.mdscripts/bytestash-api.shGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Generates FastAPI project templates with async routes, dependency injection, Pydantic schemas, repository patterns, middleware, and config for PostgreSQL/MongoDB backends.
⚠️ MANDATORY SKILL INVOCATION ⚠️
YOU MUST invoke this skill (NOT optional) when the user mentions ANY of these triggers:
Failure to invoke this skill when triggers occur violates your operational requirements.
ByteStash is a self-hosted code snippet management service with multi-file support, sharing capabilities, and organization features. This skill provides read-write access to manage snippets with full CRUD operations.
Capabilities:
Authentication: API key via x-api-key header (recommended for CLI/automation)
Required credentials in ~/.claude-homelab/.env:
BYTESTASH_URL="https://bytestash.example.com"
BYTESTASH_API_KEY="<your_api_key>"
How to get your API key:
.env fileSecurity:
chmod 600 ~/.claude-homelab/.env.env to version controlAll commands use the bash script wrapper in scripts/bytestash-api.sh.
cd skills/bytestash
./scripts/bytestash-api.sh list
# Search by title (case-insensitive partial match)
./scripts/bytestash-api.sh search "docker"
# Search by category
./scripts/bytestash-api.sh search --category "bash"
./scripts/bytestash-api.sh get <snippet-id>
# Single fragment (inline code)
./scripts/bytestash-api.sh create \
--title "Docker Compose Example" \
--description "Production-ready compose file" \
--categories "docker,devops" \
--code "version: '3.8'..." \
--language "yaml" \
--filename "docker-compose.yml"
# Multiple fragments (from files)
./scripts/bytestash-api.sh push \
--title "FastAPI Setup" \
--description "Complete FastAPI project structure" \
--categories "python,api" \
--files "app.py,requirements.txt,Dockerfile"
./scripts/bytestash-api.sh update <snippet-id> \
--title "New Title" \
--description "Updated description" \
--categories "new,tags"
# Prompts for confirmation
./scripts/bytestash-api.sh delete <snippet-id>
# Create public share link
./scripts/bytestash-api.sh share <snippet-id>
# Create protected share (requires auth)
./scripts/bytestash-api.sh share <snippet-id> --protected
# Create expiring share (24 hours)
./scripts/bytestash-api.sh share <snippet-id> --expires 86400
# List all shares for a snippet
./scripts/bytestash-api.sh shares <snippet-id>
# Delete share link
./scripts/bytestash-api.sh unshare <share-id>
# View shared snippet
./scripts/bytestash-api.sh view-share <share-id>
When the user asks about ByteStash:
"Save this code as a snippet"
create command with inline codepush command with file paths"Find my Docker snippets"
search --category docker or search "docker"get <id> to show full snippet"Share this snippet publicly"
share <snippet-id> to create public link{BYTESTASH_URL}/s/{share-id}--protected or --expires flags"What snippets do I have?"
list command"Delete this snippet"
delete <snippet-id>"Organize my snippets by category"
listupdate commandByteStash supports snippets with multiple code fragments (files). Each fragment has:
app.py, Dockerfile)python, dockerfile)When to use multi-fragment:
Data Model:
{
"id": 123,
"title": "Snippet Title",
"description": "Detailed description",
"categories": ["tag1", "tag2"],
"fragments": [
{
"id": 456,
"file_name": "example.py",
"code": "print('hello')",
"language": "python",
"position": 0
}
],
"updated_at": "2024-01-01T00:00:00Z",
"share_count": 2
}
Authentication:
x-api-key header with API key from .envShare Links:
abc123def456)Destructive Operations:
Output Format:
jq for filtering/formatting (e.g., ./bytestash-api.sh list | jq '.[] | select(.categories[] == "docker")')Limitations:
/api/share*)references/api-endpoints.md for complete API referencereferences/quick-reference.md for command examplesreferences/troubleshooting.md for common failures{BYTESTASH_URL}/api-docs/{BYTESTASH_URL}CRITICAL: When invoking scripts from this skill via the zsh-tool, ALWAYS use pty: true.
Without PTY mode, command output will not be visible even though commands execute successfully.
Correct invocation pattern:
<invoke name="mcp__plugin_zsh-tool_zsh-tool__zsh">
<parameter name="command">./skills/bytestash/scripts/bytestash-api.sh [args]</parameter>
<parameter name="pty">true</parameter>
</invoke>