sharepoint-cli-rs 0.0.13__tar.gz → 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/.github/workflows/ci.yml +5 -2
  2. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/CHANGELOG.md +16 -0
  3. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/Cargo.lock +1 -1
  4. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/Cargo.toml +1 -1
  5. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/Makefile +8 -1
  6. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/PKG-INFO +60 -7
  7. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/README.md +59 -6
  8. sharepoint_cli_rs-0.1.0/docs/releases.md +50 -0
  9. sharepoint_cli_rs-0.1.0/docs/testing.md +328 -0
  10. sharepoint_cli_rs-0.1.0/examples/simulator/contracts/LICENSE.pnpcore +21 -0
  11. sharepoint_cli_rs-0.1.0/examples/simulator/contracts/README.md +67 -0
  12. sharepoint_cli_rs-0.1.0/examples/simulator/contracts/pnpcore.json +2357 -0
  13. sharepoint_cli_rs-0.1.0/examples/simulator/contracts/provenance.json +36 -0
  14. sharepoint_cli_rs-0.1.0/examples/simulator/fixtures.json +77 -0
  15. sharepoint_cli_rs-0.1.0/examples/simulator/main.rs +81 -0
  16. sharepoint_cli_rs-0.1.0/examples/simulator/odata.rs +286 -0
  17. sharepoint_cli_rs-0.1.0/examples/simulator/recording.rs +111 -0
  18. sharepoint_cli_rs-0.1.0/examples/simulator/server.rs +716 -0
  19. sharepoint_cli_rs-0.1.0/examples/simulator/smoke.rs +428 -0
  20. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/nix/package.nix +1 -0
  21. sharepoint_cli_rs-0.1.0/scripts/import_pnpcore_contracts.py +246 -0
  22. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/auth/mod.rs +1 -1
  23. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/auth/session_store.rs +3 -2
  24. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/auth/token_cache.rs +2 -1
  25. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/cli.rs +27 -13
  26. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/commands/auth.rs +19 -5
  27. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/commands/drives.rs +14 -6
  28. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/commands/files.rs +54 -29
  29. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/commands/schema.rs +12 -2
  30. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/commands/sites.rs +9 -14
  31. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/config.rs +18 -7
  32. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/error.rs +5 -2
  33. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/graph/drives.rs +2 -0
  34. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/graph/mod.rs +38 -13
  35. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/lib.rs +1 -0
  36. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/main.rs +76 -13
  37. sharepoint_cli_rs-0.1.0/src/pagination.rs +50 -0
  38. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/rest/drives.rs +9 -23
  39. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/rest/mod.rs +44 -2
  40. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_auth_env_refresh_token.rs +3 -15
  41. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_auth_login_canonicalizes_tenant.rs +3 -8
  42. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_auth_login_quiet_prompts.rs +3 -14
  43. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_auth_logout.rs +3 -6
  44. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_auth_no_client_id.rs +3 -12
  45. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_auth_status.rs +2 -4
  46. sharepoint_cli_rs-0.1.0/tests/cmd_backend_contract.rs +388 -0
  47. sharepoint_cli_rs-0.1.0/tests/cmd_collection_pagination.rs +168 -0
  48. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_config.rs +40 -0
  49. sharepoint_cli_rs-0.1.0/tests/cmd_download_safety.rs +329 -0
  50. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_drives_list.rs +3 -6
  51. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_drives_list_pagination.rs +3 -3
  52. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_files_find.rs +4 -5
  53. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_files_ls.rs +2 -4
  54. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_files_ls_pagination.rs +3 -1
  55. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_files_stat_download.rs +3 -6
  56. sharepoint_cli_rs-0.1.0/tests/cmd_flags.rs +119 -0
  57. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_init_quiet.rs +3 -7
  58. sharepoint_cli_rs-0.1.0/tests/cmd_pagination_safety.rs +120 -0
  59. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_profile.rs +3 -8
  60. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_rest_auth.rs +7 -8
  61. sharepoint_cli_rs-0.1.0/tests/cmd_rest_drives_list.rs +173 -0
  62. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_rest_files_find.rs +3 -5
  63. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_rest_files_ls.rs +3 -5
  64. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_rest_files_stat_download.rs +3 -5
  65. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_rest_sites_list.rs +3 -5
  66. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_schema.rs +9 -28
  67. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_sites_list.rs +2 -4
  68. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_sites_use.rs +3 -7
  69. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/graph_page_token_host_validation.rs +3 -6
  70. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/rest_client.rs +0 -2
  71. sharepoint_cli_rs-0.1.0/tests/simulator.rs +417 -0
  72. sharepoint_cli_rs-0.1.0/tests/support/backend.rs +98 -0
  73. sharepoint_cli_rs-0.1.0/tests/support/mod.rs +22 -0
  74. sharepoint_cli_rs-0.0.13/docs/releases.md +0 -38
  75. sharepoint_cli_rs-0.0.13/tests/cmd_rest_drives_list.rs +0 -77
  76. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/.envrc +0 -0
  77. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/.github/workflows/clispec.yml +0 -0
  78. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/.github/workflows/dependencies.yml +0 -0
  79. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/.github/workflows/release.yml +0 -0
  80. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/.gitignore +0 -0
  81. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/.mise.toml +0 -0
  82. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/docs/superpowers/.gitignore +0 -0
  83. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/flake.lock +0 -0
  84. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/flake.nix +0 -0
  85. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/nix/overlay-check.nix +0 -0
  86. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/prek.toml +0 -0
  87. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/pyproject.toml +0 -0
  88. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/sharepoint_cli/__init__.py +0 -0
  89. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/sharepoint_cli/__main__.py +0 -0
  90. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/sharepoint_cli/py.typed +0 -0
  91. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/auth/browser.rs +0 -0
  92. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/auth/device_code.rs +0 -0
  93. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/backend.rs +0 -0
  94. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/commands/config.rs +0 -0
  95. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/commands/doctor.rs +0 -0
  96. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/commands/init.rs +0 -0
  97. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/commands/mod.rs +0 -0
  98. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/commands/profile.rs +0 -0
  99. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/graph/download.rs +0 -0
  100. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/graph/search.rs +0 -0
  101. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/graph/sites.rs +0 -0
  102. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/output.rs +0 -0
  103. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/reference.rs +0 -0
  104. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/rest/download.rs +0 -0
  105. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/rest/search.rs +0 -0
  106. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/rest/sites.rs +0 -0
  107. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/src/util.rs +0 -0
  108. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/auth_concurrent_refresh.rs +0 -0
  109. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/auth_refresh.rs +0 -0
  110. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/auth_token_retry.rs +0 -0
  111. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_clap_error_is_json.rs +0 -0
  112. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/cmd_files_ls_recursive_rejects_pagination_flags.rs +0 -0
  113. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/device_code_polling.rs +0 -0
  114. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/fixtures/clispec-v0.3.json +0 -0
  115. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/graph_download.rs +0 -0
  116. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/tests/graph_retry.rs +0 -0
  117. {sharepoint_cli_rs-0.0.13 → sharepoint_cli_rs-0.1.0}/vership.toml +0 -0
