HANDS-ON TASK · 1 OF 1

Build a log explainer CLI

Project: log explainer CLI

You are on call at esc bash. An alert fires at 2am and you are staring at a wall of log lines. Build the tool you wish you had: point it at a log file and get back a short, human explanation of what went wrong.

Set up the project

Run this to drop a realistic log file at /root/sample.log:

bash
curl -fsSL https://raw.githubusercontent.com/Esc-Bash/project-init-scripts/main/ai/project-2/init.sh | bash

Open it and read it - it has an error buried in the middle worth explaining.

What to build

  • Write a command-line tool at /root/explain.py that takes a log file path, reads the file, and asks a model to explain it. Give the model a clear role (an experienced site reliability engineer) and ask for two things in plain English: a one or two sentence summary of what happened, and the most likely cause.
  • Run your tool on /root/sample.log and save its output to /root/explanation.txt.

This combines a role prompt, grounding the answer in the actual log text you pass in, and wrapping a model call in a small reusable CLI. Keep the log text inside the user message so the model explains this log, not a generic one.

Press Submit once /root/explain.py exists and /root/explanation.txt holds its explanation of /root/sample.log.


Your lab setup

This VM comes preconfigured with your AI keys - just type claude to get started. Your key and URL are already set as $OPENAI_BASE_URL and $OPENAI_API_KEY.

Start the lab on the right to run checks.

Pass the checks to continue
Spin up a fresh environment and practice live.
linux-basic-ai · fresh machine · ready in under a minute