Record, update, and query journal entries using jrnl CLI. Supports multiple journals, timestamps, tags, and exports to JSON/Markdown...
You have access to the jrnl command-line journaling tool. Use it to help the user record thoughts, notes, activities, and retrieve historical entries.
# Simple entry (uses current time)
jrnl "Entry title. Entry body text here."
# Entry with specific time
jrnl "yesterday at 3pm: Meeting notes. Discussed the project roadmap."
# Starred/important entry
jrnl "*Important note. This entry is marked as starred."
# To a specific journal (if configured)
jrnl work "Completed the API refactor."
# Recent entries
jrnl -n 5 # Last 5 entries
# By date
jrnl -on "last friday" # Specific day
jrnl -from "last week" # Since date
jrnl -from "2024-01-01" -to "2024-01-31" # Date range
# By content
jrnl -contains "meeting" # Search text
jrnl @project # By tag
jrnl -starred # Starred only
# For agent parsing (structured data)
jrnl -n 10 --format json
# For user display
jrnl -n 10 --format markdown
jrnl -n 10 --format pretty
# Tags summary
jrnl --tags --format json
List configured journals:
jrnl --list --format json
Write to a specific journal:
jrnl <journal-name> "Entry text"
Read from a specific journal:
jrnl <journal-name> -n 5 --format json
Always include these tags on every entry you create:
@agent - Marks this entry as created by an AI agent (distinguishes from manual user entries)@repo/<owner>/<name> - When in a git repository, associates the entry with that projectjrnl "Fixed auth bug. Resolved JWT expiration issue. @agent @repo/owner/name @bugfix"
When working in a git repository, include a @repo/<owner>/<name> tag to associate the entry with that project.
Before creating an entry, get the repo info:
git remote get-url origin 2>/dev/null | sed -E 's/.*[:/]([^/]+)\/([^/]+?)(\.git)?$/\1\/\2/'
This extracts owner/repo from either HTTPS or SSH remote URLs.
Use hierarchical tags for repository context:
@repo/<owner>/<name> - The repository (e.g., @repo/anthropics/claude-code)@branch/<name> - Current branch if relevant (e.g., @branch/feature-auth)# Get repo context
repo=$(git remote get-url origin 2>/dev/null | sed -E 's/.*[:/]([^/]+)\/([^/]+?)(\.git)?$/\1\/\2/' | tr '[:upper:]' '[:lower:]')
# Create entry with required tags
jrnl "Fixed auth bug. Resolved the JWT expiration issue in middleware. @agent @repo/${repo} @bugfix"
Find all entries for a specific repository:
jrnl @repo/owner/reponame --format json
Find entries across all repos:
jrnl -contains "@repo/" --format json
Use the helper script for automatic repo tagging:
# From scripts/jrnl-repo.sh
jrnl-repo "Fixed the bug. Details here."
# Automatically adds @repo/owner/name based on current directory
@agent tag - Every entry you create must have @agent@repo/owner/name@ to create searchable tags: @meeting @project-x"yesterday at 2pm: ..." or "last monday: ..."* for important items., ?, !, or :) becomes the titleWhen the user asks you to "note", "remember", "log", or "journal" something:
jrnl "Summary title. Full details here with @agent @relevant @tags."
When you need historical context or the user asks "what did I..." or "when did I...":
# All entries (user and agent) matching keyword
jrnl -contains "keyword" --format json
# Only agent-created entries
jrnl @agent -contains "keyword" -and --format json
# All entries for current repo
jrnl @repo/owner/name --format json
# All entries today
jrnl -on today --format markdown
# Only agent entries today
jrnl @agent -on today -and --format markdown
By default, queries return all entries (both manual user entries and agent-created). To filter:
# Agent-created only
jrnl @agent --format json
# User-created only (exclude agent)
jrnl -not @agent --format json
# Agent entries for specific repo
jrnl @agent @repo/owner/name -and --format json
Use --format json for structured data you can parse. See references/json-schema.md for the output format.
The jrnl config file is at ~/.config/jrnl/jrnl.yaml. To check current config:
cat ~/.config/jrnl/jrnl.yaml
For detailed command reference, see references/commands.md.