Shift Log: An Afternoon CLI Assistant Worth Keeping
The afternoon assignment is small: build a command-line assistant that turns a deployment log into a draft handover note. It reads a file or standard input, identifies reported failures and unresolved questions, and writes its answer to standard output. The operator reviews the result before sharing it. That is enough scope for a first project and enough real work to expose the habits worth keeping this year.
Success means a teammate can install it, understand what it sends, and recognize when it fails. Start with one command, one input format, and one useful output.
First hour: establish the command’s contract
Use Python and an SDK you already understand. Give the command a file argument and support piped input. Add options for the model and maximum output length, while keeping sensible defaults in configuration. A short help message should explain where input goes and what the assistant produces.
Write the output contract before writing the prompt. For a handover assistant, ask for a short incident summary, observations supported by the supplied log, and questions that still need an operator. Require it to say when the input lacks an answer. A timestamp in a log establishes when something was recorded; it does not automatically establish when the underlying problem began.
- The command should reject empty input before making a paid request.
- The command should send diagnostics to standard error so standard output remains usable in a pipeline.
- The command should return a nonzero exit status when the request fails.
- The command should support a preview that shows the selected file, model, and input size without sending anything.
Second hour: make the network boundary visible
Read the API key from an environment variable. Keep it out of source files, command arguments, and debug output. Treat log contents with similar care: deployment logs can contain credentials, customer identifiers, and internal addresses. Use a scrubbed sample while developing, then establish which data your team permits you to send.
Set an explicit request timeout and inspect the SDK’s retry defaults. Keep retries bounded, and avoid adding an outer retry loop that silently multiplies the SDK’s attempts. An ambiguous connection failure deserves care because the remote service may already have accepted the request.
Relay365 fits here when you want pay-as-you-go access to several model families through a shared relay desk. For an OpenAI SDK client, configure the base URL as https://api.api365relay.com/v1 and supply your Relay365 key through the environment. Confirm the supported endpoint and exact model identifier before wiring them into configuration. You might evaluate Gemini 2.5 Flash or Claude Haiku 4.5 on your sample logs, then keep the model configurable.
Third hour: test the handover against actual evidence
Keep a small set of scrubbed fixtures alongside the project. Include a successful deployment, an explicit failure, an incomplete log, and a log containing text that looks like instructions to the assistant. Tell the model to treat the supplied log as data. That instruction helps establish the task boundary, but it is not a security guarantee.
Evaluate observable behavior. Does the draft distinguish a reported error from a guessed cause? Does it preserve relevant timestamps? Does it acknowledge missing evidence? Avoid tests that require identical wording on every run. Use ordinary deterministic tests for file handling, configuration, and exit codes; review model output against a short, stable checklist.
Save the prompt version and model identifier with evaluation results. When a later change makes the summaries worse, those records give you a starting point for investigation.
Final hour: leave the operator a dependable command
Set an input limit and explain it in the help text. If a file exceeds the limit, stop with an actionable message. Quietly cutting off the end of a deployment log can remove the failure the operator needs to understand.
Keep this first assistant focused on drafting text. Printing a suggested next step is a useful afternoon feature; executing it introduces permissions, confirmation, and recovery work that deserves its own project.
If a shared relay suits your setup, create a Relay365 account and try the command with a scrubbed fixture. Before ending the shift, leave a README with installation steps, required environment variables, one sample invocation, and the evaluation checklist. Tomorrow’s operator should be able to reproduce today’s result.
Further desk bulletins
| Date | Bulletin title | Filed under | Language |
|---|---|---|---|
| 2026-10-27 | Duty note: keep AI log triage evidence-bound | Field notes from the desk | EN |
| 2026-10-27 | Duty Log: AI Ticket Triage Practices We’re Keeping | Field notes from the desk | EN |
| 2026-10-27 | Duty Log: Keep These Internal Docs Chatbot Practices | Field notes from the desk | EN |
| 2026-10-27 | Shift Note: Trace the Requests Behind the Spend | Field notes from the desk | EN |
| 2026-10-27 | Shift Note: Test Two Models on Last Week’s Tickets | Field notes from the desk | EN |
| 2026-10-26 | Duty Log: Python’s Provider Switch Is Not a Failover Plan | Field notes from the desk | EN |
Curious how it runs on your own code? Sign up →