Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Yetenol/Obsidian-CLI
https://github.com/Yetenol/Obsidian-CLI
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/Yetenol/Obsidian-CLI
- Owner: Yetenol
- Created: 2022-12-12T12:25:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-26T13:44:10.000Z (about 1 year ago)
- Last Synced: 2024-08-13T07:05:04.820Z (5 months ago)
- Language: PowerShell
- Size: 34.2 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - Yetenol/Obsidian-CLI - (PowerShell)
README
# Obsidian CLI
[![Download script](https://img.shields.io/github/downloads/yetenol/Obsidian-CLI/total.svg)](https://github.com/yetenol/Obsidian-CLI/releases/latest/download/obsidian.exe)
[![List releases](https://img.shields.io/github/release/yetenol/Obsidian-CLI.svg)](https://github.com/yetenol/Obsidian-CLI/releases)Obsidian CLI is a command line interface to create, open and delete Obsidian vaults and to share settings, plugins and layouts between vaults.
# Usage
- **Open folder** as Obsidian vault
Setup vault if none exists
```powershell
obsidian $path
```
- **Remove all trace** of Obsidian
Forget and cleanup file system changes
```powershell
obsidian $path -RemoveVault
```
- **reapply** workplace layout
Repair the vault
```powershell
obsidian $path -Force
```
- **right-click any folder** in Windows Explorer and click *Open as Obsidian vault*# Features
- synchronize **settings and plugins** between all vaults and via the cloud
- import the **default workplace layout** when creating new vaults.
- **attachments** will be placed into a separate folder
- **templates** can be created in separate folder# Build instructions
- install dependency **[ps2exe](https://github.com/MScholtes/PS2EXE)** using elevated command
```powershell
Install-Module ps2exe
```- **build an executable** from the project folder
by packaging the Powershell script
```powershell
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Invoke-ps2exe -inputFile ".\obsidian.ps1" -outputFile ".\bin\obsidian.exe" -noConsole
```- **add to PATH** using elevated commands
```powershell
$binaryPath = ".\bin" | Convert-Path -ErrorAction Stop
$registryKey = 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment'
$locations = $env:PATH -split ";"
if ($locations -contains $binaryPath) {
return
}
$locations + $binaryPath -join ";" | foreach {
Set-ItemProperty -Path $registryKey -Name "PATH" -Value $_
}
```- add **context menu entries**
by importing [Registry Keys](ContextMenuEntries.reg)# Implementation
- create `.obsidian/` config folder with **symbolic links** to the global settings and plugins
- hide and git ignore config folder
- insert `.obsidian/workspace.json` once to apply default workplace layout
- create folders for templates and attachments
- open vault using [Obsidian URI protokoll](https://help.obsidian.md/Advanced+topics/Using+obsidian+URI)