Export private repository to public community version
Exports private repository to public community version with sanitized history and automated PR creation.
/plugin marketplace add signalcompose/ypm/plugin install signalcompose-ypm-2@signalcompose/ypmThis command exports from a private repository to public community version.
First run performs interactive setup, subsequent runs execute export automatically.
Execute the following steps strictly:
Check ~/.ypm/config.yml for settings.language setting.
Detection rules:
settings.language is set, use that languageNote detected language internally for use in STEP 3 and STEP 4-2 AskUserQuestion.
pwd
git branch --show-current
Check current directory and report to user.
ls -la .export-config.yml 2>/dev/null || echo "NOT_FOUND"
Decision:
.export-config.yml exists -> Skip to STEP 4.export-config.yml doesn't exist -> Proceed to STEP 3Use AskUserQuestion tool to collect the following information:
Collect:
Recommended exclusions:
Collect sensitive keywords to remove from commit messages (comma-separated).
Important: Normalize data before generating YAML.
owner/name to https://github.com/owner/name.gitUse Write tool to generate .export-config.yml:
# Export Configuration for [Project Name]
# Generated: [Today's date]
export:
private_repo: "[normalized path]"
public_repo_url: "[normalized URL]"
exclude_paths:
- CLAUDE.md
- config.yml
- PROJECT_STATUS.md
- docs/research/
sanitize_patterns:
# patterns if any
After creation -> Proceed to STEP 4
yq eval '.export' .export-config.yml
Present settings to user.
Check if repository exists and branch accordingly:
Ask user for confirmation to create repository.
Confirm with user and proceed.
~/.claude/scripts/export-to-community.sh
Script operations:
After script execution:
When using gh commands during this command, always verify:
Projects with upstream settings (private forks, etc.) may have gh command default to upstream repository. This could create PR/Issues in wrong repository.
Before executing gh command, always verify current repository matches gh default repository.
# Current repository (from origin)
CURRENT_REPO=$(git remote get-url origin | sed -E 's/.*github\.com[:/](.*)(\.git)?/\1/')
# gh default repository
GH_DEFAULT_REPO=$(gh repo view --json nameWithOwner --jq '.nameWithOwner' 2>/dev/null)
# Match check
if [ "$CURRENT_REPO" != "$GH_DEFAULT_REPO" ]; then
echo "Warning: Repository mismatch detected"
echo " Current working repo: $CURRENT_REPO"
echo " gh default: $GH_DEFAULT_REPO"
echo ""
echo "Use -R flag to explicitly specify:"
echo " gh pr create -R $CURRENT_REPO --base develop --head feature/xxx"
exit 1
fi
git-filter-repo, yq, gh (GitHub CLI), trufflehog