We welcome contributions! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
- Node.js
>=22 <23 - pnpm (via Corepack)
# Clone and enter the repo
git clone https://github.com/laynepenney/codi.git
cd codi
# Enable pnpm via Corepack
corepack enable
# Install dependencies
pnpm install
# Build the project
pnpm build
# Run tests
pnpm test# Run in development mode (with hot reload)
pnpm dev
# Run tests in watch mode
pnpm test:watch
# Build for production
pnpm buildIMPORTANT: Never push directly to main. Always use feature/bugfix branches and pull requests.
- Fork the repository and clone your fork
- Create a feature branch:
git checkout -b feat/amazing-feature(orfix/,chore/) - Make your changes following the coding guidelines below
- Run tests:
pnpm test - Commit your changes:
git commit -m 'feat: add amazing feature' - Push to your fork:
git push -u origin feat/amazing-feature - Open a Pull Request:
gh pr createor via GitHub UI
feat/- New featuresfix/- Bug fixeschore/- Maintenance, refactoring, documentation updates
- TypeScript: Use strict typing, avoid
any - ES Modules: Use
.jsextension in imports (even for.tsfiles) - Async/Await: Prefer async/await over callbacks
- Error Handling: Tools should catch errors and return descriptive messages
We follow Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesrefactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Every commit should include a Wingman: trailer to track Codi's assistance:
git commit -m "feat: add amazing feature
This adds the amazing feature for user productivity.
Wingman: Codi <codi@layne.pro>"According to Git conventions, trailers should be placed at the end of the commit message body, after a blank line.
When multiple people (humans or AI) contribute to a commit, use Co-authored-by: trailers:
git commit -m "feat: authentication system
Implement OAuth2 authentication with Google and GitHub providers.
Co-authored-by: Alice <alice@example.com>
Co-authored-by: Bob <bob@example.com>
Co-authored-by: Codi <codi@layne.pro>
Wingman: Codi <codi@layne.pro>"Best practices for multi-author commits:
- Order: Human collaborators first, then other
- Format:
Co-authored-by: Name <email> - Required: Always include
Wingman: Codi <codi@layne.pro>if Codi assisted
feat: add bash command chaining permission check
Address security concern where !echo "?" | pnpm dev --quiet only asked
permission for "echo" but should also ask for "pnpm".
Implementation:
- Added parseCommandChain() to extract individual commands
- Added requestPermissionForChainedCommands() to prompt user
- Modified direct shell handler to check for chained commands
Wingman: Codi <codi@layne.pro>
---
fix: correct clearMessageTokenCache documentation
The function description incorrectly stated it clears all caches.
Actually only clears message token cache.
Co-authored-by: Sarah <sarah@example.com>
Wingman: Codi <codi@layne.pro>
---
docs: update CODI.md with Codi agent capabilities
Add comprehensive section explaining direct tool access and
context awareness features for AI coding assistants.
Wingman: Codi <codi@layne.pro>"
For more information about Codi's capabilities as your AI coding assistant, see CLAUDE.md.
// 1. Create src/tools/my-tool.ts
export class MyTool extends BaseTool {
getDefinition(): ToolDefinition { /* JSON schema */ }
async execute(input: Record<string, unknown>): Promise<string> { /* logic */ }
}
// 2. Register in src/tools/index.ts
registry.register(new MyTool());// In src/commands/my-commands.ts
export const myCommand: Command = {
name: 'mycommand',
aliases: ['mc'],
description: 'Description for /help',
usage: '/mycommand <args>',
execute: async (args, context) => `Prompt for AI: ${args}`,
};
registerCommand(myCommand);- Tests are in
tests/using Vitest - Run all tests:
pnpm test - Run specific test:
pnpm test -- tests/my-test.test.ts - Watch mode:
pnpm test:watch
Some CLI integration tests require a real TTY and are skipped by default:
CODI_RUN_PTY_TESTS=1 pnpm test- Update
README.mdfor user-facing changes - Update
CLAUDE.mdfor AI assistant context and architecture - See
docs/TOOLS.mdfor tool reference - See
docs/ROADMAP.mdfor feature roadmap - Add inline JSDoc comments for complex functions
Codi is dual-licensed under AGPL-3.0 (open source) and a commercial license. See LICENSING.md for details.
By contributing to Codi, you agree that:
- Your contributions will be licensed under the same dual-license terms (AGPL-3.0 / Commercial)
- You have the right to submit the contribution under these terms
- You grant the project maintainers the right to use your contribution in both open source and commercial versions
For significant contributions (new features, major refactors), we may ask you to sign a Contributor License Agreement (CLA) to ensure we can continue offering commercial licenses.
Feel free to open an issue for any questions or suggestions!