
Printing Press Import
Back up an existing Printing Press library CLI and manuscripts to a zip before importing or overwriting an api-slug.
Overview
printing-press-import is an agent skill for the Build phase that backs up Printing Press library and manuscript folders before import overwrites.
Install
npx skills add https://github.com/mvanhorn/cli-printing-press --skill printing-press-importWhat is this skill?
- Zips library/<api-slug>/ and manuscripts/<api-slug>/ under PRINTING_PRESS_HOME
- Writes timestamped archives to /tmp/printing-press/<api-slug>-<UTC>.zip
- Preserves restore-friendly layout: library/ and manuscripts/ relative paths inside the zip
- Exits cleanly when nothing exists to backup for the given api-slug
- Pairs with fetch/import flows for one CLI subtree and its .manuscripts
- Backs up up to two directory trees per slug: library/ and manuscripts/
Adoption & trust: 1.9k installs on skills.sh; 3.1k GitHub stars; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are importing or refreshing a Printing Press api-slug and might wipe local library or manuscript work with no snapshot.
Who is it for?
Builders using Printing Press CLI layouts who run import-fetch or overwrite flows and want a one-command backup first.
Skip if: Teams not using Printing Press, cloud-only manuscript stores, or anyone needing incremental sync instead of full-directory zip backup.
When should I use this skill?
Before overwriting or importing a Printing Press api-slug when library/<api-slug>/ or manuscripts/<api-slug>/ may exist.
What do I get? / Deliverables
You get a timestamped zip under /tmp/printing-press with the library and manuscripts layout ready to restore by hand.
- Timestamped zip archive path on stdout
- Staged backup preserving library/ and manuscripts/ structure
Recommended Skills
Journey fit
Import and backup scripts sit where builders curate local agent libraries and manuscript trees—the agent-tooling shelf of the Build phase. Printing Press is a personal CLI press layout; preserving library/ and manuscripts/ is tooling hygiene before structural changes.
How it compares
Local bash backup helper for Printing Press—not a general database migration or git-based snapshot skill.
Common Questions / FAQ
Who is printing-press-import for?
Solo developers operating mvanhorn’s Printing Press home layout with per-api-slug library and manuscripts directories.
When should I use printing-press-import?
Right before import or overwrite of a Printing Press api-slug during Build agent-tooling setup, when both library and manuscripts may change.
Is printing-press-import safe to install?
It runs filesystem copies and zip locally; review the Security Audits panel on this page and read the script before agent execution on sensitive paths.
SKILL.md
READMESKILL.md - Printing Press Import
#!/usr/bin/env bash # import-backup.sh — zip an existing internal library CLI + its manuscripts # to /tmp/printing-press/ before overwriting. # # Usage: # import-backup.sh <api-slug> # # Backs up: # ${PRINTING_PRESS_HOME:-$HOME/printing-press}/library/<api-slug>/ # ${PRINTING_PRESS_HOME:-$HOME/printing-press}/manuscripts/<api-slug>/ (if present) # # Output: prints the absolute path of the resulting zip on stdout. set -euo pipefail [[ $# -eq 1 ]] || { echo "usage: $0 <api-slug>" >&2; exit 2; } API_SLUG="$1" BACKUP_DIR="/tmp/printing-press" TS=$(date -u +%Y%m%dT%H%M%SZ) ZIP_PATH="$BACKUP_DIR/${API_SLUG}-${TS}.zip" PRESS_HOME="${PRINTING_PRESS_HOME:-$HOME/printing-press}" LIBRARY_DIR="$PRESS_HOME/library/$API_SLUG" MANUSCRIPTS_DIR="$PRESS_HOME/manuscripts/$API_SLUG" if [[ ! -d "$LIBRARY_DIR" && ! -d "$MANUSCRIPTS_DIR" ]]; then echo "nothing to backup for $API_SLUG" >&2 exit 0 fi mkdir -p "$BACKUP_DIR" # Stage in a temp dir so the zip preserves the relative layout users # would need to restore by hand: library/<api>/ and manuscripts/<api>/. STAGE=$(mktemp -d) trap 'rm -rf "$STAGE"' EXIT if [[ -d "$LIBRARY_DIR" ]]; then mkdir -p "$STAGE/library" cp -R "$LIBRARY_DIR" "$STAGE/library/" fi if [[ -d "$MANUSCRIPTS_DIR" ]]; then mkdir -p "$STAGE/manuscripts" cp -R "$MANUSCRIPTS_DIR" "$STAGE/manuscripts/" fi (cd "$STAGE" && zip -qr "$ZIP_PATH" .) echo "$ZIP_PATH" #!/usr/bin/env bash # import-fetch.sh — fetch one CLI subtree + its .manuscripts from the # public library into a staging dir. # # Usage: # import-fetch.sh <library-path> <staging-dir> [--clone <local-clone-path>] # # Where <library-path> is the `path` field from registry.json (e.g. # `library/productivity/cal-com`). When --clone is supplied, the script # copies from the local clone instead of hitting GitHub. # # Exits 0 on success; non-zero on any failure. set -euo pipefail usage() { echo "usage: $0 <library-path> <staging-dir> [--clone <path>]" >&2 exit 2 } [[ $# -lt 2 ]] && usage LIB_PATH="$1" STAGING="$2" shift 2 CLONE_PATH="" while [[ $# -gt 0 ]]; do case "$1" in --clone) CLONE_PATH="${2:-}" [[ -z "$CLONE_PATH" ]] && usage shift 2 ;; *) usage ;; esac done mkdir -p "$STAGING" if [[ -n "$CLONE_PATH" ]]; then SRC="$CLONE_PATH/$LIB_PATH" [[ -d "$SRC" ]] || { echo "source not found in clone: $SRC" >&2; exit 1; } cp -R "$SRC/." "$STAGING/" exit 0 fi # Remote fetch: shallow clone the whole repo to a temp dir, then copy the # subtree out. GitHub's contents API can't return whole subtrees in one # call and rate-limits per-file fetching for large CLIs. A shallow clone # is ~2-5 MB and one round-trip. TMP_CLONE=$(mktemp -d) trap 'rm -rf "$TMP_CLONE"' EXIT git clone --depth 1 --quiet \ https://github.com/mvanhorn/printing-press-library.git \ "$TMP_CLONE" SRC="$TMP_CLONE/$LIB_PATH" [[ -d "$SRC" ]] || { echo "source not found in clone: $SRC" >&2; exit 1; } cp -R "$SRC/." "$STAGING/" #!/usr/bin/env bash # import-place.sh — atomically move a staged CLI + its manuscripts into # the internal library at ${PRINTING_PRESS_HOME:-$HOME/printing-press}/. # # Layout: # <staging>/ (CLI files at root) # <staging>/.manuscripts/<run>/ (one or more run-id dirs) # # Lands as: # ${PRINTING_PRESS_HOME:-$HOME/printing-press}/library/<api-slug>/ (CLI files) # ${PRINTING_PRESS_HOME:-$HOME/printing-press}/manuscripts/<api-slug>/<run>/ (each run dir) # # Any pre-existing target dirs are removed first; back them up with # import-backup.sh before invoking this. # # Usage: # import-place.sh <staging-dir> <api-slug> set -euo pipefail [[ $# -eq 2 ]] || { echo "usage: $0 <staging-dir> <api-slug>" >&2; exit 2; } STAGING="$1" API_SLUG="$2" [[ -d "$STAGING" ]] || { echo "staging dir not found: $STAGING" >&2; exit 1; } PRESS_HOME="${PRINTING_PRESS_HOME:-$HOME/printing-press}" LIB_TARGET="$PRESS_HOME/library/$API_SLUG" MAN_TARGET_ROOT="$PRESS_HOME/manuscripts/$API_S