Skip to content

Commit a1f31f2

Browse files
author
Amanda Butler
authored
Merge pull request #426 from ARMmbed/AnotherButler-patch-6
Add new content to cli-create.md
2 parents 154fc1f + 71e44a5 commit a1f31f2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/tools/offline/cli-create.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,3 +289,26 @@ You can combine the options of the Mbed update command for the following scenari
289289
* `mbed update --clean --ignore` - Update the current program or library and its dependencies, but ignore any local repositories. Mbed CLI updates whatever it can from the public repositories.
290290

291291
Use these with caution because your uncommitted changes and unpublished libraries cannot be restored.
292+
293+
### Repository caching
294+
295+
To minimize traffic and reduce import times, Mbed CLI caches repositories by storing their indexes under the Mbed CLI user config folder - typically `~/.mbed/mbed-cache/` on UNIX systems, or `%userprofile%/.mbed/mbed-cache/` on Windows systems. Compared to a fully checked out repository, indexes are smaller in size and number of files and contain the whole revision history of that repository. This allows Mbed CLI to quickly create copies of previously downloaded repository indexes and pull or fetch only the latest changes from the remote repositories, therefore dramatically reducing network traffic and download times, especially for big repositories such as `mbed-os`.
296+
297+
You can manage the Mbed CLI caching behavior with the following subcommands:
298+
299+
```
300+
mbed cache [on|off|dir <path>|ls|purge|-h|--help]
301+
```
302+
303+
- `on` - Turn repository caching on. This uses either the user specified cache directory or the default one. See "dir".
304+
- `off` - Turn repository caching off. Note that this doesn't purge cached repositories. See "purge".
305+
- `dir` - Set cache directory. Set to "default" to let Mbed CLI determine the cache directory location. Typically, this is `~/.mbed/mbed-cache/` on UNIX systems, or `%%userprofile%%/.mbed/mbed-cache/` on Windows systems.
306+
- `ls` - List cached repositories and their size.
307+
- `purge` - Purge cached repositories. Note that this doesn't turn caching off.
308+
- `-h` or `--help` - Print cache command options.
309+
310+
If no subcommand is specified to `mbed cache`, Mbed CLI prints the current cache setting (ENABLED or DISABLED) and the path to the local cache directory.
311+
312+
For safety reasons, Mbed CLI uses the `mbed-cache` subfolder to a user specified location. This ensures that no user files are deleted during `purge` even if the user has specified root/system folder as a cache location (for example, `mbed cache dir /` or `mbed cache dir C:\`).
313+
314+
**Security notice**: If you use cache location outside your user home/profile directory, then other system users might be able to access the repository cache and therefore the data of the cached repositories.

0 commit comments

Comments
 (0)