How build-with-groq/groq-code-cli works
Project type and purpose
• This is an open-source, extensible coding CLI (command-line interface) written in TypeScript/Node.js with a React-based text UI (“TUI”) layer.
• It provides a pluggable slash-command and tool framework that calls out to the Groq AI API for code generation/analysis.
File structure
• Top-level artifacts:
• package.json & tsconfig.json → build & dependency config
• docs/ → UX screenshots & thumbnail
• src/ → ANSI-TUI code, core logic, commands, tools, utils
• src/core → “agent” orchestration and CLI entry point
• src/commands → slash-command definitions (handler + metadata)
• src/tools → tool schemas + implementations + validators
• src/ui → React components, hooks for the TUI layer
• src/utils → file I/O, local settings, markdown utilities
• Build scripts: npm run build/dev, publish as a global ‘groq’ binary.
Key README insights
• Core entry: src/core/cli.ts → bootstraps the CLI, loads commands/tools, wires up the UI.
• Agent: src/core/agent.ts → encapsulates request/response to Groq API + tool invocation.
• TUI: React components in src/ui render message history, input overlays, invoke slash commands.
• Extensibility: add tools via tool-schemas.ts + tools.ts; add slash-commands under commands/definitions.