references/config.json (or fallback references/config.example.json). Default allowlist should be /OpenClaw/**.Treat these files as sensitive (never commit, never paste their contents):
references/session_api.json, references/cookies.json, references/login_token.json, references/qr_code.pngreferences/index.json (may contain private filenames/paths)Do not print cookies, auth headers, or full raw responses unless user explicitly requests debug.
When sharing the skill, keep examples generic (no usernames, absolute paths, chat_id, or personal tokens).
requirements.txt exists for portability/reference.references/config.jsonreferences/config.example.jsonKey fields (example names; see config.example.json):
remoteAllowlist: e.g. ["/OpenClaw/**"]localAllowlist: e.g. ["/path/to/Uploads"]loginTimeoutSecondslogin-prepare to generate QRlogin-wait to persist sessionUse orchestration pattern:
Run: channel-run <op> ...
If exit code == 10 and JSON contains need_login: true:
qr_png back to the current chat/channellogin-wait (poll every ~5s)channel-run <op> ...Machine-readable interaction exit codes (for orchestration):
need_login=trueneed_pick=true (multiple candidates; re-run with --pick)need_confirm=true (destructive ops; re-run with --confirm)Invoke as:
python3 scripts/quark_drive.py <cmd> [args...]loginlogin-prepare [--no-open]login-waitauth-statuschannel-run <op> [args...] (preferred)telegram-run <op> [args...] (alias)mkdir <remote_path>ls <remote_path> [--json]search <keyword> [--allow-outside-openclaw] (privacy default: scoped to /OpenClaw/**)upload <local_file>When the user asks to “生成分享链接/创建分享/分享某个文件(夹)”:
Search candidates first (do not ask user to provide full remote path).
Default: use server search.
If server search is insufficient and the user wants stronger fuzzy search, use a client-side fuzzy index and rank results by fuzzy score.
Only keep candidates whose resolved path is inside remote allowlist.
If multiple candidates: list them with index + path + type/size, ask user to pick.
Before creating the share, ask:
Expiry: 1 / 7 / 30 / 永久
Passcode: 有 / 无
If user does not answer: default to no passcode + permanent.
share-create <remote_path> [--days 1|7|30|0] [--passcode XXXX] [--title ...]share-create-auto <keyword> [--pick N] [--days 1|7|30|0] [--passcode XXXX] [--local] [--allow-outside-openclaw]
--pick is omitted, returns JSON with need_pick=true and a candidate list.Local index helpers:
index-build --root <remote_path> --max-items <n> [--write] (may issue many API calls; without --write it does not persist)search-local <keyword> [--top N] (builds ephemeral index; does not persist)share-save <share_text_or_url> [--passcode XXXX] [--to /OpenClaw/FromShares] [--no-wait]Notes:
rename <src_path> <new_name>mv <src_path> <dst_dir>rm <src_path> --confirm (soft-delete into /OpenClaw/.trash)purge-trash --days <n> --confirmauth-status fails (401/403): session expired → run login flow again.share-save fails with “用户禁止转存自己的分享”: you tried saving your own link → test with someone else’s share.