This is part 4 of a series on building a terminal agent from scratch.

Previous parts: – Part 1: Building an Agent from Scratch – Part 2: The Conversation Loop – Part 3: Rendering Markdown in the Terminal

The complete source code is available on GitHub: https://github.com/dimiro1/agent-from-scratch/tree/main/04

In this part, we’ll add syntax highlighting for code blocks. When LLMs return code snippets, they use markdown code blocks with a language hint like clojure or python. We’ll parse these blocks and apply colors to keywords, strings, comments, and numbers.

L…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help