Installations
npm install ovm
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>=18.0.0
Node Version
20.11.0
NPM Version
10.8.2
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (97.38%)
JavaScript (2.52%)
Batchfile (0.11%)
Developer
msudgh
Download Statistics
Total Downloads
286
Last Day
1
Last Week
5
Last Month
18
Last Year
286
GitHub Statistics
18 Stars
141 Commits
2 Watching
10 Branches
1 Contributors
Package Meta Information
Latest Version
0.4.3
Package Id
ovm@0.4.3
Unpacked Size
131.61 kB
Size
25.61 kB
File Count
56
NPM Version
10.8.2
Node Version
20.11.0
Publised On
25 Aug 2024
Total Downloads
Cumulative downloads
Total Downloads
286
Last day
0%
1
Compared to previous day
Last week
0%
5
Compared to previous week
Last month
-47.1%
18
Compared to previous month
Last year
0%
286
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
14
Dev Dependencies
29
ovm (Obsidian Vaults Manager) is a CLI application designed to streamline the management of vaults in Obsidian. This tool aims to overcome the limitations associated with performing bulk tasks on specific vaults and plugins. It enables users to install, uninstall, prune, and generate reports for a set of favorite plugins across multiple vaults, enhancing productivity and efficiency.
Table of Contents
Features
- Manage Obsidian plugins: Install/Uninstall/Prune plugins in multiple vaults at one go.
- Perform actions on Obsidian or custom vaults: By default, Obsidian vaults are supported and detected. The vault-related commands support
-p
flag to define a custom vault/s from a path orGlob
pattern. e.g.~/Documents/obsidian/*
. - Generate reports: Generate statistics of vaults and installed plugins with Table/JSON output format.
- Interactive CLI: User-friendly interface to select vaults and plugins for each command.
- Cross-platform: Windows, macOS, and Linux.
Requirements
- Node.js 18.x or higher
Usage
1$ npm install -g ovm 2$ ovm version 3ovm/0.1.0 darwin-x64 node-v20.11.0 # Output may vary 4$ ovm COMMAND 5running command... 6$ ovm --help [COMMAND] 7USAGE 8 $ ovm COMMAND 9...
Common flags
1 -c, --config=<value> [default: ~/ovm.json] Path to the config file. 2 -d, --debug Enable debugging mode. 3 -t, --timestamp Enable timestamp in logs.
Config file
The config file is created in the user's home directory by ovm ci
and is named ovm.json
. It contains an array of plugins that are to be installed across single/multiple vault.
1{ 2 "plugins": [] 3}
Example config file for following Commands section is as follows:
1{ 2 "plugins": [ 3 { 4 "id": "colored-tags", 5 "version": "latest" 6 }, 7 { 8 "id": "copilot", 9 "version": "latest" 10 }, 11 { 12 "id": "dataview", 13 "version": "latest" 14 } 15 ] 16}
Commands
The content used in the examples below is for illustrative purposes only. e.g. In the output sections, the vaults are stored in
~/Documents/
directory. The actual output may vary.
ovm config init
Aliases: ovm ci
Configure an ovm.json config file in user's home directory.
- Usage:
ovm help config init
- See code: src/commands/config/init.ts
Output
1$ ovm config init 2info: Config file created {"path":"~/ovm.json"} 3 4$ cat ~/ovm.json 5{ 6 "plugins": [] 7}
ovm plugins install
Aliases: ovm pi
Install plugin(s) in specified vaults.
- Usage:
ovm help plugins install
- See code: src/commands/plugins/install.ts
Output
1$ ovm plugins install 2? Select the vaults: Career, Financial, Goals 3info: Installed plugin {"plugin":{"id":"colored-tags","version":"latest"},"vault":{"name":"Career","path":"~/Documents/obsidian/Career"}} 4info: Installed plugin {"plugin":{"id":"copilot","version":"latest"},"vault":{"name":"Career","path":"~/Documents/obsidian/Career"}} 5info: Installed plugin {"plugin":{"id":"dataview","version":"latest"},"vault":{"name":"Career","path":"~/Documents/obsidian/Career"}} 6info: Installed 3 plugins {"vault":{"name":"Career","path":"~/Documents/obsidian/Career"}} 7info: Installed plugin {"plugin":{"id":"colored-tags","version":"latest"},"vault":{"name":"Financial","path":"~/Documents/obsidian/Financial"}} 8info: Installed plugin {"plugin":{"id":"copilot","version":"latest"},"vault":{"name":"Financial","path":"~/Documents/obsidian/Financial"}} 9info: Installed plugin {"plugin":{"id":"dataview","version":"latest"},"vault":{"name":"Financial","path":"~/Documents/obsidian/Financial"}} 10info: Installed 3 plugins {"vault":{"name":"Financial","path":"~/Documents/obsidian/Financial"}} 11info: Installed plugin {"plugin":{"id":"colored-tags","version":"latest"},"vault":{"name":"Goals","path":"~/Documents/obsidian/Goals"}} 12info: Installed plugin {"plugin":{"id":"copilot","version":"latest"},"vault":{"name":"Goals","path":"~/Documents/obsidian/Goals"}} 13info: Installed plugin {"plugin":{"id":"dataview","version":"latest"},"vault":{"name":"Goals","path":"~/Documents/obsidian/Goals"}} 14info: Installed 3 plugins {"vault":{"name":"Goals","path":"~/Documents/obsidian/Goals"}}
ovm plugins prune
Aliases: ovm pp
Prune existing plugin(s) from vaults that are unspecified in the config file.
- Usage:
ovm help plugins prune
- See code: src/commands/plugins/prune.ts
Output
1$ ovm plugins prune 2? Select the vaults: Test 3info: Removed plugin {"pluginId":"obsidian-tasks-plugin","vaultPath":"~/Documents/obsidian/Test"} 4info: Pruned 1 plugins {"vault":{"name":"Test","path":"~/Documents/obsidian/Test"}}
ovm plugins uninstall
Aliases: ovm pu
Uninstall plugin(s) from vaults.
- Usage:
ovm help plugins uninstall
- See code: src/commands/plugins/uninstall.ts
Output
1$ ovm plugins uninstall 2? Select the vaults: Career, Financial, Goals 3? Select the plugins: colored-tags, copilot, dataview 4info: Removed plugin {"pluginId":"colored-tags","vaultPath":"~/Documents/obsidian/Career"} 5info: Removed plugin {"pluginId":"copilot","vaultPath":"~/Documents/obsidian/Career"} 6info: Removed plugin {"pluginId":"dataview","vaultPath":"~/Documents/obsidian/Career"} 7info: Uninstalled 3 plugins {"vault":{"name":"Career","path":"~/Documents/obsidian/Career"}} 8info: Removed plugin {"pluginId":"colored-tags","vaultPath":"~/Documents/obsidian/Financial"} 9info: Removed plugin {"pluginId":"copilot","vaultPath":"~/Documents/obsidian/Financial"} 10info: Removed plugin {"pluginId":"dataview","vaultPath":"~/Documents/obsidian/Financial"} 11info: Uninstalled 3 plugins {"vault":{"name":"Financial","path":"~/Documents/obsidian/Financial"}} 12info: Removed plugin {"pluginId":"colored-tags","vaultPath":"~/Documents/obsidian/Goals"} 13info: Removed plugin {"pluginId":"copilot","vaultPath":"~/Documents/obsidian/Goals"} 14info: Removed plugin {"pluginId":"dataview","vaultPath":"~/Documents/obsidian/Goals"} 15info: Uninstalled 3 plugins {"vault":{"name":"Goals","path":"~/Documents/obsidian/Goals"}}
ovm reports stats
Aliases: ovm rs
Statistics of vaults and installed plugins.
- Usage:
ovm help reports stats
- See code: src/commands/reports/stats.ts
Output: Table (default)
/ JSON
1$ ovm reports stats 2? Select the vaults: Career, Financial, Goals 3┌──────────────┬────────┐ 4│ (index) │ Values │ 5├──────────────┼────────┤ 6│ totalVaults │ 3 │ 7│ totalPlugins │ 3 │ 8└──────────────┴────────┘ 9┌──────────────────────────────────────────────────┬─────────────┬─────────────┬─────────┐ 10│ (index) │ 0 │ 1 │ 2 │ 11├──────────────────────────────────────────────────┼─────────────┼─────────────┼─────────┤ 12│ colored-tags@5.0.0 (118.78 kB) │ 'Career' │ 'Financial' │ 'Goals' │ 13│ copilot@2.5.2 (4.02 MB) │ 'Career' │ │ │ 14│ dataview@0.5.67 (2.38 MB) │ 'Career' │ 'Financial' │ │ 15└──────────────────────────────────────────────────┴─────────────┴─────────────┴─────────┘
ovm vaults run
Aliases: ovm vr
/ ovm r
/ ovm run
Run a shell command on selected vaults (using Node.js child_process).
Disclaimer: Any input containing shell metacharacters may be used to trigger arbitrary command execution, using of this command is at risk of command's caller.
- Usage:
ovm help vaults run
- See code: src/commands/vaults/run.ts
Output: Table (default)
/ JSON
1$ ovm vaults run -s "tar -cf '{0}.tar' '{0}'" -o=json 2? Select the vaults: Career, Financial, Goals 3info: Run command {"command":"tar -cf '~/Documents/obsidian/Career.tar' '~/Documents/obsidian/Career'","vault":{"name":"Career","path":"~/Documents/obsidian/Career"}} 4 5info: Run operation finished! {"custom_commands_log_path":"/var/folders/_v/j4w6kv1s27b6xjfzvl5k6lqm0000gn/T/ovm-custom-command.json"} 6{ 7 "Career": { 8 "success": true, 9 "duration": "2 seconds", 10 "error": null 11 }, 12 "Financial": { 13 "success": true, 14 "duration": "1 second", 15 "error": null 16 }, 17 "Goals": { 18 "success": true, 19 "duration": "1 second", 20 "error": null 21 } 22} 23 24$ ovm r "echo 'Path: {0}'" 25info: Run command {"command":"echo 'Path: ~/Documents/obsidian/Career'","vault":{"name":"Career","path":"~/Documents/obsidian/Career"}} 26 27Path: ~/Documents/obsidian/Career 28 29info: Run operation finished! {"custom_commands_log_path":"/var/folders/_v/j4w6kv1s27b6xjfzvl5k6lqm0000gn/T/ovm-custom-command.json"} 30┌─────────┬─────────┬──────────┬───────┐ 31│ (index) │ success │ duration │ error │ 32├─────────┼─────────┼──────────┼───────┤ 33│ Career │ true │ '10 ms' │ null │ 34└─────────┴─────────┴──────────┴───────┘
Reserved placeholders
A custom command can be executed on vault(s) by using reserved placeholders as string value within the shell command. The placeholders are replaced with the actual values during the execution.
List of placeholders:
{0}
: Vault path{1}
: Vault name
Examples:
- Echo vault(s) path
ovm run "echo 'Path: {0}'"
- Echo vault(s) path and name
ovm run "echo 'Path: {0}, Name: {1}'"
- Echo vault(s) name and silent the command's result
ovm run -s "echo 'Path: {0}'"
- Create an archive of vault(s) by
tar
commandovm run "tar -cf '{0}.tar' '{0}'"
- Encrypt vault(s) directory by
gpg
command [algo:AES256
, passphrasepassword
]ovm run "tar -cf '{0}.tar' '{0}' && gpg --batch --symmetric --cipher-algo AES256 --passphrase 'password' '{0}.tar'"
- Decrypt the archive of vault(s) by
gpg
command [passphrase:password
]ovm run "gpg -q --batch --decrypt --passphrase 'password' -o '{0}.tar' '{0}.tar.gpg'"
License
This project is licensed under the MIT License.
No vulnerabilities found.
No security vulnerabilities found.