Skip to main content

hjk logs

View output from a session without attaching.

Synopsis

hjk logs <branch> <session> [flags]

Description

Reads from the session's log file, useful for checking on detached agents without interrupting them. All session output is automatically captured to log files regardless of attached/detached mode.

Arguments

ArgumentDescription
branchGit branch name of the instance (required)
sessionSession name to view logs for (required)

Flags

FlagShortTypeDefaultDescription
--follow-fboolfalseFollow log output in real-time
--lines-nint100Number of lines to show
--fullboolfalseShow entire log from session start

Examples

# View recent output (last 100 lines)
hjk logs feat/auth happy-panda

# Follow output in real-time
hjk logs feat/auth happy-panda -f

# Show last 500 lines
hjk logs feat/auth happy-panda -n 500

# Show entire log from session start
hjk logs feat/auth happy-panda --full

Behavior

  • Default mode: Shows the last N lines (default 100) and exits
  • Follow mode (-f): Shows the last N lines, then streams new output as it appears (similar to tail -f)
  • Full mode (--full): Shows the entire log file from the beginning

The --full flag takes precedence over --lines when both are specified.

Log Storage

Session logs are stored at the path configured in storage.logs (default: ~/.local/share/headjack/logs/). Each session has its own log file identified by instance ID and session ID.

See Also

  • hjk attach - Attach to a session interactively
  • hjk ps - List sessions to find session names
  • hjk run - Create a new session