Skip to main content

A CLI tool to upload files to a user's OneDrive via app-only auth.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

OneDrive Uploader CLI

A command-line tool to upload files to a specific user's OneDrive using Microsoft Graph API with app-only authentication. Ideal for automated scripts, backups, or any process without user interaction.

Installation

Using pipx (Recommended)

The easiest way to install the tool is with pipx, which installs it in an isolated environment.

pipx install git+https://github.com/sumanmichael/onedriveuploader.git

Using pip (from source)

If you want to install it from a local clone (e.g., for development):

git clone https://github.com/sumanmichael/onedriveuploader.git
cd onedriveuploader
pip install .

Release and Changelog

This project follows Semantic Versioning and maintains a CHANGELOG.md with all notable changes.

Automated Releases

Releases are automated using Conventional Commits:

  • fix: commits trigger patch releases (0.1.0 → 0.1.1)
  • feat: commits trigger minor releases (0.1.0 → 0.2.0)
  • feat!: or BREAKING CHANGE: trigger major releases (0.1.0 → 1.0.0)

Contributing

Please see CONTRIBUTING.md for commit message conventions and development guidelines.

Usage Guide

1. Prerequisites: Microsoft Entra ID App Registration

Before using the tool, you need to register an application in Microsoft Entra ID (Azure AD) and grant it Files.ReadWrite.All Application permission for Microsoft Graph. An administrator must grant admin consent for this permission.

You will need to collect the following credentials from your app registration:

  • Application (client) ID
  • Directory (tenant) ID
  • Client Secret Value
  • User ID (The User Principal Name or Object ID of the target user)

2. Configure Environment Variables

The tool reads credentials from environment variables.

Linux / macOS (~/.bashrc or ~/.zshrc):

export ONEDRIVE_CLIENT_ID="<Your_Application_Client_ID>"
export ONEDRIVE_TENANT_ID="<Your_Directory_Tenant_ID>"
export ONEDRIVE_CLIENT_SECRET="<Your_Client_Secret_Value>"
export ONEDRIVE_USER_ID="<Target_User_ID_or_Email>"

Windows (PowerShell):

$env:ONEDRIVE_CLIENT_ID="<Your_Application_Client_ID>"
$env:ONEDRIVE_TENANT_ID="<Your_Directory_Tenant_ID>"
$env:ONEDRIVE_CLIENT_SECRET="<Your_Client_Secret_Value>"
$env:ONEDRIVE_USER_ID="<Target_User_ID_or_Email>"

Remember to reload your shell or open a new terminal to apply the changes.

3. Run the Uploader

Once configured, you can run the tool from any directory.

Basic Upload

To upload a file to the root of the target user's OneDrive:

onedriveuploader "/path/to/your/local/file.txt"

Upload to a Specific Folder

To upload a file to a specific folder (e.g., Documents/Backups), use the -d or --destination flag. If the folder does not exist, it will be created.

onedriveuploader "/path/to/server-backup.zip" -d "Server/DailyBackups"

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onedriveuploader-0.2.0.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onedriveuploader-0.2.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file onedriveuploader-0.2.0.tar.gz.

File metadata

  • Download URL: onedriveuploader-0.2.0.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for onedriveuploader-0.2.0.tar.gz
Algorithm Hash digest
SHA256 24976c054fb5b3a1c1b370f888e7831ea613b808103d86f362d42ea7180f218c
MD5 b0d4c5ee3d30a7f65e81d3d8f5fa8550
BLAKE2b-256 72f048d7fd0dc2eca3e2cd618ba573485d0e174563bbc5e602b5c15c13132ab2

See more details on using hashes here.

File details

Details for the file onedriveuploader-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for onedriveuploader-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb7ccfb5ef4c437efb5f5f1f04f77ced22447bf5614ef4368e1d7d1ad33e6143
MD5 1c4562885a6b4c29a6d1dd8ffb25e0ab
BLAKE2b-256 e324c5c30662c5f00fe537ce16024e1ef394e7a3146fbeba73b79498cecfbf60

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page