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.1.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.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onedriveuploader-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 224fe8bbae37cda9ff0f010954de19cd15abc4aaad07a4f7fa674959a6776e43
MD5 a9511bcb59c08ed6b2e9c0c64a1a50dd
BLAKE2b-256 daafd8f70a7528831ede67a5ddb8c9b3b75e8f3268fd9e64368858bf89711f7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onedriveuploader-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e97759a3ce1cd46f6c7d6310bb62904c3821c26597b20b69cf754ad2cb8bd94
MD5 e206b999bdcc55e91fc8d81a7d8b3a05
BLAKE2b-256 c8aba7cd65540e1387a1e6c4a5ead261d735040beecc161cdc6736579793ede0

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