LO

lionello/onedrive-cli

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

179 stars 25 forks Качество 81 Тренд 20MIT

lionello/onedrive-cli — это кандидат для MCP-сервера, импортированный из https://github.com/lionello/onedrive-cli.

Обзор

lionello/onedrive-cli — это кандидат для MCP-сервера, импортированный из https://github.com/lionello/onedrive-cli.

Обзор (машинный перевод)

Кроссплатформенный командный интерфейс для OneDrive (Personal)

Установка

С npm:

Это устанавливает команду как onedrive, с псевдонимом [[T2].

Или с nix-env:

Или из источника:

Начало

Войдите один раз, затем используйте диск как файловую систему:

login открывает ваш браузер, затем хранит токен доступа, который он возвращается обратно ~/.onedrive-cli-token (или $XDG_STATE_HOME, если он установлен). Жетоны допустимы в течение одного часа, поэтому запускайте login снова, когда команда сообщает, что токен просрочен. Добавьте -r для жетона только для чтения.

Использование

usage: onedrive COMMAND [arguments]

Запускайте onedrive help (или -h/--help) для этого списка в любое время, и onedrive --version для установленной версии. Команды следующие:

  • album - составлять список, создавать или редактировать фотоальбомы (ls/create/add/rm)
  • cat - сбросает содержимое файла в stdout
  • chmod - изменение прав на совместное использование
  • cp — копирует локальные файлы на OneDrive или наоборот
  • df — показывает статистику использования хранилища OneDrive
  • find - найти файл(ы) или папки по названию, по желанию разделённые NUL
  • grep - полнотекстовый поиск по диску, перечисляющий совпадающие пути
  • help — показывает список поддерживаемых команд

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

onedrive-cli

Cross-platform command line interface for OneDrive (Personal)

Installation

With npm:

npm install -g @lionello/onedrive-cli

That installs the command as onedrive, with onedrive-cli as an alias for it.

Or with nix-env:

nix-env -if https://github.com/lionello/onedrive-cli/archive/master.tar.gz -A package

Or from source:

git clone https://github.com/lionello/onedrive-cli.git
cd onedrive-cli
npm install
bin/onedrive login

Getting started

Sign in once, then use the drive like a filesystem:

onedrive login          # opens the Microsoft login page
onedrive df             # check the connection and storage usage
onedrive ls             # list your drive root

login opens your browser, then stores the access token it gets back in ~/.onedrive-cli-token (or $XDG_STATE_HOME if that is set). Tokens are valid for one hour, so run login again when a command reports that the token expired. Add -r for a read-only token.

Usage

usage: onedrive COMMAND [arguments]

Run onedrive help (or -h/--help) for this list at any time, and onedrive --version for the installed version. The commands are:

  • album - list, create, or edit photo albums (ls/create/add/rm)
  • cat - dumps the contents of a file to stdout
  • chmod - change sharing permissions
  • cp - copies local file(s) to OneDrive or vice-versa
  • df - shows OneDrive storage usage stats
  • find - find file(s) or folder(s) by name, optionally separated by NUL
  • grep - full-text search across the drive, listing matching paths
  • help - shows list of supported commands
  • ln - create a link to the remote item
  • login - request/store an OAuth access token
  • ls - list the contents of a folder
  • mcp - run a read-only MCP server over stdio
  • mkdir - create a remote folder
  • mv - move a local file to OneDrive or vice-versa
  • rm - delete a file or folder from OneDrive
  • sendmail - send an invitation email for editing to recipients
  • stat - dump all information for particular file(s)
  • wget - copy a remote URL to OneDrive (server side)

Examples

List the contents of the Public folder

onedrive ls Public

Grep one file

onedrive cat Documents/passwords | grep boa

Let OneDrive upload a file server side

onedrive wget http://mega.com/somehugepublicfile Documents/somehugepublicfile

Upload files recursively

find * -type f -print0 | xargs -0 -n1 -I{} onedrive cp "./{}" "Shared Favorites/{}"

Move remote files to a new folder

onedrive find 'Pictures/Camera Roll' -regex 2015 -type f -print0 | xargs -0 onedrive mv -t :/Pictures/2015/

Create an album and add photos to it
onedrive album create 'Summer 2026'
onedrive album add 'Summer 2026' 'Pictures/Camera Roll/IMG_1234.jpg'
onedrive albums                # list all albums
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "onedrive": { "command": "onedrive", "args": ["mcp"] } } }