{"id":13942234,"url":"https://github.com/lionello/onedrive-cli","last_synced_at":"2025-04-09T20:07:58.024Z","repository":{"id":42225664,"uuid":"76175018","full_name":"lionello/onedrive-cli","owner":"lionello","description":"Command line interface for OneDrive","archived":false,"fork":false,"pushed_at":"2024-02-20T19:31:39.000Z","size":266,"stargazers_count":149,"open_issues_count":6,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-09T20:07:54.201Z","etag":null,"topics":["command-line","command-line-tool","nodejs","onedrive","onedrive-api","onedrive-client","onedrive-storage"],"latest_commit_sha":null,"homepage":"https://www.lunesu.com/onedrive-cli/","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lionello.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-12-11T13:10:15.000Z","updated_at":"2025-04-08T12:46:27.000Z","dependencies_parsed_at":"2024-04-10T13:54:14.854Z","dependency_job_id":"d3fcd758-6a62-4407-9172-637ee4fe25c2","html_url":"https://github.com/lionello/onedrive-cli","commit_stats":{"total_commits":87,"total_committers":6,"mean_commits":14.5,"dds":"0.14942528735632188","last_synced_commit":"932dee899a014ce1975b22563874a3e580a4d2f3"},"previous_names":["enumatech/onedrive-cli"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lionello%2Fonedrive-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lionello%2Fonedrive-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lionello%2Fonedrive-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lionello%2Fonedrive-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lionello","download_url":"https://codeload.github.com/lionello/onedrive-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","command-line-tool","nodejs","onedrive","onedrive-api","onedrive-client","onedrive-storage"],"created_at":"2024-08-08T02:01:46.120Z","updated_at":"2025-04-09T20:07:57.996Z","avatar_url":"https://github.com/lionello.png","language":"Nix","funding_links":[],"categories":["Nix"],"sub_categories":[],"readme":"# onedrive-cli\nCross-platform command line interface for OneDrive (Personal)\n\n## Development\nThe provided `shell.nix` for the [Nix](https://nixos.org) package manager contains all development dependencies.\nUse it with `nix-shell` or [Direnv](https://direnv.net)'s `use nix`.\n\n### Update Nix files\n```sh\nnode2nix -l package-lock.json\n```\n\n## Installation\nFrom source:\n```sh\n$ git clone https://github.com/lionello/onedrive-cli.git\n$ cd onedrive-cli\n$ npm install\n$ bin/onedrive login\n```\n\nOr use `npm`:\n```sh\nnpm install @lionello/onedrive-cli\n```\n\nOr use `nix-env`:\n```sh\nnix-env -if https://github.com/lionello/onedrive-cli/archive/master.tar.gz -A package\n```\n\n## Usage\n`usage: onedrive COMMAND [arguments]`\n\nThis little utility supports the following commands:\n* `cat` - dumps the contents of a file to stdout\n* `chmod` - change sharing permissions\n* `cp` - copies local file(s) to OneDrive or vice-versa\n* `df` - shows OneDrive storage usage stats\n* `find` - find file(s) or folder(s) by name, optionally separated by `NUL`\n* `help` - shows list of supported commands\n* `ln` - create a link to the remote item\n* `login` - request/store an OAuth access token\n* `ls` - list the contents of a folder\n* `mkdir` - create a remote folder\n* `mv` - move a local file to OneDrive or vice-versa\n* `rm` - delete a file from OneDrive (not implemented)\n* `sendmail` - send an invitation email for editing to recipients\n* `stat` - dump all information for particular file(s)\n* `wget` - copy a remote URL to OneDrive (server side)\n\n## Examples\n##### List the contents of the Public folder\n`onedrive ls Public`\n\n##### Grep one file\n`onedrive cat Documents/passwords | grep boa`\n\n##### Let OneDrive upload a file server side\n`onedrive wget http://mega.com/somehugepublicfile Documents/somehugepublicfile`\n\n##### Upload files recursively\n`find * -type f -print0 | xargs -0 -n1 -I{} onedrive cp \"./{}\" \"Shared Favorites/{}\"`\n\n##### Move remote files to a new folder\n`onedrive find 'Pictures/Camera Roll' -regex 2015 -type f -print0 | xargs -0 onedrive mv -t :/Pictures/2015/`\n\n## FAQ\n##### Access token was not found; 'login' first.\nThe `onedrive` utility needs an access token in order to read/write to your OneDrive storage.\nUse the`onedrive login` command to get the address of the Microsoft login page. After login,\nthis page will redirect to the file `oauthcallbackhandler.html` (https://github.com/lionello/onedrive-cli/blob/master/docs/oauthcallbackhandler.html)\nand extract the `access_token` from the URL parameters. Copy-paste this token into the command line.\nThis will save the token in a file called `~/.onedrive-cli-token`. These tokens have a validity of 1 hour.\n\n##### \"An item with the same name already exists under the parent\"\nCurrently, a copy will fail if a file with the same it already exists.\nChange the name of the target, or use other means to delete/rename the existing file in your OneDrive.\n\n##### Invalid source name\nYou cannot copy folders. Specify a source file instead, or use wildcards.\n\n##### Invalid target name\nThe target file name cannot be determined from the source path. Specify a target file name.\n\n##### Use ./ or :/ path prefix for local or remote paths.\nThe `cp` command supports both local-\u003eremote as well as remote-\u003elocal copy.\nTo make it clear which path is remote and which is local, either use `./` as a prefix for\nthe local path, or use `:/` as a prefix for the remote path. Either one will suffice.\n\n##### chmod: Invalid file mode\nThe `chmod` command currently only supports `-w` or `-rw`. The former tried to downgrade *write*\nshares to *read*-only, whereas the latter removes all shares for the given item(s). Octal modes are accepted (for example `644`, `0700`) as well as `og-rw` or `g-w`.\n\n## TODO\n* Implement `rm`\n* Support gzip/deflate encoding for downloads\n* Uploads larger than 100MiB are not yet supported (needs range API)\n* Support OneDrive for Business\n* Ability to get the link for a file\n* Skip upload/download if the SHA1 matches\n* Adding write permissions (+w) to existing share links\n\n## DONE\n* Register with NPM ([@lionello/onedrive-cli](https://www.npmjs.com/package/@lionello/onedrive-cli))\n* Fixed OAuth redirect on Safari (https://bugs.webkit.org/show_bug.cgi?id=24175)\n* Use XDG path spec for token file (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)\n* Using `async`/`await`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flionello%2Fonedrive-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flionello%2Fonedrive-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flionello%2Fonedrive-cli/lists"}