GiftHub CLI integration — auto-detect GiftHub config (v2 .claude/.gfs/config.json or v1 .gfh.json), inject usage context, auto-install after build
- version
- 1.2.1
Install
/plugin install gifthub@psychquant-claude-pluginsRun it inside Claude Code after adding the marketplace with /plugin marketplace add PsychQuant/psychquant-claude-plugins.
Contents
Discovered from sourceSkills 2
/gfh-import — Import Drive File into GiftHub
Move a Google Drive file into the GiftHub-LFS folder, create an LFS pointer via gfh link, and optionally pull the actual file.
Prerequisites
- GiftHub config exists:
.claude/.gfs/config.json(v2 layout,預設)或.gfh.json(v1 layout,backward-compat) gfhCLI installed (~/bin/gfh)gwsCLI installed (Google Workspace CLI)
Execution
Step 1: Read repo config
# v0.4.0+:自動 resolve v2 path 優先,v1 fallback
if [ -f ".claude/.gfs/config.json" ]; then
cat .claude/.gfs/config.json
elif [ -f ".gfh.json" ]; then
cat .gfh.json
fi
Extract:
driveFolderId— the GiftHub-LFS folder on DriveregistryPath/aliasRegistryPath— alias file path
Step 2: Determine source file
If user provides a Drive file ID or URL:
- Extract file ID from URL (format:
https://drive.google.com/file/d/{ID}/...) - Verify file exists:
gws drive files get --params '{"fileId":"ID","fields":"id,name,size,parents"}'
If user says "latest Meet recording" or similar:
- Read project CLAUDE.md for Meet Recordings folder ID
- List recent files:
gws drive files list --params '{"q":"FOLDER_ID in parents","fields":"files(id,name,size,createdTime)","orderBy":"createdTime desc","pageSize":5}' - Ask user to confirm which file
Step 3: Determine local path
If user provides a local path: use it directly.
If not: ask user. Suggest based on project conventions (e.g., from CLAUDE.md naming patterns).
Step 4: Move + rename on Drive
Move the file from its current folder to the GiftHub-LFS folder, and rename if needed:
gws drive files update \
--params '{"fileId":"FILE_ID","addParents":"GFH_FOLDER_ID","removeParents":"SOURCE_FOLDER_ID"}' \
--json '{"name":"NEW_NAME.mp4"}'
addParents: GiftHub-LFS folder ID (from config — v2.claude/.gfs/config.jsonor v1.gfh.json)removeParents: the file's current parent folder ID (from Step 2 metadata)name: new filename matching project convention
Skip if file is already in the GiftHub-LFS folder.
Step 5: Create LFS pointer via gfh link
gfh link "FILE_ID" "LOCAL_PATH"
This will:
- Stream the file from Drive to compute SHA-256 (no full download needed)
- Create a local pointer file (135 bytes)
- Register the SHA → Drive ID alias in
lfs-registry-aliases.json
Step 6: Pull the actual file
gfh pull "LOCAL_PATH"
Downloads the full file from Drive, replacing the pointer.
Step 7: Git add (optional)
Ask user if they want to stage the file:
git add "LOCAL_PATH"
Step 8: Report
✅ Imported: {filename}
Drive ID: {id}
Local: {path}
Size: {size}
Status: hydrated (full file)
Error Handling
gfh linkfails: Check ifgfhversion supportslink(requires v0.3.0+). Suggest~/bin/gfh version.gfh pullfails (500 from Drive): File may still be processing on Google's side (common with fresh Meet recordings). Suggest waiting 10-30 minutes and retrying, or manual browser download.- File already exists locally: Ask user whether to overwrite or skip.
Notes
gfh linkis preferred over downloading first +gfh push, because it avoids a full download-then-reupload cycle — the file stays on Drive, only the SHA is computed via streaming.- Project-specific parameters (Meet folder ID, naming conventions, target directories) come from the project's CLAUDE.md, not this skill. This skill only handles the generic GiftHub import workflow.
/gfh-status — GiftHub Repo Status
Show the current state of GiftHub in this repo.
Steps
- Check
.gfh.jsonexists — if not, report "Not a GiftHub repo" - Read
.gfh.jsonto get Drive folder ID - Count total files tracked by git:
git ls-files | wc -l - Count pointer files (< 200 bytes, starts with
version https://git-lfs) - Count hydrated files (tracked by LFS but not pointers)
- Check
~/bin/gfhexists and get version - Check if pre-push hook is installed:
cat .git/hooks/pre-push
Output Format
## GiftHub Status
| Item | Value |
|------|-------|
| Drive folder | {id} |
| gfh version | {version} |
| Total tracked | {N} files |
| Pointers | {N} (need `gfh pull`) |
| Hydrated | {N} |
| Pre-push hook | installed / missing |
Hooks 2
Sponsors
Details
- Marketplace
- PsychQuant/psychquant-claude-plugins
- Source
- plugins/gifthub
- Author
- Che Cheng
- Category
- Development
More from PsychQuant/psychquant-claude-plugins
All 42- issue-driven-devv2.9.0
- lean-proverv1.1.0
- mcp-tccv0.1.2
- mcp-toolsv1.13.0
- parallel-ai-agentsv1.1.1
- perspective-writerv2.2.0
- plugin-toolsv1.8.0
- postgresql-guidev1.0.0
- r-docs-guidev1.0.0
- r-shiny-debuggerv1.3.0
- safari-browserv2.11.0
- tool-finderv1.0.0
- agent-cacherv0.1.0
- ai-docs-guidev1.4.0
- archive-firstv2.2.0
- batch-ocrv0.1.0
- bestocrv0.1.0
- che-apple-devv1.2.0
- che-apple-mail-mcpv2.0.1
- che-apple-notes-mcpv0.2.1
- che-archive-linesv1.0.0
- che-axiom-systemsv1.0.0
- che-biblatex-mcpv0.4.0
- che-bot-toolkitv0.1.0
