megvii-research/megfile/skill

Claude Code and agent skill by megvii-research/megfile

Trust tier 2
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use megfile’s APIs, SmartPath, configuration, and CLI to perform filesystem tasks easy across local FS, S3/OSS-style object storage, SFTP, WebDAV, HTTP, HDFS, and stdio.

Install

npx vskill@latest install megvii-research/megfile/skill

SKILL.md

Megfile

Overview

Guide to using megfile’s unified APIs, SmartPath, configuration, and CLI for file operations across various backends, like local FS, S3/OSS-compatible object storage, SFTP, WebDAV, HTTP, HDFS, and stdio.

Quick Start

  • Install base: pip install megfile; add extras per backend (megfile[cli], megfile[hdfs], megfile[webdav]).
  • Configure credentials/endpoints (env vars > config files). S3 examples: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, optional AWS_ENDPOINT_URL / OSS_ENDPOINT / AWS_ENDPOINT_URL_S3, AWS_S3_ADDRESSING_STYLE.
  • Path format: protocol://bucket/key or alias (e.g., tos://); bare POSIX paths are treated as file://.
  • Import functional APIs (from megfile import smart_open, smart_sync, ...) or SmartPath (from megfile.smart_path import SmartPath).

Supported Protocols & Extras

  • Local FS (file:// or bare paths) — base install.
  • S3/OSS-compatible (s3://, plus aliases) — base install.
  • SFTP (sftp://) — install megfile[cli] or megfile with SFTP deps.
  • HTTP/HTTPS (http://, https://) — base install.
  • Stdio (stdio://) — base install.
  • HDFS (hdfs://) — install megfile[hdfs].
  • WebDAV (webdav://) — install megfile[webdav].
  • Full Protocol path format reference: references/path_format.md.

Core Tasks

File IO
  • smart_open(path, mode='r', encoding=None, **options): open binary/text handles.
  • Convenience loaders/savers: smart_load_content / smart_save_content (bytes), smart_load_text / smart_save_text (str), smart_save_as(file_obj, path), smart_load_from(path) returns BinaryIO.
  • smart_combine_open(glob, mode='rb', open_func=smart_open): sequentially reads multiple files as one stream.
Existence & Metadata
  • smart_exists, smart_isfile, smart_isdir, smart_islink, smart_isabs.
  • smart_access(path, mode=Access.READ/WRITE).
  • smart_stat / smart_lstat (via SmartPath), smart_getsize, smart_getmtime, smart_getmd5(recalculate=False, followlinks=False).
Listing & Globbing
  • Directory traversal: smart_listdir, smart_scandir, smart_walk, smart_scan, smart_scan_stat (returns FileEntry/StatResult).
  • Pattern matching: smart_glob, smart_iglob, smart_glob_stat for stat-rich globbing.
Data Transfer & Lifecycle
  • Copy/sync: smart_copy, smart_sync, smart_sync_with_progress (progress-friendly wrapper), smart_concat to merge multiple sources.
  • Moves/deletes: smart_move, smart_rename, smart_remove, smart_unlink, smart_touch, smart_makedirs.
  • Links: smart_symlink, smart_readlink.
Path Utilities
  • smart_path_join, smart_abspath, smart_realpath, smart_relpath, smart_isabs.
  • SmartPath mirrors pathlib semantics but routes to the right backend: path = SmartPath("s3://bucket/key"); path.exists(); path.open(mode="rb").
Caching
  • smart_cache(path, cacher=SmartCacher, **options): cache remote resources locally for tools that only support local files.

Configuration

  • Use CLI helpers to persist credentials/endpoints; environment variables take precedence.
  • Profiles enable multiple endpoints (e.g., s3+prod://...). See references/configuration/ for protocol-specific flags and env vars.
  • Full config reference: references/configuration/.

CLI Essentials

  • Install CLI extras: pip install 'megfile[cli]'.
  • Common commands (ls/cp/sync/stat/md5sum/mkdir/rm/touch) mirror POSIX semantics across backends.
  • Completion scripts: megfile completion zsh.
  • Full command list and flags: references/cli.md.

Usage Notes

  • Prefer smart_* for protocol-agnostic code paths; avoid branching per backend.
  • Ensure required extras are installed for target protocols before invoking APIs.
  • For high-volume sync/copy, supply map_func (e.g., ThreadPoolExecutor.map) and callback to report progress.
  • Use aliases via megfile config alias <alias> <protocol> to shorten paths (e.g., tos://).

References

  • API surface: references/megfile.smart.md and references/megfile.smart_path.md.
  • Configuration flags, env vars, and profiles: references/configuration/
  • CLI commands and flags: references/cli.md
  • Full Protocol path format reference: references/path_format.md.
  • Glob patterns reference: references/advanced/glob.md.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
174
Repository forks
20
7-day trend score
26

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/megvii-research/megfile/skill/badge)](https://verified-skill.com/skills/megvii-research/megfile/skill)

Something wrong with this skill or its page? Tell us.