Skip to content
Back to search

onedrive-share-links

Create and verify "anyone with the link" sharing links for specific files in a OneDrive folder synced on Windows (OneDrive for Business / Microsoft 365 or personal OneDrive), using the signed-in OneDrive client's "Copy link" command — no Microsoft Graph app, admin consent, tokens or cookies. Use when the user asks for a public, shareable or anonymous link to a file in their OneDrive, or a list of links for several attachments.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/nekatek-labs--onedrive-share-links/badge.svg)](/listings/nekatek-labs--onedrive-share-links)

HTML

<a href="/listings/nekatek-labs--onedrive-share-links"><img src="/api/listings/nekatek-labs--onedrive-share-links/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

The fastest way, for any agent supported by the [`skills` CLI](https://github.com/vercel-labs/skills):

npx skills add nekatek-labs/onedrive-share-links

Or clone it into your agent's skills folder:

| Agent | User-level folder | Project-level folder | |---|---|---| | Claude Code | `~/.claude/skills/` | `.claude/skills/` | | OpenAI Codex | `~/.codex/skills/` or `~/.agents/skills/` | `.agents/skills/` | | Gemini CLI | `~/.gemini/skills/` | `.gemini/skills/` | | GitHub Copilot | `~/.copilot/skills/` | `.github/skills/` | | Cursor | `~/.cursor/skills/` | `.cursor/skills/` | | OpenCode | `~/.config/opencode/skills/` | `.opencode/skills/` |

git clone https://github.com/nekatek-labs/onedrive-share-links "$HOME\.claude\skills\onedrive-share-links"

Folder conventions change between agent versions; if yours is not listed, check its docs for "skills". Agents without skill support can still use it: point them at `SKILL.md` as instructions.

Dependencies (skip if you use `uv`):

pip install pywin32 httpx

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 53 lines
  1. ---
  2. name: onedrive-share-links
  3. description: Create and verify "anyone with the link" sharing links for specific files in a OneDrive folder synced on Windows (OneDrive for Business / Microsoft 365 or personal OneDrive), using the signed-in OneDrive client's "Copy link" command — no Microsoft Graph app, admin consent, tokens or cookies. Use when the user asks for a public, shareable or anonymous link to a file in their OneDrive, or a list of links for several attachments.
  4. license: MIT
  5. compatibility: Windows 10/11 with the OneDrive sync client signed in; Python 3.9+ with pywin32 and httpx (or uv). Network access to the user's SharePoint/OneDrive host for verification.
  6. metadata:
  7. version: "1.0.0"
  8. ---
  9. # OneDrive sharing links
  10. Creates sharing links for files the user names, through the OneDrive client already signed in on Windows, then checks whether each link opens without signing in. Reply to the user in their own language.
  11. ## Key facts
  12. - An "open" URL (`Doc.aspx`, `?id=`, the address bar of OneDrive on the web) identifies a file but grants **no** access. Only a sharing link does. Never hand one out as a share link.
  13. - The link is created with the account's **default** sharing settings (audience and view/edit role), which OneDrive or the organization's admin controls. The script verifies anonymous access; it cannot set or read whether the link allows editing. If the user needs view-only, tell them to confirm it in **Manage access > Links** for that file. Do not claim a link is view-only from its URL.
  14. - Never extract tokens or cookies from Office or the sync client. If the client offers no "Copy link" command, report it; do not look for workarounds.
  15. ## Procedure
  16. 1. Identify the exact files. Act only on files the user named or that are clearly part of the request. Folders are refused on purpose, and so are files outside the synced OneDrive folders. If the request already names the files and asks for public links, that is the user's go-ahead: do not ask again.
  17. 2. Optionally preview what will be shared, without creating anything:
  18. ```
  19. python scripts/onedrive_public_links.py --dry-run "<file>" [...] --json
  20. ```
  21. 3. Create the links:
  22. ```
  23. python scripts/onedrive_public_links.py --public "<file>" ["<file>" ...] --json
  24. ```
  25. - Paths may be absolute or relative to the OneDrive folder.
  26. - Add `--csv <output.csv>` (in the user's working folder) for several files.
  27. - With `uv` installed, `uv run scripts/onedrive_public_links.py ...` installs dependencies automatically; otherwise `pip install pywin32 httpx`.
  28. - The script path is relative to this skill's folder.
  29. 4. Read each result's `anonymous_access` / `access`:
  30. - `yes` — deliver the link as public.
  31. - `no` — the link needs sign-in or is restricted (the org may block "Anyone" links). Do not call it public; tell the user to change it in **Manage access > Links** or ask their admin.
  32. - `unknown` — could not confirm (common for personal OneDrive, whose page is rendered by JavaScript). Deliver the link but say it was not verified and suggest opening it in a private window.
  33. - `error` set — report the message for that file; the other files still ran.
  34. 5. Exit codes: `0` every link verified public, `2` some file failed or did not verify, `1` usage or environment problem.
  35. ## Notes
  36. - The OneDrive command uses the clipboard. The script puts the previous clipboard text back when it finishes (`--keep-link-in-clipboard` leaves the last link there instead). Non-text clipboard content (images) is not preserved.
  37. - The menu command is matched by its localized name in many languages. If the error lists the available verbs and yours is missing, pass it with `--verb "<name>"`.
  38. - To test, use a throwaway file, then remove its link in **Manage access > Links** and delete the file.
  39. - Run `python scripts/onedrive_public_links.py --help` for every option.
  40. Reference: [Share OneDrive files and folders (Microsoft Support)](https://support.microsoft.com/en-us/onedrive/share-files-and-folders-in-microsoft-onedrive)
README.md · README · 112 lines
  1. # onedrive-share-links
  2. An [Agent Skill](https://agentskills.io) that creates **"anyone with the link"** sharing links for specific OneDrive files and verifies that each one really opens without signing in.
  3. It drives the OneDrive client already signed in on Windows (the Explorer **Copy link** command), so it needs **no Microsoft Graph app registration, no admin consent, no tokens and no cookies**. That makes it usable in Microsoft 365 tenants where Graph tools are blocked pending admin approval.
  4. > *Español más abajo.*
  5. ## What it does
  6. ```text
  7. > Give me public links for Reports/annex-1.pdf and Reports/annex-2.pdf
  8. Reports/annex-1.pdf
  9. account: business (contoso-my.sharepoint.com)
  10. link: https://contoso-my.sharepoint.com/:b:/g/personal/...
  11. public: yes - opens without signing in
  12. ```
  13. - Works with **OneDrive for Business / Microsoft 365** and **personal OneDrive**; accounts and tenant are detected from the OneDrive client.
  14. - Refuses folders and files outside your synced OneDrive folders, so an agent cannot overshare by accident.
  15. - Checks each link anonymously: `yes`, `no` (needs sign-in / org blocks "Anyone" links) or `unknown`.
  16. - Batch mode with per-file errors, `--json` for agents, `--csv` for reports, `--dry-run` to preview.
  17. - Restores your clipboard afterwards.
  18. - Recognizes the "Copy link" command in 20+ Windows languages (`--verb` for others).
  19. ## Requirements
  20. - Windows 10 or 11 with the **OneDrive client signed in** and the files synced (online-only files are fine).
  21. - Python 3.9+ with `pywin32` and `httpx`, or [`uv`](https://docs.astral.sh/uv/) (installs them on the fly).
  22. - An agent that **runs locally on that Windows machine** (Claude Code, Codex CLI, Gemini CLI, GitHub Copilot, Cursor, OpenCode…). Cloud sandboxes such as claude.ai cannot reach your OneDrive client.
  23. ## Install
  24. The fastest way, for any agent supported by the [`skills` CLI](https://github.com/vercel-labs/skills):
  25. ```powershell
  26. npx skills add nekatek-labs/onedrive-share-links
  27. ```
  28. Or clone it into your agent's skills folder:
  29. | Agent | User-level folder | Project-level folder |
  30. |---|---|---|
  31. | Claude Code | `~/.claude/skills/` | `.claude/skills/` |
  32. | OpenAI Codex | `~/.codex/skills/` or `~/.agents/skills/` | `.agents/skills/` |
  33. | Gemini CLI | `~/.gemini/skills/` | `.gemini/skills/` |
  34. | GitHub Copilot | `~/.copilot/skills/` | `.github/skills/` |
  35. | Cursor | `~/.cursor/skills/` | `.cursor/skills/` |
  36. | OpenCode | `~/.config/opencode/skills/` | `.opencode/skills/` |
  37. ```powershell
  38. git clone https://github.com/nekatek-labs/onedrive-share-links "$HOME\.claude\skills\onedrive-share-links"
  39. ```
  40. Folder conventions change between agent versions; if yours is not listed, check its docs for "skills". Agents without skill support can still use it: point them at `SKILL.md` as instructions.
  41. Dependencies (skip if you use `uv`):
  42. ```powershell
  43. pip install pywin32 httpx
  44. ```
  45. ## Use it
  46. Ask your agent, e.g. *"make a public link for `Reports/annex.pdf` in my OneDrive"*. Or run the script yourself:
  47. ```powershell
  48. python scripts/onedrive_public_links.py --dry-run "Reports/annex.pdf"
  49. python scripts/onedrive_public_links.py --public "Reports/annex.pdf" "Reports/budget.xlsx" --csv links.csv
  50. uv run scripts/onedrive_public_links.py --public "C:\Users\me\OneDrive - Contoso\file.pdf" --json
  51. ```
  52. | Option | Meaning |
  53. |---|---|
  54. | `--public` | Required to create links: acknowledges anyone with the link may open the file |
  55. | `--dry-run` | Resolve files and accounts only; nothing is shared |
  56. | `--json` / `--csv FILE` | Machine-readable output |
  57. | `--no-verify` | Skip the anonymous access check |
  58. | `--verb NAME` | Extra localized name of the "Copy link" menu command |
  59. | `--timeout S` | Seconds to wait per link (default 30) |
  60. | `--keep-link-in-clipboard` | Do not restore the previous clipboard text |
  61. Exit codes: `0` all links verified public · `2` some file failed or did not verify · `1` usage/environment error.
  62. ## Limits — read before sharing
  63. - The link's audience and **view/edit role come from your OneDrive / organization defaults**. The script verifies anonymous access but cannot tell view-only from editable. If that matters, check **Manage access › Links** on the file and change the default under OneDrive sharing settings.
  64. - If your organization disallows "Anyone" links, OneDrive creates an organization-only link and the check reports `no`.
  65. - Personal OneDrive pages are rendered by JavaScript, so verification often reports `unknown`; open the link in a private window to confirm.
  66. - To revoke a link: OneDrive › file › **Manage access › Links** › remove.
  67. ## Development
  68. ```powershell
  69. uv run --group dev pytest
  70. ```
  71. The tests run on any OS (Windows-only parts are mocked) and cover path safety, account/tenant detection, link validation, clipboard waiting, anonymous-access classification, the CLI and the `SKILL.md` spec. CI runs them on Windows and Linux.
  72. ## Español
  73. Skill para agentes de IA que crea enlaces **"cualquier persona con el vínculo"** para archivos concretos de OneDrive y comprueba que se abran sin iniciar sesión. Usa el comando **Copiar vínculo** del cliente OneDrive en Windows, así que no necesita Microsoft Graph, aprobación del administrador, tokens ni cookies.
  74. - Requiere Windows con el cliente OneDrive con sesión iniciada, Python 3.9+ (`pip install pywin32 httpx`) o `uv`, y un agente que corra **en ese mismo equipo** (Claude Code, Codex, Gemini CLI, Copilot, Cursor, OpenCode…).
  75. - Instálala con `npx skills add nekatek-labs/onedrive-share-links` o clonando el repositorio en la carpeta de skills de tu agente (tabla de arriba).
  76. - Pídele al agente, por ejemplo: *"crea un enlace público para `Informes/anexo.pdf` de mi OneDrive"*.
  77. - El permiso de lectura o edición lo define la configuración predeterminada de tu OneDrive u organización; revisa **Administrar acceso › Vínculos** si necesitas solo lectura.
  78. ## License
  79. [MIT](LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.