lsq
February 24, 2026 · View on GitHub
The ultra-fast CLI companion for Logseq designed to speed up your note capture directly from the terminal!
Why lsq?
- ⚡️ 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
Features That Power Your Workflow
- External editor integration ($EDITOR by default)
- Automatic journal file creation
- Support for both Markdown and Org formats
- Configurable file naming format
- Customizable directory location with
~and environment variable support - STDOUT output mode for shell scripting and widget integration
- User defined configuration file
Ready to Start?
- Install the binary via Go:
go install github.com/jrswab/lsq@latest
-
Make sure you have the location of the Go binaries in your PATH if it's not already there.
-
Then run:
lsq
Usage
Command Line Options
-a: Append text directly to the current journal page-A: Append the contents of STDIN to the current journal page-c: Print journal or page content to STDOUT instead of opening an editor.-d: Specify main directory path. Supports~and environment variables. (example:~/Documents/Notes)-e: Set editor to use while editing files. (Defaults to EDITOR is not set)-f: Search pages and aliases. Must be followed by a string.-i: Set the indentation level (number of tabs) for appended text. Requires-aor-A.-n: Number of days ago to target for the journal entry. (example:-n 3targets the journal from 3 days ago)-o: Automatically open the first result from the search.-p: Open a specific page from the pages directory.-r: Search pages and journals via regex pattern. Must be followed by a regex string.-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.
Configuration 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.
Configuration Behavior
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.
Configuration File Example:
{
;; 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
;; Supports ~ and environment variables (e.g., ~/Logseq or $HOME/Logseq)
:directory "~/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.
Usage Examples:
lsq
This opens today's journal in your default editor (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 -o
This 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 -A
This 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.
lsq -c
This prints today's journal content to STDOUT without opening an editor. Useful for shell integration, piping to other tools, or display widgets.
lsq -c -n 3
This prints the journal from 3 days ago to STDOUT.
lsq -a "sub-item text" -i 1
This appends text as an indented bullet (one tab level deep), creating a nested
list item in Logseq. Use -i 2 for two levels deep, and so on.
Contributing
For information on contributing to lsq check out CONTRIBUTING.md.
License
GPL v3