How badlogic/lemmy works
Project type and purpose
• This is a TypeScript monorepo focused on AI applications.
• Core libraries: “@mariozechner/lemmy” (LLM abstraction and tool execution) and “@mariozechner/lemmy-tui” (terminal UI).
• Multiple CLI apps under /apps (e.g., claude-bridge, claude-trace, lemmy-chat, snap-happy) that demonstrate or extend the core libraries.
File structure
• Top level:
• packages/lemmy – LLM client abstractions, tool registry, conversational context management
• packages/lemmy-tui – TUI framework components (renderers, editors, markdown)
• packages/lemmy-cli-args, lemmy-tools, lemmy-tui – utility and example packages for CLI arg parsing and tool handling
• apps/… – standalone applications using core libraries, each with its own src/, test/, build configs
• .github, .husky, tsconfig.json, workspace package.json – monorepo tooling, CI, hooks, TypeScript references
• Each app has:
• src/ folder with CLI entrypoints, interceptors, transformers, HTML or TUI generators
• test/ folder for unit or integration tests
• package.json and build configs (tsup, tsconfig)
• Patterns:
• Modular layered design—core libraries in packages, apps import and extend them
• CLI layer → business logic layer → provider abstractions → external LLM services
README for additional insights
• Monorepo uses workspaces and incremental TypeScript builds.
• Core design: unified LLM interface supporting multiple providers, manual tool execution, streaming, context serialization.
• TUI designed with differential rendering, composable components.
• Apps demonstrate interception (claude-bridge), conversation tracing (claude-trace), chat UI (lemmy-chat), native integrations (snap-happy).