Skip to main content

OneDrive Manager (odman) - A professional CLI tool for OneDrive file operations via app-only authentication.

Project description

OneDrive Manager (odman)

A professional command-line tool to upload, download, and manage files in OneDrive using Microsoft Graph API with app-only authentication. Designed for automated scripts, backups, or any process requiring reliable OneDrive operations 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/odman.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/odman.git
cd odman
pip install .

Features

Modular Architecture - Clean, maintainable codebase with separated concerns
Upload Operations - Single files, directories, or mixed file/folder sets
Download Operations - Files and folders with recursive support
List Operations - Browse OneDrive contents with optional recursion
Progress Tracking - Rich progress bars and detailed operation summaries
Parallel Processing - Configurable concurrent workers (1-10)
Robust Error Handling - Retry logic with exponential backoff
App-only Authentication - No user interaction required

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. Usage

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

Upload

Upload files or folders to a user’s OneDrive.

Basic Upload

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

odman upload "/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.

odman upload "/path/to/server-backup.zip" -r "Server/DailyBackups"
Upload Multiple Files
odman upload file1.txt file2.jpg file3.pdf
Options
  • -r, --remote-folder: Destination path in OneDrive (folder will be created if missing)

  • -c, --chunk-size: Upload chunk size in bytes (for large files)

  • -w, --max-workers: Max number of parallel uploads (default: 3)

  • --no-progress: Disable the progress bar

Download

Download files or folders from OneDrive.

Basic Download
odman download "Documents/Report.pdf"
Download Multiple Files
odman download "Reports/2023.pdf" "Photos/Vacation/"
Download to Specific Local Folder
odman download "Docs/" -l "./local_folder"
Options
  • -l, --local-folder: Local folder to save downloaded files (default: ./downloads)

  • -c, --chunk-size: Chunk size for downloads (in bytes)

  • -w, --max-workers: Max number of parallel downloads (default: 3)

  • --no-progress: Disable progress bar

List

List contents of a OneDrive folder.

Basic List
odman list
List a Specific Folder
odman list "Documents/Work"
Recursive Listing
odman list "Projects" -r

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

odman-0.3.0a0.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

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

odman-0.3.0a0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file odman-0.3.0a0.tar.gz.

File metadata

  • Download URL: odman-0.3.0a0.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.4

File hashes

Hashes for odman-0.3.0a0.tar.gz
Algorithm Hash digest
SHA256 8780e2ebdea2c44cd59a3f50798dbd45dfe40d53786837f191597d11a0ddd5e0
MD5 007891570055b6d849413686715a85c7
BLAKE2b-256 edc1017b5552015e55b3163924503f9b911bec0d7bb0c4ec8a8ab52f6b6d48be

See more details on using hashes here.

File details

Details for the file odman-0.3.0a0-py3-none-any.whl.

File metadata

  • Download URL: odman-0.3.0a0-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.4

File hashes

Hashes for odman-0.3.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 838701c6b978a7a0dae99fc1121067aee9f9caefa9c42827d6b928c2dad976e6
MD5 a6631fca5f5ffb2bb563feb0add7bee0
BLAKE2b-256 60e1a1b5f743a3467c6311f3e3f4f852ce4b540b87cdc3d9c2ef317d3d09cd2d

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