rlu
is a Rust-based command-line utility designed to interact with Logseq, a privacy-first, open-source knowledge base that works on top of local Markdown and Org-mode files. This utility provides various functionalities including adding journal notes, displaying entries, and managing content in Logseq.
- Add Journal Entries: Add new entries to your Logseq journal from stdin or directly from the command line.
- Show Journal Entries: Display the entries for a specific date.
- Get Journal Entry: Retrieve a specific entry by its ID.
- Output Entry Content: Output the full content of a specific entry.
- Add Content: Add content to the start or end of an existing entry.
- Add Child Node: Add a child node to an existing entry.
- Delete Entry: Delete a specific entry by its ID.
To install rlu
, you'll need to have Rust installed (builds coming soon). Once you have Rust installed, you can build the project using Cargo:
git clone https://github.com/yourusername/rlu.git
cd rlu
cargo build --release
The compiled binary will be located in target/release/
.
To use the rlu
command-line tool, you can run the following commands:
-
Add a Journal Note:
rlu add --content "Your journal content" --date "2023-10-05"
You can also pipe content from stdin:
echo "Your journal content" | rlu add
-
Show Journal Entries:
rlu show --date "2023-10-05"
-
Get Journal Entry:
rlu get --entry_id "entry-uuid"
-
Output Entry Content:
rlu output-content --entry_id "entry-uuid"
-
Add Content to Start:
rlu add-to-start --entry_id "entry-uuid" --content "New start content"
-
Append Content to End:
rlu append-to-end --entry_id "entry-uuid" --content "New end content"
-
Add Child Node:
rlu add-child-node --entry_id "parent-id" --content "Child node content"
-
Delete Entry:
rlu delete --entry_id "entry-uuid"
Ensure that the following environment variables are set:
LOGSEQ_API_URL
: The URL for the Logseq API (default:http://127.0.0.1:12315/api
).LOGSEQ_API_KEY
: Your Logseq API key for authorization.
export LOGSEQ_API_URL="http://your-logseq-url/api"
export LOGSEQ_API_KEY="your-logseq-api-key"
rlu add --content "Meeting notes for today" --date "2023-10-05"
rlu show --date "2023-10-05"
reqwest
: For making HTTP requests.serde
andserde_json
: For serializing and deserializing JSON.chrono
: For handling date and time.clap
: For command-line argument parsing.log
andenv_logger
: For logging.
Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.