Thank you for your interest in contributing to CodeTyper CLI! This document provides guidelines and instructions for contributing.
Please be respectful and constructive in all interactions. We welcome contributors of all experience levels.
- Bun >= 1.0.0
- Git
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/codetyper.cli.git cd codetyper.cli - Install dependencies:
bun install
- Build the project:
bun run build
- Link for local testing:
bun link
# Start development mode
bun run dev
# Watch mode with auto-rebuild
bun run dev:watch
# Run tests
bun test
# Type check
bun run typecheck
# Lint code
bun run lint
# Format code
bun run prettier- Check existing issues to avoid duplicates
- Create a new issue with:
- Clear, descriptive title
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Node version, provider)
- Relevant logs or screenshots
- Check existing issues for similar requests
- Create a feature request with:
- Clear description of the feature
- Use cases and motivation
- Proposed implementation (optional)
-
Create a branch from
main:git checkout -b feature/your-feature-name
-
Make your changes following our coding standards
-
Write/update tests if applicable
-
Ensure all tests pass:
bun test -
Commit with clear messages:
git commit -m "feat: add new feature description" -
Push and create a Pull Request
We follow Conventional Commits:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Examples:
feat: add permission caching for faster lookups
fix: resolve race condition in agent loop
docs: update README with new CLI options
- Use TypeScript strict mode
- Define explicit types (avoid
anywhen possible) - Use interfaces for object shapes
- Export types that are part of the public API
- Use 2 spaces for indentation
- Use single quotes for strings
- Add trailing commas in multi-line structures
- Keep lines under 100 characters when reasonable
src/
├── index.ts # Entry point only
├── api/ # API clients (Copilot, Ollama, Brain)
├── commands/ # CLI command implementations
├── constants/ # Centralized constants
├── interfaces/ # Interface definitions
├── prompts/ # System prompts and prompt templates
├── providers/ # LLM provider integrations
├── services/ # Business logic services
│ ├── core/ # Core agent and orchestration
│ ├── hooks/ # Lifecycle hooks
│ ├── plugin/ # Plugin management
│ └── session/ # Session management and forking
├── skills/ # Agent skill definitions
├── stores/ # Zustand state stores
├── tools/ # Agent tools (bash, read, write, edit, etc.)
├── tui-solid/ # Terminal UI (Solid.js + OpenTUI)
│ ├── components/ # Reusable UI components
│ ├── context/ # Solid.js context providers
│ ├── routes/ # TUI route components
│ └── ui/ # Base UI primitives
├── types/ # Type definitions
├── ui/ # Print-mode UI components
└── utils/ # Utility functions
- Write tests for non-UI logic
- Place tests in
tests/directory or colocate with source files - Name test files
*.test.ts - Use descriptive test names
- Tests run with Vitest via
bun test
describe('PermissionManager', () => {
it('should match wildcard patterns correctly', () => {
// ...
});
});- Add JSDoc comments for public APIs
- Update README for user-facing changes
- Update CHANGELOG for notable changes
| File | Purpose |
|---|---|
src/index.ts |
CLI entry point, command registration |
src/services/core/agent.ts |
Agent loop, tool orchestration |
src/services/permissions/ |
Permission system |
src/services/hooks/ |
Lifecycle hooks |
src/services/plugin/ |
Plugin management |
src/services/session/ |
Session forking |
src/tui-solid/app.tsx |
Root TUI component (Solid.js) |
src/tui-solid/components/ |
UI components |
src/stores/ |
Zustand state management |
src/prompts/ |
System prompt templates |
src/tools/ |
Tool implementations |
- Create
src/providers/yourprovider.ts - Implement the
Providerinterface - Register in
src/providers/index.ts - Add authentication in
src/commands/login.ts - Update documentation
- Create
src/tools/yourtool.ts - Define parameters with Zod schema
- Implement
executefunction - Register in
src/tools/index.ts - Add permission handling if needed
- Add event type to
src/types/hooks.ts - Add constants to
src/constants/hooks.ts - Add input type for the event
- Implement execution in
src/services/hooks-service.ts - Call hook from appropriate location
- Create directory in
.codetyper/plugins/{name}/ - Add
plugin.jsonmanifest - Add tools in
tools/*.ts - Add commands in
commands/*.md - Add hooks in
hooks/*.sh
- Add binding to vim constants in
src/constants/ - Add action handler in the vim store (
src/stores/) - Update documentation
- Open a GitHub issue for questions
- Tag with
questionlabel
By contributing, you agree that your contributions will be licensed under the MIT License.