@@ -27,7 +27,7 @@ jobs:
27
27
  name: Test
28
28
  strategy:
29
29
  matrix:
30
- os: [ubuntu-latest, macos-latest]
30
+ os: [ubuntu-latest, macos-latest, windows-latest]
31
31
  runs-on: ${{ matrix.os }}
32
32
  steps:
33
33
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -38,7 +38,10 @@ jobs:
38
38
  - uses: taiki-e/install-action@5488ac5a951645ce95062214902ac4b6bc1a1037 # v2.87.32
39
39
  with:
40
40
  tool: nextest
41
- - run: make test
41
+ - name: Run unit tests
42
+ run: cargo nextest run --lib --bin sharepoint --no-tests=pass
43
+ - name: Run integration tests
44
+ run: cargo nextest run --test '*'
42
45
 
43
46
  nix:
44
47
  name: Nix (${{ matrix.os }})
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/).
6
6
 
7
+ ## [0.1.0](https://github.com/rvben/sharepoint-cli/compare/v0.0.14...v0.1.0) - 2026-11-03
8
+
9
+ ### Added
10
+
11
+ - harden downloads and automation across platforms ([f89f433](https://github.com/rvben/sharepoint-cli/commit/f89f433e24a6bcc388d8fd89f0929244a178f430))
12
+
13
+ ## [0.0.14](https://github.com/rvben/sharepoint-cli/compare/v0.0.13...v0.0.14) - 2026-11-03
14
+
15
+ ### Added
16
+
17
+ - **testing**: add reusable SharePoint REST simulator ([3962a14](https://github.com/rvben/sharepoint-cli/commit/3962a142fd9fcd57cf8445b2c980754c21e6e18a))
18
+
19
+ ### Fixed
20
+
21
+ - **config**: honor XDG paths across platforms ([45c0804](https://github.com/rvben/sharepoint-cli/commit/45c08049b82b2f7f5c2c09030d9e78a47d45573d))
22
+
7
23
  ## [0.0.13](https://github.com/rvben/sharepoint-cli/compare/v0.0.12...v0.0.13) - 2026-11-03
8
24
 
9
25
  ### Added
@@ -1721,7 +1721,7 @@ dependencies = [
1721
1721
 
1722
1722
  [[package]]
1723
1723
  name = "sharepoint-cli"
1724
- version = "0.0.13"
1724
+ version = "0.1.0"
1725
1725
  dependencies = [
1726
1726
  "assert_cmd",
1727
1727
  "base64",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "sharepoint-cli"
3
- version = "0.0.13"
3
+ version = "0.1.0"
4
4
  edition = "2024"
5
5
  rust-version = "1.90"
6
6
  description = "Agent-friendly SharePoint Online CLI with JSON output, structured exit codes, and schema introspection"
@@ -1,4 +1,4 @@
1
- .PHONY: build release test test-e2e lint fmt fmt-check check clean install release-patch release-minor release-major
1
+ .PHONY: build release test test-e2e test-simulator simulator lint fmt fmt-check check clean install release-patch release-minor release-major
2
2
 
3
3
  build:
4
4
  cargo build
@@ -18,6 +18,13 @@ test:
18
18
  test-e2e:
19
19
  cargo nextest run --test e2e
20
20
 
21
+ # No tenant, credentials, browser, or network access beyond loopback required.
22
+ simulator:
23
+ cargo run --example simulator -- serve
24
+
25
+ test-simulator: build
26
+ cargo run --example simulator -- smoke --cli target/debug/sharepoint
27
+
21
28
  lint:
22
29
  cargo clippy --all-targets -- -D warnings
23
30
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sharepoint-cli-rs
3
- Version: 0.0.13
3
+ Version: 0.1.0
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: System Administrators
@@ -118,7 +118,7 @@ sharepoint files ls <site>:<library>/
118
118
 
119
119
  # Stat / download / search
120
120
  sharepoint files stat <site>:<library>/path/to/file
121
- sharepoint files download <site>:<library>/path/to/file -o ./out.bin
121
+ sharepoint files download <site>:<library>/path/to/file --path ./out.bin
122
122
  sharepoint files find <site>:<library>/ --name '*.pdf'
123
123
  sharepoint doctor
124
124
  ```
@@ -143,6 +143,37 @@ input error instead.
143
143
  - `--json` (or non-TTY stdout) emits machine-readable JSON on stdout.
144
144
  - `--quiet` suppresses status messages.
145
145
  - `--no-color` and the standard `NO_COLOR` environment variable disable ANSI output.
146
+ - Errors go to stderr; JSON errors have the shape
147
+ `{"error":{"kind":"not_found","message":"…","exit_code":4}}`.
148
+ `--quiet` keeps errors visible. Exit codes are 0 (success), 1 (transport/local
149
+ failure), 2 (invalid input/read-only), 3 (authentication/access denied),
150
+ 4 (not found), 5 (API failure), 6 (rate limit), and 7 (conflict).
151
+
152
+ List responses contain `items`, `total`, and an opaque `next` cursor. Pass a
153
+ non-null cursor back with `--page`; stop when `next` is null. `--limit` must be
154
+ positive and sets an upper bound, so a server page or a search filtered by
155
+ `--name` can return fewer items. Use `--all` for sites, drives, file listings,
156
+ and search to fetch all remaining pages. `files ls --recursive` returns the
157
+ complete tree and cannot be combined with pagination flags.
158
+ For sites and files, `total` counts the returned items. For drives and Graph
159
+ cached accounts, it counts the complete collection before limiting.
160
+ Graph `auth status` supports `--limit` and `--page`; REST status describes a
161
+ single host session and rejects `--page`.
162
+
163
+ Downloads use `--path FILE`, with parent directories created as needed. A
164
+ completed transfer replaces an existing destination only with `--overwrite`;
165
+ transfer errors leave the destination file unchanged and remove their staging
166
+ file. Parent directories created for a download remain. Abrupt process termination
167
+ can leave a `.sharepoint-download-*` staging file beside the destination.
168
+ `--overwrite` replaces the file entry (including a symlink), rather than writing
169
+ through it; existing metadata and hard links are not preserved. On Unix,
170
+ downloaded files are private to their owner.
171
+ Without `--overwrite`, a file created during the transfer is also protected.
172
+ `--path -` writes raw file bytes to stdout, including in JSON mode; stream
173
+ failures can leave partial bytes on stdout, with the error on stderr.
174
+ The legacy `--output FILE` and `-o FILE` aliases work **after** `files download`.
175
+ Put the global `--output json|text|auto` **before** `files download`, and prefer
176
+ `--path` for an unambiguous destination.
146
177
 
147
178
  Suite-level discovery is available without guessing: use `sharepoint doctor --offline`, `sharepoint schema --command 'files stat'`, `sharepoint config show`, and `sharepoint completions <shell>`.
148
179
 
@@ -159,13 +190,28 @@ sharepoint config path
159
190
 
160
191
  ## Configuration
161
192
 
162
- Config lives at `$XDG_CONFIG_HOME/sharepoint/config.toml` (or `~/.config/sharepoint/config.toml`). Run `sharepoint config path` to print the resolved location.
193
+ Run `sharepoint config path` to print the resolved config location. By default,
194
+ configuration and cached credentials use the native directories for your OS:
163
195
 
164
- You must supply two things before signing in:
196
+ | OS | Configuration | Cached credentials |
197
+ | --- | --- | --- |
198
+ | Linux | `~/.config/sharepoint/` | `~/.cache/sharepoint/` |
199
+ | macOS | `~/Library/Application Support/sharepoint/` | `~/Library/Caches/sharepoint/` |
200
+ | Windows | `%APPDATA%\sharepoint\` | `%LOCALAPPDATA%\sharepoint\` |
201
+
202
+ Set `XDG_CONFIG_HOME` or `XDG_CACHE_HOME` to an absolute directory to override
203
+ these defaults on any OS. The CLI adds the `sharepoint` subdirectory. Empty or
204
+ relative overrides are ignored. Config is saved as `config.toml`; cached Graph
205
+ tokens and REST sessions use `tokens.json` and `sessions.json`, respectively.
206
+
207
+ For the default **Graph backend**, supply two things before signing in:
165
208
 
166
209
  - A **tenant** (your Microsoft 365 domain or tenant GUID).
167
210
  - A **client_id** for an Entra public-client app you've registered. The app needs the device-code flow enabled and delegated `Files.Read.All`, `Sites.Read.All`, and `offline_access` scopes. `sharepoint init` walks you through saving both into the active profile.
168
211
 
212
+ The **REST backend** needs a SharePoint host and browser sign-in, with no tenant
213
+ or client ID. See [browser-session setup](#without-microsoft-graph-browser-session).
214
+
169
215
  Environment overrides:
170
216
 
171
217
  - `SHAREPOINT_PROFILE` — active profile name
@@ -183,7 +229,7 @@ backend. It signs in through a real browser and calls the SharePoint REST API
183
229
  (`/_api`) with your session cookies. No tenant or client ID is needed.
184
230
 
185
231
  ```toml
186
- # ~/.config/sharepoint/config.toml
232
+ # Add to the file printed by `sharepoint config path`
187
233
  [profile.work]
188
234
  backend = "rest"
189
235
  sharepoint_host = "contoso.sharepoint.com"
@@ -204,8 +250,8 @@ sharepoint --profile work doctor
204
250
  - A snap-packaged Chromium (the default `chromium` on Ubuntu) won't work: its
205
251
  private `/tmp` hides the browser's DevTools port file from the CLI. Point
206
252
  `SHAREPOINT_BROWSER` at a non-snap Chrome, Chromium or Edge instead.
207
- - The session is stored per host in `$XDG_CACHE_HOME/sharepoint/sessions.json`
208
- (or `~/.cache/sharepoint/sessions.json`) with mode 0600. When it expires, run
253
+ - The session is stored per host in `sessions.json` in the cache directory
254
+ above, with mode 0600 on Unix. When it expires, run
209
255
  `sharepoint auth login` again; `sharepoint auth logout` removes it.
210
256
  - OneDrive lives on its own host (`contoso-my.sharepoint.com`), so it needs
211
257
  its own profile and `auth login`:
@@ -222,6 +268,13 @@ sharepoint --profile work doctor
222
268
 
223
269
  MIT
224
270
 
271
+ ## Testing
272
+
273
+ Run `make test-simulator` for repeatable local REST smoke tests with dummy data,
274
+ or `make simulator` to explore the fixtures interactively. No tenant or login is
275
+ needed. See [the testing guide](docs/testing.md) for scenarios, custom fixtures,
276
+ and live SharePoint/OneDrive testing.
277
+
225
278
  ## Releasing
226
279
 
227
280
  Vership owns versioning, changelog generation, release commits, and tags. See
@@ -97,7 +97,7 @@ sharepoint files ls <site>:<library>/
97
97
 
98
98
  # Stat / download / search
99
99
  sharepoint files stat <site>:<library>/path/to/file
100
- sharepoint files download <site>:<library>/path/to/file -o ./out.bin
100
+ sharepoint files download <site>:<library>/path/to/file --path ./out.bin
101
101
  sharepoint files find <site>:<library>/ --name '*.pdf'
102
102
  sharepoint doctor
103
103
  ```
@@ -122,6 +122,37 @@ input error instead.
122
122
  - `--json` (or non-TTY stdout) emits machine-readable JSON on stdout.
123
123
  - `--quiet` suppresses status messages.
124
124
  - `--no-color` and the standard `NO_COLOR` environment variable disable ANSI output.
125
+ - Errors go to stderr; JSON errors have the shape
126
+ `{"error":{"kind":"not_found","message":"…","exit_code":4}}`.
127
+ `--quiet` keeps errors visible. Exit codes are 0 (success), 1 (transport/local
128
+ failure), 2 (invalid input/read-only), 3 (authentication/access denied),
129
+ 4 (not found), 5 (API failure), 6 (rate limit), and 7 (conflict).
130
+
131
+ List responses contain `items`, `total`, and an opaque `next` cursor. Pass a
132
+ non-null cursor back with `--page`; stop when `next` is null. `--limit` must be
133
+ positive and sets an upper bound, so a server page or a search filtered by
134
+ `--name` can return fewer items. Use `--all` for sites, drives, file listings,
135
+ and search to fetch all remaining pages. `files ls --recursive` returns the
136
+ complete tree and cannot be combined with pagination flags.
137
+ For sites and files, `total` counts the returned items. For drives and Graph
138
+ cached accounts, it counts the complete collection before limiting.
139
+ Graph `auth status` supports `--limit` and `--page`; REST status describes a
140
+ single host session and rejects `--page`.
141
+
142
+ Downloads use `--path FILE`, with parent directories created as needed. A
143
+ completed transfer replaces an existing destination only with `--overwrite`;
144
+ transfer errors leave the destination file unchanged and remove their staging
145
+ file. Parent directories created for a download remain. Abrupt process termination
146
+ can leave a `.sharepoint-download-*` staging file beside the destination.
147
+ `--overwrite` replaces the file entry (including a symlink), rather than writing
148
+ through it; existing metadata and hard links are not preserved. On Unix,
149
+ downloaded files are private to their owner.
150
+ Without `--overwrite`, a file created during the transfer is also protected.
151
+ `--path -` writes raw file bytes to stdout, including in JSON mode; stream
152
+ failures can leave partial bytes on stdout, with the error on stderr.
153
+ The legacy `--output FILE` and `-o FILE` aliases work **after** `files download`.
154
+ Put the global `--output json|text|auto` **before** `files download`, and prefer
155
+ `--path` for an unambiguous destination.
125
156
 
126
157
  Suite-level discovery is available without guessing: use `sharepoint doctor --offline`, `sharepoint schema --command 'files stat'`, `sharepoint config show`, and `sharepoint completions <shell>`.
127
158
 
@@ -138,13 +169,28 @@ sharepoint config path
138
169
 
139
170
  ## Configuration
140
171
 
141
- Config lives at `$XDG_CONFIG_HOME/sharepoint/config.toml` (or `~/.config/sharepoint/config.toml`). Run `sharepoint config path` to print the resolved location.
172
+ Run `sharepoint config path` to print the resolved config location. By default,
173
+ configuration and cached credentials use the native directories for your OS:
142
174
 
143
- You must supply two things before signing in:
175
+ | OS | Configuration | Cached credentials |
176
+ | --- | --- | --- |
177
+ | Linux | `~/.config/sharepoint/` | `~/.cache/sharepoint/` |
178
+ | macOS | `~/Library/Application Support/sharepoint/` | `~/Library/Caches/sharepoint/` |
179
+ | Windows | `%APPDATA%\sharepoint\` | `%LOCALAPPDATA%\sharepoint\` |
180
+
181
+ Set `XDG_CONFIG_HOME` or `XDG_CACHE_HOME` to an absolute directory to override
182
+ these defaults on any OS. The CLI adds the `sharepoint` subdirectory. Empty or
183
+ relative overrides are ignored. Config is saved as `config.toml`; cached Graph
184
+ tokens and REST sessions use `tokens.json` and `sessions.json`, respectively.
185
+
186
+ For the default **Graph backend**, supply two things before signing in:
144
187
 
145
188
  - A **tenant** (your Microsoft 365 domain or tenant GUID).
146
189
  - A **client_id** for an Entra public-client app you've registered. The app needs the device-code flow enabled and delegated `Files.Read.All`, `Sites.Read.All`, and `offline_access` scopes. `sharepoint init` walks you through saving both into the active profile.
147
190
 
191
+ The **REST backend** needs a SharePoint host and browser sign-in, with no tenant
192
+ or client ID. See [browser-session setup](#without-microsoft-graph-browser-session).
193
+
148
194
  Environment overrides:
149
195
 
150
196
  - `SHAREPOINT_PROFILE` — active profile name
@@ -162,7 +208,7 @@ backend. It signs in through a real browser and calls the SharePoint REST API
162
208
  (`/_api`) with your session cookies. No tenant or client ID is needed.
163
209
 
164
210
  ```toml
165
- # ~/.config/sharepoint/config.toml
211
+ # Add to the file printed by `sharepoint config path`
166
212
  [profile.work]
167
213
  backend = "rest"
168
214
  sharepoint_host = "contoso.sharepoint.com"
@@ -183,8 +229,8 @@ sharepoint --profile work doctor
183
229
  - A snap-packaged Chromium (the default `chromium` on Ubuntu) won't work: its
184
230
  private `/tmp` hides the browser's DevTools port file from the CLI. Point
185
231
  `SHAREPOINT_BROWSER` at a non-snap Chrome, Chromium or Edge instead.
186
- - The session is stored per host in `$XDG_CACHE_HOME/sharepoint/sessions.json`
187
- (or `~/.cache/sharepoint/sessions.json`) with mode 0600. When it expires, run
232
+ - The session is stored per host in `sessions.json` in the cache directory
233
+ above, with mode 0600 on Unix. When it expires, run
188
234
  `sharepoint auth login` again; `sharepoint auth logout` removes it.
189
235
  - OneDrive lives on its own host (`contoso-my.sharepoint.com`), so it needs
190
236
  its own profile and `auth login`:
@@ -201,6 +247,13 @@ sharepoint --profile work doctor
201
247
 
202
248
  MIT
203
249
 
250
+ ## Testing
251
+
252
+ Run `make test-simulator` for repeatable local REST smoke tests with dummy data,
253
+ or `make simulator` to explore the fixtures interactively. No tenant or login is
254
+ needed. See [the testing guide](docs/testing.md) for scenarios, custom fixtures,
255
+ and live SharePoint/OneDrive testing.
256
+
204
257
  ## Releasing
205
258
 
206
259
  Vership owns versioning, changelog generation, release commits, and tags. See
@@ -0,0 +1,50 @@
1
+ # Releases
2
+
3
+ Vership is the release control plane for `sharepoint-cli`. GitHub Actions is the
4
+ execution plane for cross-platform builds, publication, provenance, and
5
+ downstream packaging.
6
+
7
+ ## Create a release
8
+
9
+ Start from a clean, up-to-date `main` branch and run:
10
+
11
+ ```sh
12
+ vership preflight
13
+ vership bump patch --prepare # or minor/major; creates the release commit locally
14
+ # After approval to push and publish:
15
+ vership release
16
+ # Wait for the tag's Release workflow to finish, then:
17
+ vership verify --targets tag,release,crates,pypi
18
+ ```
19
+
20
+ Before preparing, inspect `vership status`, `vership config show`, and the
21
+ installed command's `--help`. Preparation runs `make check`, updates the package
22
+ version and changelog, and creates the Conventional Commit release commit.
23
+ Review and test that commit, then use `vership release` to tag and push the
24
+ prepared version without bumping again. The tag starts the release workflow.
25
+ Publishing requires explicit approval; an instruction to release a named version
26
+ provides that authorization.
27
+
28
+ Wait for CI on Linux, macOS, and Windows and the publication workflow. Verify
29
+ all four targets, download a published binary, check its version and checksum,
30
+ and run `cargo run --example simulator -- smoke --cli /path/to/sharepoint`.
31
+ Finally fetch and fast-forward the primary checkout to the remote default branch,
32
+ confirming that the release tag and remote branch reference the tested commit.
33
+
34
+ Cargo and Python package versions are kept synchronized as one release unit.
35
+
36
+ ## Failure policy
37
+
38
+ If a release fails before any release, artifact, package, checksum, or
39
+ attestation becomes public, delete and recreate the brief tag and retry the
40
+ same version. Once anything was published, preserve the tag and issue a patch
41
+ release for release-content corrections. Registry and downstream-packaging
42
+ jobs are separate recovery domains; retry only the failed job when possible.
43
+
44
+ ## Dry runs
45
+
46
+ The Release workflow can be dispatched from `main` with `dry_run` enabled. It
47
+ uses the package version unless an explicit `version` is supplied, builds the
48
+ real artifacts, and exercises registry validation without publishing packages,
49
+ creating a GitHub release, generating attestations, or updating downstream
50
+ packaging.