본문으로 건너뛰기
cccskills
무료GitHub에 공개

webarchive

Extract .webarchive files (saved from Safari) into plain HTML/assets using the WebArchiveExtractor CLI. Use when the user wants to unarchive, extract, or convert a .webarchive file.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md3.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

The user wants to extract a .webarchive file using WebArchiveExtractor.

If arguments were provided ($ARGUMENTS), use them to infer the input file and optionally the output directory or URL prepend. Otherwise, ask the user for the path to the .webarchive file.

How to run WebArchiveExtractor

/Applications/WebArchiveExtractor.app/Contents/MacOS/WebArchiveExtractor [-h] [-o <OutputDirectory>] [-p <URLPrepend>] -i <WebArchiveFile>

Options:

  • -i <WebArchiveFile> — required — path to the .webarchive file
  • -o <OutputDirectory> — directory to write extracted files into (optional; defaults to a directory named after the archive next to it)
  • -p <URLPrepend> — URI prefix to prepend to all asset URLs in the extracted HTML (optional; useful when serving the result from a subdirectory)

Shorthand (no flag):

WebArchiveExtractor website.webarchive

A positional argument is treated as the -i value.

Prerequisites

The app must be installed at /Applications/WebArchiveExtractor.app. Check with:

test -x /Applications/WebArchiveExtractor.app/Contents/MacOS/WebArchiveExtractor && echo "found" || echo "not installed"

If not found, tell the user to build and install from source (xcodebuild -project WebArchiveExtractor.xcodeproj) or drag a release build to /Applications.

To use WebArchiveExtractor without the full path, the user can add it to PATH:

export PATH="$PATH:/Applications/WebArchiveExtractor.app/Contents/MacOS/"

Or create a symlink:

ln -s /Applications/WebArchiveExtractor.app/Contents/MacOS/WebArchiveExtractor ~/.local/bin/WebArchiveExtractor

Steps

  1. Check the binary exists using the test command above. If not found, stop and direct the user to install the app.
  2. Determine the input .webarchive file from $ARGUMENTS or ask the user.
  3. Determine the output directory:
    • If the user explicitly provided one in $ARGUMENTS, use that.
    • Otherwise, default to ~/Downloads/<archive-name> (where <archive-name> is the input filename without the .webarchive extension).
    • If the user asks why ~/Downloads is the default, explain: macOS sandboxes the WebArchiveExtractor app, which restricts which directories the CLI can write to. The ~/Downloads folder is one of the few locations reliably accessible, so it's used as the default to avoid silent failures.
  4. Determine (optional) URL prepend from $ARGUMENTS or ask if needed.
  5. Run the extractor using the Bash tool:
    /Applications/WebArchiveExtractor.app/Contents/MacOS/WebArchiveExtractor -i "<input>" -o "<output>" [-p "<prepend>"]
    
  6. If successful, list the output directory contents with ls and summarise:
    • The output directory path
    • How many files were extracted
    • The main HTML file name (if identifiable)
  7. Offer to open the extracted HTML in the browser with open <file>.

Notes

  • .webarchive is a macOS-specific binary plist format used by Safari's "Save As Web Archive" feature.
  • The CLI and the GUI app are the same binary — running with -i suppresses the GUI.
  • Running with no arguments launches the GUI instead of extracting anything.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

이 스킬의 문제 신고