This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a CLI chat application built with Ink, a React-based framework for building command-line interfaces. The app provides an interactive chat interface in the terminal with message history, input handling, and simulated bot responses.
src/
├── app.js # Main React component wrapper
├── chat-cli.js # CLI entry point with Ink rendering
└── use-input.jsx # Core chat application component
- ChatApp (use-input.jsx): Main chat interface with message state, input handling, and rendering
- App (app.js): Simple wrapper component
- chat-cli.js: CLI bootstrap using meow for argument parsing and Ink for rendering
The chat app uses React hooks for state:
messages: Array of chat messages with types (system/user/bot)currentInput: Current text inputloading: Loading state for bot responsesuseInput: Ink hook for keyboard input handling
npm run build # Transpile JSX to dist/
npm run dev # Build with watch mode
npm start # Run built CLInpm test # Run prettier, xo linting, and ava tests
npm run format # Auto-fix prettier formattingnode dist/chat-cli.js # Run built CLI directly- AVA: Test runner with JSX support via import-jsx
- ink-testing-library: For testing Ink component rendering
- Current tests: Basic greeting tests in test.js (may need updates for chat functionality)
- Runtime: Node.js >=16 (ES modules)
- Build: Babel with @babel/preset-react for JSX
- Styling: Ink components with color support
- Linting: XO with React plugin
- Formatting: Prettier with @vdemedes/prettier-config
- Source files in
src/are ES modules with JSX - Built files output to
dist/(ignored in git) chat-cli.jsis the executable entry point after build