The ultra-fast CLI companion for Logseq designed to speed up your note capture directly from the terminal!
- ⚡️ Lightning-fast journal additions without leaving your terminal
- ⌨️ Optimized for both quick captures and extended writing sessions
- 🎯 Native support for Logseq's file naming and formatting conventions
- 🔄 Seamless integration with your existing Logseq workflow
- 💻 Built by Logseq users, for Logseq users
- External editor integration ($EDITOR by default)
- Automatic journal file creation
- Support for both Markdown and Org formats
- Configurable file naming format
- Customizable directory location
- User defined configuration file
go install github.com/jrswab/lsq@latestlsq-a: Append text directly to the current journal page-A: Append the contents of STDIN to the current journal page-d: Specify main directory path. (example:/home/jrswab/Documents/Notes)-e: Set editor to use while editing files. (Defaults to $EDITOR, then Vim if $EDITOR is not set)-f: Search pages and aliases. Must be followed by a string.-o: Automatically open the first result from the search.-p: Open a specific page from the pages directory.-s: Specify the journal date to open. (Must beyyyy-MM-ddformatted)-v: Display the version of lsq being executed.-y: Open yesterday's journal file.
This file must be stored in your config directory as lsq/config.edn.
On Unix systems, it returns $XDG_CONFIG_HOME if non-empty, else $HOME/.config will be used.
On macOS, it returns $HOME/Library/Application Support.
On Windows, it returns %AppData%.
On Plan 9, it returns $home/lib.
The configuration file will override any lsq defaults which are defined. If a CLI flag is provided, the flag value will override the config file value.
{
;; Either "Markdown" or "Org".
:file/type "Markdown"
;; This will be used for journal file names
;; Using the format below and the file type above will produce 2025.01.01.md
:file/format "yyyy_MM_dd"
;; The directory which holds all your notes
:directory "/home/jaron/Logseq"
}Note: The configured directory must contain both a journals and pages subdirectory for lsq to function properly. These are automatically created when using Logseq, but will need to be manually created if setting lsq to use a new directory or without Logseq.
lsqThis opens today's journal in your default editor ($EDITOR environment variable).
If no editor is defined in $EDITOR, then Vim will be used.
lsq -p file_name.md -a "text to append"This combination will append the text to the page with file name file_name.md.
If -p is not provided the appended text will be placed in today's journal entry.
lsq -f word -oThis will search your pages for files containing "word" and open the first result in $EDITOR.
If -o is not provided lsq will output all files which contain "word" to STDOUT.
cat ~/.zshrc | lsq -AThis will take the contents of your ~/.zshrc file and append it to your current
journal. This reads STDIN through to end-of-file, so be sure to Ctrl-d if your
contents don't contain an end-of-file.
run_long_batch_job |& lsq -A -p "long-job.$(date +%s).log"This will run your long-running batch job, and it'll append the contents of STDIN
and STDERR (note the pipe!) to a new page called long-job.UNIX_TIMESTAMP.log.
For information on contributing to lsq check out CONTRIBUTING.md.
GPL v3