Extract teachable snippets from git repos
Find a file
microchipster a2a7ff865d init
2026-07-31 15:58:11 -07:00
src init 2026-07-31 15:58:11 -07:00
tests init 2026-07-31 15:58:11 -07:00
.gitignore init 2026-07-31 15:58:11 -07:00
Cargo.toml init 2026-07-31 15:58:11 -07:00
patch.txt init 2026-07-31 15:58:11 -07:00
README.md init 2026-07-31 15:58:11 -07:00
tutorial.md init 2026-07-31 15:58:11 -07:00

Git-Teach

An application that provides non-repeating random snippets of codebase logic, segmenting code dependencies based on N depth.

Features

  • Tree-Sitter Indexing: Scans Rust, Python, TypeScript, JavaScript, and Go to build a local call graph mapping Entity -> Dependencies.
  • Rich CLI: Colored outputs, JSON/Markdown format support, and shell completion.
  • API Server & RSS: Exposes a local API and RSS feed for easy integrations.
  • Model Context Protocol (MCP): Native integration for AI agents.

Database Management

git-teach comes with a suite of commands to easily manage the seen snippets database. You are never trapped!


git-teach db status             # View total vs seen snippets

git-teach db list --limit 10    # List recently seen snippets and timestamps

git-teach db mark-seen <name>   # Manually mark a specific snippet as seen

git-teach db mark-unseen <name> # Manually mark a snippet as unseen

git-teach db reset              # Reset all snippets to unseen

Quick Setup

See tutorial.md for full setup and usage instructions.

Examples

Get a colored terminal snippet:

git-teach snippet --depth 1

Get a JSON snippet for piping to jq or other tools:

git-teach snippet --depth 2 --format json | jq .

Start the API / RSS server on port 8080:

git-teach server --port 8080

Then visit http://localhost:8080/rss in your RSS reader.

Generate bash completions:

git-teach generate-completion bash > ~/.local/share/bash-completion/completions/git-teach

Architecture

  • Graph Builder: From a randomly chosen, unseen root node, N depth dependencies are predictably grouped to form a complete, contextual snippet.
  • SQLite Tracker: Keeps track of seen_snippets in ~/.local/share/git-teach/.