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.1.0.tar.gz (22.5 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.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for onedriveuploader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d65fb1aa9f341ca286d24c2add5bf06ccfe4c27c46043448c97f23f0f554250e
MD5 5a6f09d9b3e39314803eef6d4c562b7b
BLAKE2b-256 7631e96ddc310a298f9ecdebc49caab511db6f7ee5ef3e0f12621498443198ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onedriveuploader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9144b4b813547236136c1fdd3c783680800e0f2c1fa97e232fec2ee06549a3f
MD5 5e72b390e3fe6550f560631366bff362
BLAKE2b-256 2ddd4eff4f51fc5c91fab8cfd718aecdbd4349c8a63f869f4ba6d34702faa2c0

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