
lionello/onedrive-cli
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
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- сбросает содержимое файла в stdoutchmod- изменение прав на совместное использованиеcp— копирует локальные файлы на OneDrive или наоборотdf— показывает статистику использования хранилища OneDrivefind- найти файл(ы) или папки по названию, по желанию разделённыеNULgrep- полнотекстовый поиск по диску, перечисляющий совпадающие пути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 stdoutchmod- change sharing permissionscp- copies local file(s) to OneDrive or vice-versadf- shows OneDrive storage usage statsfind- find file(s) or folder(s) by name, optionally separated byNULgrep- full-text search across the drive, listing matching pathshelp- shows list of supported commandsln- create a link to the remote itemlogin- request/store an OAuth access tokenls- list the contents of a foldermcp- run a read-only MCP server over stdiomkdir- create a remote foldermv- move a local file to OneDrive or vice-versarm- delete a file or folder from OneDrivesendmail- send an invitation email for editing to recipientsstat- 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
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"onedrive": {
"command": "onedrive",
"args": ["mcp"]
}
}
}