Terminal Operations

Terminal Operations

How to read, search, edit, and analyze worklogs from the terminal without a browser.

Path Structure

docs/modules/ROOT/pages/YYYY/MM/WRKLOG-YYYY-MM-DD.adoc    ← container (shell)
docs/modules/ROOT/partials/worklog/                        ← section assemblers
docs/modules/ROOT/partials/worklog/urgent/                 ← urgent sub-partials
docs/modules/ROOT/partials/worklog/morning/                ← morning focus slot
docs/modules/ROOT/partials/worklog/work/                   ← CHLA work sections
docs/modules/ROOT/partials/worklog/education/              ← education sections
docs/modules/ROOT/partials/trackers/work/priorities/       ← daily priority checklist
docs/modules/ROOT/partials/trackers/work/projects/         ← project portfolio (p0, p1, p2)
docs/modules/ROOT/partials/trackers/work/adhoc/            ← carryover, TAC, resolved
docs/modules/ROOT/partials/trackers/work/itsm-tickets/     ← open tickets

Read — Today’s Worklog

read full worklog — man bash → Command Substitution
bat docs/modules/ROOT/pages/2026/$(date +%m)/WRKLOG-$(date +%Y-%m-%d).adoc
headings only (outline) — man awk → PATTERNS
awk '/^=+ /' docs/modules/ROOT/pages/2026/$(date +%m)/WRKLOG-$(date +%Y-%m-%d).adoc
open items only
grep '\[ \]' docs/modules/ROOT/pages/2026/$(date +%m)/WRKLOG-$(date +%Y-%m-%d).adoc
open vs completed count — man awk → variables, END block
awk '/\[ \]/{o++} /\[x\]/{d++} END{printf "Open: %d  Done: %d\n",o,d}' \
  docs/modules/ROOT/pages/2026/$(date +%m)/WRKLOG-$(date +%Y-%m-%d).adoc

Read — Resolved Partials (The Actual Content)

The worklog page is a shell. The content lives in partials, assembled via includes.

see what a worklog includes — man grep-o only-matching
grep 'include::' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc
read the priorities tracker (what shows up in the worklog)
bat docs/modules/ROOT/partials/trackers/work/priorities/current.adoc
read any assembler to see what IT includes
grep 'include::' docs/modules/ROOT/partials/worklog/urgent.adoc
grep 'include::' docs/modules/ROOT/partials/worklog/work-chla.adoc
resolve the full include chain — page → assembler → sub-partial → tracker
# Level 1: page includes assemblers
grep 'include::' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc

# Level 2: assembler includes sub-partials
grep 'include::' docs/modules/ROOT/partials/worklog/urgent.adoc

# Level 3: sub-partial includes tracker data
grep 'include::' docs/modules/ROOT/partials/worklog/urgent/professional.adoc

Read — Multiple Worklogs

this week — man bash → Brace Expansion
bat docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-{17,18,19,20,21}.adoc
headings across a range — brace expansion + parameter expansion ${f##*/}
for f in docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-{17,18,19,20,21}.adoc; do
  printf "\n═══ %s ═══\n" "${f##*/}"
  awk '/^=+ /' "$f"
done
open item count per day (trend)
grep -c '\[ \]' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-{17,18,19,20,21}.adoc

Search — Find Across Worklogs

what day did I work on a topic? — man grep-l files-only
grep -l 'MSCHAPv2' docs/modules/ROOT/pages/2026/04/WRKLOG-*.adoc
search all months
grep -rl 'mandiant' docs/modules/ROOT/pages/2026/*/WRKLOG-*.adoc
search with context (3 lines around match)
grep -n -C3 'murus-portae' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc
extract a specific section — man awk → pattern range
# Carryover section
awk '/^=== Carryover/,/^include::/' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc

# Session accomplishments
awk '/^== Session Accomplishments/,/^== [A-Z]/ && !/Session/' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc

Edit — Worklog Content

Worklogs have two kinds of content: inline (written directly in the page) and included (lives in partials). Know which you’re editing.

edit inline content (session accomplishments, carryover items) — edit the PAGE
# Find line number
grep -n 'CAB presentation' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc

# Mark done on that line — `man sed` → ADDRESSES (line number)
sed -i '42s/\[ \]/[x]/' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc

# Verify — `man awk` → NR (record number)
awk 'NR==42' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc
edit included content (priorities, tickets, projects) — edit the PARTIAL
# Priorities live HERE, not in the worklog:
bat docs/modules/ROOT/partials/trackers/work/priorities/current.adoc

# Mark a priority done
grep -n 'Schedule recurring Wednesday' docs/modules/ROOT/partials/trackers/work/priorities/current.adoc
sed -i '19s/\[ \]/[x]/' docs/modules/ROOT/partials/trackers/work/priorities/current.adoc
awk 'NR==19' docs/modules/ROOT/partials/trackers/work/priorities/current.adoc
add a new priority item — man sed → insert i\
# Insert before the P1 section
sed -i '/^=== P1/i * [ ] **P0** - New urgent item here' \
  docs/modules/ROOT/partials/trackers/work/priorities/current.adoc
update the morning focus slot
# The morning focus is a single-file slot:
bat docs/modules/ROOT/partials/worklog/morning/focus.adoc

# Replace content entirely with heredoc — `man bash` → HERE DOCUMENTS
cat > docs/modules/ROOT/partials/worklog/morning/focus.adoc << 'EOF'
* [ ] New morning focus item
* [ ] Second focus item
EOF

Edit — Add a New Worklog Section

add a new urgent domain — create the sub-partial, wire into assembler
# Create the sub-partial
cat > docs/modules/ROOT/partials/worklog/urgent/infrastructure.adoc << 'EOF'
=== Infrastructure — Urgent

* [ ] Vault Raft cluster — verify vault-01 rejoined
* [ ] k3s NAT verification — 43 days critical
EOF

# Wire into the assembler — insert before the closing ---
sed -i '/^---$/i include::partial$worklog/urgent/infrastructure.adoc[]' \
  docs/modules/ROOT/partials/worklog/urgent.adoc

# Verify
grep 'include::' docs/modules/ROOT/partials/worklog/urgent.adoc
items ADDED today vs yesterday — man bash → Process Substitution, man diff
diff <(grep '\[ \]' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-20.adoc | sort) \
     <(grep '\[ \]' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc | sort)
items COMPLETED today vs yesterday
diff <(grep '\[x\]' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-20.adoc | sort) \
     <(grep '\[x\]' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc | sort) | grep '^>'
open item trend with sparkline — brace expansion + arithmetic expansion
for f in docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-{17,18,19,20,21}.adoc; do
  count=$(grep -c '\[ \]' "$f" 2>/dev/null || echo 0)
  printf "%s  %3d  %s\n" "${f##*/}" "$count" "$(printf '█%.0s' $(seq 1 $((count/3))))"
done

Automation — Existing Scripts

Script Purpose man reference

make new-day

Create today’s WRKLOG from template with section includes

Makefile target → runs scripts/worklog/ scripts

scripts/worklog/update-carryover-days.sh

Auto-calculate days-open for carryover items

man date → date arithmetic

scripts/nav/sync-worklog-nav.sh

Add new worklog to chronicle nav partial

man sed → insert i\

scripts/worklog/update-monthly-index.sh

Regenerate monthly index from existing worklogs

man find-name, man sort

scripts/worklog/audit-worklogs.sh

Check worklogs for standards compliance

man grep-c count, -l files-only