Using archr
Tours
An agent shows you code by writing an ordered walk through it.
A tour is an ordered set of stops, each a file, a folder or lines, with something to say about it. An agent writes one to show you how something works, in place of describing it in the conversation.
Walking a tour
archr tour opens the newest tour, and archr tour ID another.
Its stops are listed in a drawer along the bottom and drawn on the code in yellow ▸.
| Key | Does |
|---|---|
j k |
Next and previous stop, in the drawer |
]t [t |
The same, with the drawer closed |
n N |
The same, when a tour is open |
T |
Open the drawer again |
q |
Close the drawer, staying where you are |
Writing one
An agent saves a tour by sending JSON to archr tour new:
{"title": "How a request is served",
"stops": [{"path": "cmd/serve/main.go", "start_line": 12, "end_line": 30,
"text": "Requests come in here..."},
{"path": "internal/router", "text": "...then go to the router."}]}
A stop on a whole file or folder leaves out the lines, and "" is the project.
Lines are 1-based, as on disk now.
archr tours lists the tours, newest first.
Tours are kept in .git/archr/tours/ and are never committed.
Search results
A project search, g/ or gr, is shown the same way: what it found is a list of stops to step through.