Logo Octo Drive

Octo Drive

Tổ chức
Mininglamp-OSS
octo-drive

Octo Drive — spaces, folders, file upload/download, online-document mounts, share links, invites, IM-attachment transfer. Works with a bot token or a user API key; the CLI routes by token kind. Load after octo-shared.

Tổng quan

Nhà phát hànhMininglamp-OSS
Kho mãocto-cli
Tên kỹ năngocto-drive
Sao
918
Bản fork
130
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được Mininglamp-OSS công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Octo Drive trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Mininglamp-OSS/octo-cli/tree/main/skills/octo-drive
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Mininglamp-OSS/octo-cli.git /tmp/octo-cli
mkdir -p .claude/skills
cp -r /tmp/octo-cli/skills/octo-drive .claude/skills/octo-drive
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Octo Drive trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Octo Drive ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Octo Drive với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

octo-drive — network drive operations

45 commands over one backend. Everything is scoped to a drive space: either your personal space or a shared one you are a member of.

1. Credentials — nothing drive-specific

Drive uses the same credential as every other domain. Set one of:

bash
export OCTO_TOKEN=<uk_… | bf_… | app_…>      # preferred slot, any token kind
export OCTO_BOT_TOKEN=<bf_… | app_…>         # long-standing variable, still fine

OCTO_TOKEN wins when both are set, so you can run one command as a real person without disturbing a bot setup:

bash
OCTO_TOKEN=$UK_KEY octo-cli drive space list

A stored profile (octo-cli auth login) takes precedence over both. Do not create a drive-only profile — there is no such concept.

The token kind decides which identity the backend sees, and the CLI routes the request accordingly:

