Bridging CLI and Note-Taking
J. R. Swab
Posted on November 30, 2024
As developers, we spend countless hours in the terminal. It's our primary interface for everything from git operations to server management. But what happens when you need to quickly jot down a thought or make a note while deep in a coding session?
For me, this meant an annoying context switch. I use Logseq as my primary note-taking and knowledge management system, but every time I needed to make a quick note, I had to:
- Take my hands off the keyboard
- Reach for the mouse
- Switch windows to Logseq
- Navigate to today's journal
- Make my note
- Switch back to the terminal
These micro-interruptions add up. They break flow, waste time, and worst of all, sometimes discourage me from taking notes at all. As a developer who values both efficient workflows and comprehensive note-taking, this friction point needed a solution.
Enter lsq
I created lsq
, a minimal command-line tool that lets you create Logseq journal entries directly from your terminal. At its most basic, it's just:
lsq
This single command opens today's journal in your preferred editor ($EDITOR). No window switching, no mouse required. Just quick, efficient note-taking without leaving your terminal workflow.
How It Works
When you run lsq
, it:
- Checks your Logseq configuration
- Creates today's journal file if it doesn't exist
- Opens it in your preferred editor
By default, it uses the standard Logseq directory structure (~/Logseq
) and reads your config.edn
file for format preferences (Markdown or Org mode).
Beyond Basic Editor Integration
While solving the basic problem, I realized there were Logseq-specific features that would be useful to have in the terminal. This led to adding a Terminal User Interface (TUI) mode:
lsq -t
The TUI provides:
- Direct journal page editing
- TODO state cycling with keyboard shortcuts
- Priority state management
- Immediate save capabilities
Real World Impact
This simple tool has significantly improved my daily workflow:
- No more context switching for quick notes
- Faster capture of ideas while coding
- Easier tracking of terminal commands I want to remember
- Seamless integration with my existing terminal workflow
What's Next?
The project is still evolving. As my first TUI application, it's quite basic but functional. I'm actively working on improvements and would love community input on which features to prioritize.
Some ideas under consideration:
- Block reference support
- Tag autocompletion
- Page linking capabilities
- Block property handling
Try It Yourself
If you're interested in streamlining your terminal-to-notes workflow, you can install lsq with:
go install github.com/jrswab/lsq@latest
The project is open source and available at github.com/jrswab/lsq.
Share Your Thoughts
What terminal-to-note-taking friction points do you face? How do you handle quick note-taking while working in the terminal? I'd love to hear your thoughts and ideas for improving lsq.
Posted on November 30, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.