Thank you for your interest in contributing to iosm-cli! This guide will help you get started.
- Node.js
>=20.6.0 - npm (bundled with Node.js)
- Git
# 1. Fork and clone the repository
git clone https://github.com/your-username/iosm-cli.git
cd iosm-cli
# 2. Install dependencies
npm install
# 3. Verify setup
npm run check # Type-check
npm test # Run tests
npm run build # Build# Start watch mode for development
npm run dev
# In another terminal, test your changes
node dist/cli.js
# Or link globally
npm link
iosmUse descriptive branch names:
feature/add-tool-xyz
fix/session-persistence-bug
docs/update-cli-reference
refactor/model-registry-cleanup
- TypeScript — All source code is TypeScript
- ES Modules — Use
import/export("type": "module"in package.json) - File extensions — Use
.jsextensions in imports (TypeScript resolves them) - No default exports in library code (except extensions which use
export default)
- Add the argument definition in
src/cli/args.ts - Handle it in
src/main.ts - Update
docs/cli-reference.md - Update
README.mdif the feature is significant - Add tests in
test/args.test.ts
- Create the tool in
src/core/tools/ - Register it in
src/core/tools/index.ts - Export from
src/index.ts - Add tests in
test/tools.test.ts - Update documentation
- Create the extension in
examples/extensions/ - Add an entry to
examples/extensions/README.md - Follow the existing patterns for hooks, tools, or UI
# Full suite
npm test
# Specific file
npm test -- test/tools.test.ts
# Pattern match
npm test -- --grep "session"
# Watch mode
npx vitest --watch- Use Vitest for all tests
- Place test files in
test/with.test.tsextension - Use shared helpers from
test/utilities.ts - Place test fixtures in
test/fixtures/
import { describe, it, expect } from "vitest";
describe("MyFeature", () => {
it("should handle the expected case", async () => {
const result = await myFunction(input);
expect(result).toBe(expected);
});
it("should handle edge cases", async () => {
expect(() => myFunction(null)).toThrow();
});
});- Create a feature branch from
main - Make your changes with clear, focused commits
- Run the checklist:
npm run check # TypeScript type-check npm test # All tests pass npm run build # Build succeeds
- Update documentation if needed
- Open a Pull Request with a clear description
- Respond to feedback from reviewers
## What
Brief description of the change.
## Why
Motivation or issue being addressed.
## How
Technical approach taken.
## Testing
How the change was tested.When reporting issues, please include:
- Node.js version (
node --version) - iosm-cli version (
iosm --version) - Operating system
- Steps to reproduce
- Expected vs actual behavior
- Error messages or logs (if applicable)
By contributing to iosm-cli, you agree that your contributions will be licensed under the MIT License.