Microsoft OneDrive 365
The robomotion onedrive365 CLI connects to Microsoft OneDrive via the Graph API for file management. It uploads, downloads, lists, copies, moves, and deletes files; creates folders; generates sharing links; and manages file permissions.
When to use
- Upload or download files between local filesystem and OneDrive
- List, copy, move, or delete files and folders
- Create sharing links and manage file permissions
- Create folders and manage the file hierarchy
Prerequisites
robomotionCLI installed- Package installed:
robomotion install onedrive365 - Microsoft 365 OAuth2 credentials configured via Robomotion vault
IMPORTANT: Session Mode Required for Multi-Step Operations
Each CLI command runs as a separate process — connection IDs from connect do NOT persist across calls.
You MUST use --session on connect and pass --session-id to all subsequent commands.
Workflow
- Install (once):
robomotion install onedrive365 - Connect with session:
robomotion onedrive365 onedrive_connect --session --output json # → {"outClientId":"<client-id>","session_id":"<session-id>"} - Use the returned
client-idandsession-idin all subsequent commands:robomotion onedrive365 onedrive_upload_file --client-id "<client-id>" --local-path <file> --remote-path <dest> --session-id "<session-id>" --output json - Disconnect when done:
robomotion onedrive365 onedrive_disconnect --client-id "<client-id>" --session-id "<session-id>" --output json
Always append --output json to get structured JSON results.
Commands Reference
robomotion onedrive365 list_onedrive_files --folder-path --output jsonLists files in a OneDrive folderrobomotion onedrive365 get_onedrive_stats --file-path --output jsonGets metadata for a file or folder in OneDriverobomotion onedrive365 download_onedrive_file --remote-path --local-path --output jsonDownloads a file from OneDrive to a local pathrobomotion onedrive365 upload_onedrive_file --local-path --remote-path --output jsonUploads a local file to OneDriverobomotion onedrive365 delete_onedrive_file --file-path --output jsonDeletes a file from OneDriverobomotion onedrive365 copy_onedrive_file --source-path --destination-path --output jsonCopies a file to a new location in OneDriverobomotion onedrive365 move_onedrive_file --source-path --destination-path --output jsonMoves a file to a new location in OneDriverobomotion onedrive365 search_onedrive_files --search-query --output jsonSearches for files and folders in OneDriverobomotion onedrive365 list_onedrive_folders --folder-path --output jsonLists folders in a OneDrive folderrobomotion onedrive365 create_onedrive_folder --folder-path --output jsonCreates a new folder in OneDriverobomotion onedrive365 delete_onedrive_folder --folder-path --output jsonDeletes a folder from OneDriverobomotion onedrive365 create_onedrive_share_link --file-path [--link-type] [--scope] [--expiration] --output jsonCreates a shareable link for a file or folder in OneDriverobomotion onedrive365 get_onedrive_share_links --file-path --output jsonGets existing share links for a file or folder in OneDriverobomotion onedrive365 delete_onedrive_share_link --file-path --permission-id --output jsonDeletes a share link from a file or folder in OneDrive
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)