tokenacts asmount
uk_…the real person who owns the key/v1/user/drive/*
bf_…the User Bot/v1/bot/drive/*
app_…the App Bot/v1/bot/drive/*

Any other credential fails locally with TOKEN_KIND_NOT_ALLOWED (exit 2) — switch credentials, don't retry.

A bot has no implicit access: to touch a shared space it must be added as a member, exactly like a person. If a bot gets permission_denied, add it with drive member add. An app_… token may also lack a resolvable space entirely; that surfaces as a 401 (exit 3) from the server, and the fix is a bf_… or uk_… credential.

Drive never sends X-Space-Id — the tenant comes from the verified identity.

2. Ids — copy them, never compute with them

idshapeproduced byconsumed by
drive space idopaque string, e.g. personal:<octo-space>:<uid> or shared:<uuid>space create/list/get/ensure-personal → .data.id--space-id, --target-space-id, positional <space-id>
drive file iddecimal stringbrowse, folder create, upload file, doc mount, im-transfer create → .data.id<file-id>, --parent-id ("0" = space root)
doc_id / doc_space_idopaque stringsdoc candidates, doc list, file getdocument links only
share_id vs share_tokenopaque stringsshare create, share blob-create, share listshare_id → share revoke; the token is embedded in share_url
invite_id vs invite_tokenopaque stringsinvite create, invite listinvite_id → invite revoke; invite_token → invite accept

File ids are uint64 and are emitted as JSON strings on purpose. Values above 2^53 would be silently rounded by a JavaScript-style parser, addressing a different file. So: pass them through verbatim (-q '.data.id' | tr -d '"'), never do arithmetic on them, never reformat them. The CLI rejects a non-decimal or out-of-range id locally.

Why | tr -d '"' on every capture below. --jq/-q prints a JSON value, and ids are JSON strings — so -q '.data.id' emits "123" including the quotes, and a quoted id is rejected by the next command's id validation. There is no raw-output flag; -q is the only output filter the CLI defines. Strip the quotes in the shell. (Numbers already come out bare, so this matters for string-valued fields: every id, share_url, and every opaque token.)

Two traps worth naming:

  • space_id (the drive space) and doc_space_id (the document's own Octo Space) are different scopes. Building a document link from space_id produces a link to the wrong place. The CLI fails closed rather than substituting.
  • doc unmount takes the mount node id (.data.id), not the doc_id.

3. The five workflows

Space → folder → upload → share → download

bash
SPACE=$(octo-cli drive space create --name "Project files" -q '.data.id' | tr -d '"')
FOLDER=$(octo-cli drive folder create --space-id "$SPACE" --parent-id 0 --name Contracts -q '.data.id' | tr -d '"')
FILE=$(octo-cli drive upload file ./contract.pdf --space-id "$SPACE" --parent-id "$FOLDER" -q '.data.id' | tr -d '"')

SHARE_URL=$(octo-cli drive share create "$FILE" -q '.data.share_url' | tr -d '"')
# Hand SHARE_URL to the receiver verbatim. They never extract a token:
octo-cli drive share access   "$SHARE_URL"
octo-cli drive share download "$SHARE_URL" -o ./contract.pdf

# A space member can also download by internal id:
octo-cli drive download file "$FILE" -o ./copy.pdf

Personal space → mount a document → share its link

bash
SPACE=$(octo-cli drive space ensure-personal -q '.data.id' | tr -d '"')
DOC=$(octo-cli drive doc candidates --space-id "$SPACE" -q '.data.items[0].doc_id' | tr -d '"')
MOUNT=$(octo-cli drive doc mount --space-id "$SPACE" --doc-id "$DOC" -q '.data.id' | tr -d '"')
DOC_URL=$(octo-cli drive share create "$MOUNT" -q '.data.share_url' | tr -d '"')

octo-cli drive share access "$DOC_URL"      # resolves the target; grants nothing
# `share download` on a document link fails with NOT_DOWNLOADABLE — by design.

doc mount takes no --doc-title: the title and the document's real Octo Space are read server-side from the document metadata, so they cannot drift.

Invite a member

bash
SPACE=$(octo-cli drive space create --name "Collab" -q '.data.id' | tr -d '"')
INVITE_ID=$(octo-cli drive invite create "$SPACE" --role editor -q '.data.invite_id' | tr -d '"')
TOKEN=$(octo-cli drive invite list "$SPACE" -q '.data.invites[0].invite_token' | tr -d '"')

octo-cli drive invite accept "$TOKEN"          # as the invitee's credential
octo-cli drive invite revoke "$SPACE" "$INVITE_ID"

invite_id / invite_token are base64url and may start with -; prefer --invite-id / --invite-token in scripts so a leading dash is never parsed as a flag.

Roles accepted by invite create: preview_only, downloader, uploader_downloader, editor, admin (admin only if you are the space's super_admin). custom and super_admin are rejected on invites. Or add a known uid directly:

bash
octo-cli drive member add "$SPACE" --uid "$UID" --role editor

member add / member set-role accept one more role than invites do — custom, the lowest rank (below preview_only). super_admin is never grantable: it is bound to the space creator at space creation.

rolemember add / set-roleinvite create
preview_only / downloader / uploader_downloader / editor✅✅
admin✅ super_admin only✅ super_admin only
custom✅❌
super_admin❌❌

Drive has no user search — get a uid from the message/group commands or your own context.

IM attachment → drive

bash
MSG=$(octo-cli message search files --chat-id "$GROUP" -q '.data.items[0].message_id' | tr -d '"')
FILE=$(octo-cli drive im-transfer create \
  --im-group-no "$GROUP" --im-channel-type 2 --im-msg-id "$MSG" \
  --target-space-id "$SPACE" -q '.data.id' | tr -d '"')

--im-channel-type is required: 1=DM, 2=group, 5=thread, and it must be the kind the message actually came from. It picks the upstream message-read route (1 uses the DM route; 2 and 5 share the group route, where group vs sub-thread comes from the composite group_no), and it is stored as the first segment of the row's source_key (channelType#channelID#msgID), which the chat file-card's already-transferred lookup matches on — a wrong value makes that lookup miss. Anything outside 1|2|5 is rejected locally (ENUM_NOT_ALLOWED, exit 2).

Transfer idempotency is keyed on (target space, type=blob, object path), not on the channel type: a replay of the same message returns the existing row with idempotent: true, and a wrong channel type cannot produce a duplicate file. Keep the message id a string.

Browse and act

bash
octo-cli drive browse --space-id "$SPACE" --parent-id 0
octo-cli drive browse --space-id "$SPACE" --type blob --source user-upload

FILE=$(octo-cli drive browse --space-id "$SPACE" -q '.data.entries[0].id' | tr -d '"')
octo-cli drive file get    "$FILE"                       # type → blob | doc | folder
octo-cli drive file move   "$FILE" --parent-id "$FOLDER"
octo-cli drive file rename "$FILE" --name new-name.pdf
octo-cli drive file copy   "$FILE" --parent-id "$FOLDER"

file get is how you branch: type tells you whether an id is a blob, a mounted document, or a folder.

browse returns the complete listing; its page object is an envelope, not a database page, so --page-index / --page-size do not actually narrow the result yet.

Full-text search

drive search is full-text search across every space the caller can see (name + blob/doc body via OpenSearch), scoped by the caller's own membership — a bot only sees spaces it was added to. --page-index here IS a real page (0-based).

bash
octo-cli drive search --q "报销单"                              # all visible spaces
octo-cli drive search --q "预算" --scope space --space-id "$SPACE"
octo-cli drive search --q "合同" --data '{"filters":{"type":"blob","owner_scope":"me"}}'

Advanced --filters (pass via --data): type (folder|doc|blob), owner_scope (me|others), updated_after (RFC3339), size_min/size_max (bytes). Each hit carries file_id, path (breadcrumb), type, highlights.{name,body} with <mark> fragments, and owner_uid/updater_uid (resolve display names via the message/group commands — search returns uids, not names). Requires the server's search backend to be configured; otherwise the call returns unavailable (503).

4. Upload and download in detail

drive upload file runs prepare → PUT to object storage → confirm. The PUT goes out on a separate HTTP client that carries no Octo credential — the presigned URL is its own authorisation. If anything fails after the pending row exists, the CLI cancels it and the error reports the file_id plus the cancel outcome:

json
{"ok":false,"error":{"code":"UPLOAD_FAILED","detail":{"file_id":"42","pending_file":"cancelled"}}}

If pending_file is not cancelled, run octo-cli drive upload cancel <file-id> yourself.

drive download file and drive share download write to a randomly-named partial file next to the destination, fsync, then rename — an interrupted transfer never leaves a truncated file, and a pre-created symlink at a guessable path cannot redirect the write. An existing destination is refused unless you pass --overwrite. The result carries a sha256 you can verify.

The low-level steps stay available (upload prepare|confirm|cancel, download url) if you need to drive the transfer yourself.

drive blob create is a different thing and is rarely what you want: it registers an object already in storage rather than uploading one. The backend verifies it — an --object-path storage does not hold is invalid_argument, and a --size that conflicts with the stored object is rejected (--size 0 for a non-empty object included) — so it can no longer produce a row that lists fine and 404s on download. If storage is unreachable the probe is inconclusive and you get a 500 to retry, not invalid_argument. It still persists no download URL, so share download on such a row answers not_found. Use drive upload file unless the bytes are already in the bucket.

5. Share links

There is exactly one thing the two sides exchange: data.share_url.

bash
octo-cli drive share create "$FILE" --permission download --expires-in-seconds 86400 --password-file ./pw
  • The password is passed out of band — it is never in the URL, and it is masked in --verbose / --dry-run output.
  • Prefer --password-file <path> (or --password-file - for stdin) over --password. A value on argv is readable from ps and /proc and lands in shell history for the process lifetime, the same reason auth login takes its token from --token-file / stdin and never from the command line. --password still works for interactive use. One trailing newline is stripped from the file; nothing else is, so a password may begin or end with a space.
  • --permission is held to the spec's view | download enum locally: anything else is ENUM_NOT_ALLOWED / exit 2 with no request sent.
  • Both sides need a credential. There is no anonymous share. The token (and password) authorise the share; your credential authenticates you. The receiver does not have to be a member of the file's space.
  • share access / share download accept only links on your configured Octo origin — same scheme, host and port — in exactly the /drive/s/<token> or /d/<docId>?sp=<docSpaceId> shape. Anything else fails with INVALID_SHARE_URL — the CLI parses the link, it never fetches the host in it. Pass the link exactly as share create produced it; a scheme-downgraded copy of an otherwise correct link is refused.
  • downloadable tells you which command to use next. Documents are always false, and so is a blob shared with --permission view — share download on either answers permission_denied. Only --permission download yields bytes.
  • Revoke with the share_id, not the token: octo-cli drive share revoke "$SHARE_ID". The share_id is itself treated as a secret — the backend returns one opaque id that is both the management handle and the access token — so --verbose, --dry-run and error output show it as ***REDACTED***. That is the mask, not a wrong id: the real value still goes on the wire. Read it from share create / share list output, which is not masked.
  • base64url ids can start with - (about one in 64), which cobra reads as a flag. Pass those as a flag instead — octo-cli drive share revoke --share-id "$SHARE_ID" — or put the value after a -- separator. The same applies to --invite-id (invite revoke) and --invite-token (invite accept). Using the flag form unconditionally is the safe habit for a script.

6. Errors

codetype / exitwhat to do
TOKEN_KIND_NOT_ALLOWEDvalidation / 2switch credentials; do not retry
ENUM_NOT_ALLOWEDvalidation / 2the value is outside the spec's enum; the hint lists the accepted set
unauthorizedauth / 3token invalid, revoked, or the user/bot is inactive
permission_deniedpermission / 1the identity lacks the space role; drive member add it
password_required / wrong_passwordpermission / 1pass or fix the password (--password-file)
share_expiredpermission / 1ask for a new link
not_foundapi_error / 1check the id and that the space is reachable
conflictvalidation / 2re-read state, then retry
invalid_argumentvalidation / 2check the schema: octo-cli schema drive.<op>
FILE_EXISTSvalidation / 2pass --overwrite or pick another path
NOT_DOWNLOADABLEvalidation / 2a document link; use share access or a browser
INVALID_SHARE_URLvalidation / 2pass the share_url exactly as produced
MISSING_DOC_SPACE_IDvalidation / 2re-mount the document; never substitute the drive space id
UNSAFE_PRESIGNED_URLapi_error / 1the backend returned an unusable URL, or one whose host resolves to this machine; report it
TRANSFER_REDIRECTED_LOCALLYvalidation / 2the transfer was rerouted to this machine but the URL does not name it; check http_proxy / https_proxy / all_proxy / no_proxy
INVALID_PROXYvalidation / 2the proxy value in this environment is not a usable URL. The value is never echoed, because a proxy URL often carries credentials
PARTIAL_FILE_REPLACEDvalidation / 2something replaced the part file or the destination mid-download; nothing was published, re-run in a directory only you can write
UPLOAD_FAILEDapi_error / 1the presigned PUT was rejected or the confirm failed; the detail carries file_id and whether the pending row was cancelled
INVALID_FLAGvalidation / 2a positional id starting with - was parsed as a flag; pass it as the named flag or after --

7. Destructive commands

space delete, member remove, folder delete, blob delete, doc unmount, share revoke, invite revoke are all high-risk writes with no confirmation prompt (agent runtimes cannot prompt). Deletes are soft on the backend, but folder delete takes the whole subtree with it.

Preview any write first:

bash
octo-cli drive folder delete "$FOLDER" --dry-run

--dry-run on upload file, download file, share create and share download describes the plan and stops: no pending row is created, no URL is fetched, nothing is written to disk.

8. Full command list

drive browse
drive search
drive space       create | list | ensure-personal | get | rename | delete
drive member      list | add | set-role | remove
drive folder      create | list | rename | move | delete
drive file        get | move | copy | rename
drive blob        create | get | list | delete
drive upload      file | prepare | confirm | cancel
drive download    file | url
drive doc         mount | unmount | list | candidates
drive share       create | blob-create | list | revoke | access | download
drive invite      create | list | revoke | accept
drive im-transfer create

Per-command flags: octo-cli drive <group> <verb> --help, or octo-cli schema drive.<group>.<verb> for the wire contract.

Câu hỏi thường gặp

Kỹ năng AI Octo Drive làm được gì?

Octo Drive — spaces, folders, file upload/download, online-document mounts, share links, invites, IM-attachment transfer. Works with a bot token or a user API key; the CLI routes by token kind. Load after octo-shared.

Vì sao nên dùng Octo Drive trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Octo Drive là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Octo Drive trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Mininglamp-OSS/octo-cli/tree/main/skills/octo-drive. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Octo Drive?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Octo Drive với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Octo Drive với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Octo Drive có miễn phí không?

Có. Kỹ năng này được Mininglamp-OSS phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