'o' is a command-line tool written in Go that allows you to interact seamlessly with your Obsidian vault from the terminal. It was created to help streamline note-taking and reduce the need to context switch between the terminal and the Obsidian GUI. With 'o', you can create new notes, search through existing markdown files, and quickly access daily notes, all while staying in your favorite command-line environment.
Key features include:
- Today Command: Open today's daily note for quick editing.
- Search Command: List and search markdown files using fuzzy finder (fzf).
- New Command: Create new notes with ease.
To install 'o' using Go, ensure you have Go installed and set up properly. Then run:
go install github.com/yousefakbar/o/cmd/o@latest
This will install the binary in your $GOPATH/bin
or $GOBIN
directory. Make sure that directory is in your system's PATH
to use 'o' directly from the terminal.
If you want to build 'o' from the source code, follow these steps:
-
Clone the repository:
git clone https://github.com/yousefakbar/o.git cd o
-
Build the binary:
go build -o o cmd/o/main.go
-
Optionally, move the binary to a directory in your
PATH
:mv o /usr/local/bin/
'o' provides several commands to help you manage your Obsidian vault efficiently.
Note
Each command has a shorthand alias (e.g. t
for today
). You can learn more in the help screen o help
The today
command opens today's daily note for quick editing in your preferred text editor:
o today
If you haven't set a custom location for daily notes, the command will create and open the note in the default directory.
The search
command allows you to search for existing markdown files using fzf
for fuzzy finding:
o search
This command will list all .md
files in your Obsidian vault, and you can use fzf
to quickly select the one you want to open.
The new
command helps you create a new note in your vault:
o new "My New Note"
If you don't provide a note name as an argument, the command will prompt you to enter one interactively.
'o' uses environment variables to configure some settings:
-
OBSIDIAN_VAULT_PATH
: Set this variable to the path of your Obsidian vault:export OBSIDIAN_VAULT_PATH="/path/to/your/vault"
-
EDITOR
: Set this variable to specify your preferred editor for opening notes. If not set, 'nano' will be used by default.export EDITOR="vim"
Contributions are welcome! If you'd like to contribute, feel free to fork the repository and create a pull request. For any questions or suggestions, open an issue on GitHub.