Contributing
Contributions are welcome! This guide covers what you need to get started.
Prerequisites
Section titled “Prerequisites”- Node.js >= 18
- pnpm >= 9
- A Firebase project (for testing sync — see Firebase Setup)
git clone https://github.com/melagiri/code-insights.gitcd code-insights/clipnpm installpnpm buildnpm link # Makes `code-insights` available globallyDevelopment
Section titled “Development”cd clipnpm dev # Watch mode — recompiles on savepnpm build # One-time compilepnpm lint # Run ESLintThe CLI is written in TypeScript with ES Modules and compiled to dist/. After npm link, changes rebuild automatically in watch mode.
Workflow
Section titled “Workflow”-
Create a branch
Terminal window git checkout -b feature/your-feature-name -
Make your changes — Run
pnpm devfor live recompilation. -
Verify
Terminal window pnpm build # Ensure clean compilepnpm lint # Check for lint errors -
Test locally
Terminal window code-insights sync --dry-run -
Submit a PR — Keep it focused. One feature or fix per PR.
Code Style
Section titled “Code Style”- TypeScript with strict mode enabled
- ES Modules (
import/export, notrequire) - Match the existing style in surrounding code
- Use
chalkfor colored terminal output,orafor spinners
Commit Messages
Section titled “Commit Messages”Follow the existing convention:
type(scope): short description
# Examples:feat(cli): add export command for session datafix(parser): handle empty JSONL files gracefullydocs: update CLI README with troubleshooting sectionchore(cli): update firebase-admin dependencyTypes: feat, fix, docs, chore, refactor, test
What to Work On
Section titled “What to Work On”- Check open issues for bugs and feature requests
- Issues labeled
good first issueare a great starting point - If you want to work on something not listed, open an issue first to discuss
Reporting Bugs
Section titled “Reporting Bugs”Include:
- What you expected to happen
- What actually happened
- Steps to reproduce
- Node.js version (
node --version) - OS and version
Project Structure
Section titled “Project Structure”code-insights/├── cli/ # CLI tool (this is where the code lives)│ ├── src/│ │ ├── commands/ # CLI commands (init, sync, status, connect, reset, install-hook)│ │ ├── parser/ # JSONL parsing and session title generation│ │ ├── firebase/ # Firestore client operations│ │ ├── utils/ # Config and device utilities│ │ ├── types.ts # TypeScript type definitions│ │ └── index.ts # CLI entry point│ └── dist/ # Compiled output (not committed)├── docs/ # Product docs, roadmap└── docs-site/ # This documentation site (Starlight)License
Section titled “License”By contributing, you agree that your contributions will be licensed under the MIT License.