Browse SharePoint and OneDrive files, inspect version history, and edit SharePoint list rows from the terminal.
BiteFoundry · Latest release notes · Engineering design
| Capability | Details |
|---|---|
| Minimal-Chrome 3-Pane TUI | Dual-persona explorer (sharepoint and bitefoundry-onedrive) with collapsible Sites, Document Libraries & OneDrive sidebar, sorted file list, live Inspector (metadata, version history, Markdown/YAML/JSON/code preview), Link Extractor (u), File Picker with zoxide (Ctrl+F), Context Menu (.), and a Live-Preview Theme Picker (Ctrl+T / T) across 14 built-in themes (including Terminal Inherit default) plus drop-in custom .toml themes. |
| High-Res Terminal Images | Inline Inspector thumbnails & fullscreen HD previews (v / Alt+v) with 80ms protocol probing for Kitty, iTerm2, Sixel (Floyd-Steinberg dithering), and 24-bit Unicode Half-Blocks + Ctrl+V instant clipboard PNG upload. |
| Local SQLite FTS5 + IPC Daemon | WAL-mode SQLite cache with 4-reader pool, hybrid local FTS5 + remote Graph search (/), streaming chunked uploads (> 4 MiB), and a shared background sync daemon (sharepoint daemon start). |
| 4-in-1 Agent Interface | Interactive TUI, scriptable --json CLI, local HTTP JSON API (sharepoint serve, port 8790), and stdio MCP Server (sharepoint mcp, 20 tools). |
Install the precompiled native binary (zero-Node options available — see bitefoundry.dev/sharepoint):
# Homebrew (macOS / Linux)
brew install bitefoundry/tap/sharepoint
# Zero-Node shell installer (macOS / Linux)
curl -fsSL https://bitefoundry.dev/i | sh -s sharepoint
# npm (Windows / macOS / Linux)
npm i -g @bitefoundry/sharepoint# PowerShell (Windows, zero-Node)
& ([scriptblock]::Create((irm https://bitefoundry.dev/w))) sharepointThen sign in and launch the interactive 3-pane TUI:
# Authenticate with Microsoft 365 (PKCE loopback, --device-code, or shared M365 token)
sharepoint login
# Launch in either persona
sharepoint # SharePoint sites and document libraries
bitefoundry-onedrive # Personal OneDrive, including My Files, Recent, and Sharedsharepoint info FILE_ID --drive DRIVE_ID --jsonRead file metadata from a specific drive. For version history, add --versions while online. When paging list rows, reuse the same site, list, and field selection. For full detail, add --full in the CLI or pass compact: false to get_file_info in MCP.
Build both commands with cargo install --locked --path . from a checkout. Both executables are also available in the same GitHub release archive. Install and upgrade
sharepoint login uses the public Microsoft Graph Command Line Tools client by default. To use a company-owned app, register it as a public client and configure the http://localhost redirect URI. Enable public client flows for headless --device-code sign-in. Company app registration guide
Add the Microsoft Graph delegated permissions your users need and have your Entra administrator grant consent where required.
| Feature | Delegated scopes |
|---|---|
| Profile and session refresh | User.Read, offline_access |
| Read and edit OneDrive files | Files.Read, Files.ReadWrite |
| Read and edit files the user can access across drives | Files.Read.All, Files.ReadWrite.All |
| Browse SharePoint sites and libraries, and write to those libraries | Sites.Read.All, Sites.ReadWrite.All |
The default sign-in requests all scopes in the table. Set scopes in config.toml to request a narrower set that matches your workflow.
sharepoint login --client-id YOUR_APP_ID --tenant-id YOUR_TENANT_ID
sharepoint whoami --jsonFor persistent environment configuration, set SHAREPOINT_CLIENT_ID and SHAREPOINT_TENANT_ID. The OneDrive launcher uses the same credentials.
HTTPS connections trust the operating system's certificate store and the bundled Mozilla roots. If a TLS-inspecting proxy re-signs traffic with a root CA that is in neither, requests fail with TLS certificate was issued by an unknown authority. Install that root CA in the OS store, or point the tool at a PEM bundle:
| Variable | Read by | If the file cannot be used |
|---|---|---|
SHAREPOINT_EXTRA_CA_PEM (alias ONEDRIVE_EXTRA_CA_PEM) |
both commands | the command stops with an error naming the variable |
SSL_CERT_FILE, NODE_EXTRA_CA_CERTS |
both commands, as extra roots | a one-line warning on stderr; the command continues |
Every variable that is set is loaded, in addition to the OS and bundled roots, for Graph, sign-in, downloads, self-update and the realtime connection. The proxy itself is taken from HTTPS_PROXY / NO_PROXY.
export HTTPS_PROXY=http://proxy.corp.example:8080
export SHAREPOINT_EXTRA_CA_PEM=/etc/ssl/certs/corp-root-ca.pem
sharepoint whoami --jsonAll TUI keybindings are sourced from the single SHAREPOINT_ACTIONS registry (shared by ? Help, docked which-key leader popups, scoped footer hints, and Command Palette). Destructive remote mutations (deleting files/folders or overwriting existing remote files) require explicit Shift+Y (or Korean Shift+ㅛ) confirmation with a blast-radius summary.
| Key | Action |
|---|---|
Tab / Shift+Tab |
Cycle focus (Sidebar → File List → Inspector) |
1 / 2 / 3 |
Show Sidebar / File List / Inspector in terminals under 80 columns |
g s · g f · g p |
Docked which-key Go menu: jump to Sidebar, Files list, or Inspector preview |
g g / G |
Jump to top / jump to bottom |
j / k · ↑ / ↓ |
Move selection / scroll Inspector preview |
Enter · → / l |
Open folder or site (sidebar: → / l expand, ← / h collapse or go to parent) |
Backspace / ← |
Parent folder; at the top of a shared or recent folder, back to that list |
Space / PgDn / PgUp |
Page the focused file list or inspector |
J / K |
Scroll Inspector preview down / up 3 lines without leaving the file list |
Ctrl+D / Ctrl+U |
Scroll Inspector preview half-page down / up (in Inspector focus, Ctrl+D toggles Cozy / Compact list density) |
S / L |
Cycle sort order (Name / Modified / Size / Type) / Load more items in folder |
y l · y p · y i · y y |
Docked which-key Yank menu: copy Share/Web URL, file path, item ID, or quick copy |
Ctrl+F |
Upload file via interactive File Picker (z for zoxide jump; overwrites require Shift+Y) |
Ctrl+V |
Encode clipboard image as PNG & upload to current folder |
d / n / r / x / Del |
Download file / new folder / rename / delete (Shift+Y destructive confirmation) |
s / o / H / p |
Create & copy share link / open in browser / serve HTML locally / pin target |
v / Alt+v / m / u / h |
HD image or interactive HTML preview / toggle Markdown/HTML render / Link Extractor / toggle inline href URLs |
/ |
Hybrid local FTS5 + Microsoft Graph file search |
z |
Toggle focused pane zoom (expand Sidebar, File List, or Inspector full-width) |
Ctrl+P / Ctrl+K |
Unified Command Palette & Library Omni-Switcher |
. / Right-click |
Context Menu |
Ctrl+R / F5 |
Sync / Refresh all |
Ctrl+T / T |
Live-Preview Theme Picker (14 built-in + custom .toml themes, / filter, Esc revert) |
, / Ctrl+, |
Settings |
Ctrl+B / ? / Ctrl+Q |
Toggle sidebar / Keyboard shortcuts help / Quit |
Press Ctrl+T or T inside the TUI to browse 14 built-in themes with live preview (default Terminal Inherit, midnight-dark, obsidian-dark, daylight-light, warm-paper, catppuccin-mocha, catppuccin-latte, tokyo-night, gruvbox-dark, gruvbox-light, nord, dracula, everforest-dark, rose-pine), plus ANSI 256/16 and NO_COLOR.
# Override theme for a single session
sharepoint --theme tokyo-night
bitefoundry-onedrive --theme default # inherit terminal background & foreground
# Use pure 7-bit ASCII icons (also enabled automatically by BITEFOUNDRY_ASCII=1 or TERM=dumb)
sharepoint --no-nerd-fontsDrop custom .toml theme files into ~/.config/sharepoint-cli/themes/*.toml (or ~/.config/bitefoundry/themes/*.toml to share across all BiteFoundry apps) — they appear automatically in the Theme Picker with a [User] badge.
sharepoint sites --json
sharepoint drives --site "Acme Engineering" --json
bitefoundry-onedrive ls /Projects/Platform-v4 --json --compact
bitefoundry-onedrive tree /Projects/Platform-v4 --depth 3
bitefoundry-onedrive info /Projects/Platform-v4/deploy-pipeline.yaml --versions --versions-limit 5 --json
bitefoundry-onedrive info /Projects/Platform-v4/deploy-pipeline.yaml -p # styled ANSI output (--print / --pager)
bitefoundry-onedrive cat /Projects/Platform-v4/deploy-pipeline.yaml --pager
sharepoint upload ./q4-architecture-deck.pdf /RFCs --site "Acme Engineering" --json
sharepoint share /api-gateway-rfc.md --site "Acme Engineering" --type view --scope organization --json
sharepoint search "gateway" --remote --jsonGlobal flags: --theme <NAME> (session color theme override) and --no-nerd-fonts (pure 7-bit ASCII chrome glyphs; also enabled by BITEFOUNDRY_ASCII=1 or TERM=dumb).
Top-level subcommands:
- Auth & diagnostics:
login,logout,whoami,doctor,update - Browse & inspect:
sites,drives,lists,ls,tree,info(-p/--print,--pager,--json),cat(-p/--print,--pager,--json),recent,shared,search,preview,preview-file - File mutations:
download,upload,mkdir,mv,rm,share - Interfaces & services:
tui,daemon(start/status/stop/restart),serve,mcp
sharepoint --help and bitefoundry-onedrive --help list the commands that support --json.
info --json defaults to compact output with drive_id, id, name, parent_path,
is_folder, size, last_modified_at, e_tag, omitted, and hint. Pass --json --full
for every item field; --compact remains a compatibility alias. Both info and cat also support -p / --print for styled ANSI rendering outside alternate-screen mode (respecting NO_COLOR=1) and --pager to pipe styled output through $PAGER. For ls, --json --compact
returns { "id": "…" } for drive and core item fields as before, and ls --json includes
returned, has_more, and source ("remote" or "cache"). info --versions is online-only
(cannot be combined with --offline), reads all available history by default, and adds
versions and versions_has_more. --versions-limit caps history and stops fetching pages
once the cap is reached. An online history lookup reports Graph errors, including permission
denials.
cat reads UTF-8 with an optional BOM and UTF-16LE or UTF-16BE with a BOM. Its
byte limit applies to the original file, and plain output preserves line endings.
Use download for binary files. To replace a file conditionally, pass its item ID
and eTag to upload --item-id <ITEM_ID> --if-match <ETAG>. Conditional
replacement uses an upload session at any file size.
When targeting a site with multiple document libraries, pass --drive alongside
--site; responses report the selected library in drive.id (or drive_id).
drives --json outputs a JSON array and writes partial site-discovery warnings
to stderr; use MCP list_drives if you need sites_failed or has_more in JSON.
For root paths with spaces, dots, or leading hyphens, prefix with / (for
example /Q4 Report.md or mv /-name).
Exit codes: 1 is a runtime error (with --json, stdout prints a single-line
{"ok":false,"error":{"code":...,"message":...}} object alongside the stderr
message); 2 is an argument or usage error (plain text on stderr, empty stdout).
Use sites --json to find the site ID, then lists ls --site-id to find the
list ID. With the list ID, discover its column names, then select one or more
columns by passing --field for each name.
sharepoint sites --json
sharepoint lists ls --site-id "$SITE_ID" --json
sharepoint lists columns --site-id "$SITE_ID" --list-id "$LIST_ID" --json
sharepoint lists items --site-id "$SITE_ID" --list-id "$LIST_ID" \
--field ReviewStatus --field Quantity --json
sharepoint lists set-field --site-id "$SITE_ID" --list-id "$LIST_ID" \
--item-id 17 --field ReviewStatus --value-json '"Ready"' --if-match '"row-etag"' --jsonitems reads one page (default 50 rows; --limit accepts 1–200) and returns items
(each row's id, e_tag when available, and fields without duplicate @odata.etag),
returned, has_more, and next_cursor. Pass next_cursor to --cursor to read the next
page; the cursor is bound to the same --site-id, --list-id, and --field set (order
independent) and cannot be combined with --limit. To read all pages:
cursor=""
while :; do
if [ -z "$cursor" ]; then
page=$(sharepoint lists items --site-id "$SITE_ID" --list-id "$LIST_ID" --field Title --limit 200 --json)
else
page=$(sharepoint lists items --site-id "$SITE_ID" --list-id "$LIST_ID" --field Title --json --cursor "$cursor")
fi
printf '%s\n' "$page" | jq -c '.items[]'
cursor=$(printf '%s\n' "$page" | jq -r '.next_cursor // empty')
[ -n "$cursor" ] || break
doneset-field accepts a typed JSON value such as "Ready", false, or 0. Pass the row's
current e_tag as --if-match to apply the update conditionally. Graph returns 412 for
stale ETags. List rows · Update list fields
# Start local Axum JSON server (default 127.0.0.1:8790)
sharepoint serve --port 8790 --api-key dev-secret
# Search files across OneDrive & SharePoint from scripts or agents
curl -H "Authorization: Bearer dev-secret" \
"http://127.0.0.1:8790/v1/search?q=gateway&remote=true&limit=10"The API always needs a Bearer key. Without --api-key, serve generates one and prints it once to stderr; --allow-keyless turns the key off on a loopback address. A non-loopback --bind requires --api-key. The server answers only requests whose Host names it (add a proxy name with --allowed-host) and allows CORS from loopback origins plus any --cors-origin. Uploads from local_path and downloads into dir need a key or --allow-local-paths.
Full route reference & OpenAPI 3.1 spec: docs/API.md · docs/openapi.yaml.
Add to Claude Desktop, Claude Code, Cursor, or Codex (20 tools over stdio JSON-RPC 2.0):
Exposes 20 SharePoint & OneDrive tools: whoami, list_sites, list_drives, list_files, get_file_info, read_text_file, download_file, upload_file, create_folder, move_or_rename_item, delete_item, search_files, create_share_link, list_recent, list_shared_with_me, list_versions, list_lists, list_items, list_columns, update_list_item_field.
{
"mcpServers": {
"sharepoint": {
"command": "sharepoint",
"args": ["mcp"]
}
}
}Full tool catalog & schemas: docs/MCP.md.
- SharePoint and OneDrive requests use the configured credentials and their Microsoft Graph permissions. The CLI stores sign-in credentials in the OS keyring when available, with a local
credentials.jsonfallback. - The local SQLite cache stores site, library, and file metadata for offline browsing and search.
sharepoint doctorreports the cache path, SQLite open errors, and supported network filesystem detections. On a detected network filesystem, the cache uses DELETE journal mode. - Run
sharepoint mcp --read-onlyto hide and block tools that write to Microsoft Graph or save downloads to disk. Use--max-output-chars <usize>to set the character budget for tool responses.
| Package | Commands | Workspace Coverage |
|---|---|---|
@bitefoundry/teams |
teams |
Microsoft Teams chats, channels, threads & meetings |
@bitefoundry/outlook |
outlook |
Microsoft Outlook mail, calendar & contacts |
@bitefoundry/onenote |
onenote |
Microsoft OneNote notebooks, sections, pages & XHTML/Markdown |
@bitefoundry/sharepoint (this repo) |
sharepoint, bitefoundry-onedrive |
Microsoft SharePoint sites, document libraries & OneDrive files |
@bitefoundry/gdocs |
gdocs |
Google Docs documents and editing |
@bitefoundry/linear |
linear |
Linear issues, cycles, projects & triage |
@bitefoundry/atlassian |
atlassian, confluence, conf |
Atlassian Jira issues, boards, sprints & Confluence pages |
@bitefoundry/notion |
notion |
Notion pages, databases, blocks & Markdown sync |
@bitefoundry/obsidian |
bitefoundry-obsidian |
Obsidian local vaults, backlinks & knowledge graph |
Licensed under the MIT License.
Unofficial terminal client for Microsoft SharePoint & OneDrive. Not affiliated with, endorsed by, or sponsored by Microsoft Corporation.