This document explains how to participate in Copilot Shell development.
- Node.js ≥ 20
- npm ≥ 9
- Git
git clone https://github.com/alibaba/anolisa.git
cd src/copilot-shellmake depsThis runs npm install and initializes Husky Git hooks.
make buildBuild uses esbuild; output goes to each package's dist/ directory.
# Run the build output directly
node packages/cli/dist/index.js
# Or use npm script
cd packages/cli && npm startmake lintIncludes ESLint and type checking.
The project uses Prettier for code formatting. Save-on-format in your editor, or run manually:
npx prettier --write .make testTesting framework is vitest. Test files are co-located with source code,
named *.test.ts.
| Package | Path | Responsibility |
|---|---|---|
@copilot-shell/cli |
packages/cli/ |
CLI entry and TUI |
@copilot-shell/core |
packages/core/ |
Core engine |
@copilot-shell/test-utils |
packages/test-utils/ |
Test utilities |
- Uses ESM (
"type": "module") - Exports unified through each package's
src/index.ts - Type declarations separated from implementation (
types.ts)
Follow the project root's commit conventions with scope cosh:
feat(cosh): add --json flag to config command
fix(cosh): handle empty model response gracefully
Ensure the following pass before each commit:
make lint
make testHusky pre-commit hook automatically runs lint checks.
- Create a command file under
packages/cli/src/commands/ - Implement the
Commandinterface - Import and register at the command registry
- Add corresponding unit tests
- Create a tool definition under
packages/core/src/tools/ - Implement the tool's
executemethod - Register in the tool registry
- Add approval classification (which modes require confirmation)
- Write integration tests
- Define the event type in
packages/core/src/hooks/ - Implement the event's input/output schema
- Trigger the event at the appropriate point in the agent loop
- Write unit tests
- Update Hook development documentation
Integration tests are located in the integration-tests/ directory:
# Run all integration tests
cd integration-tests && npm test
# Run specific tests
npx vitest run integration-tests/hooks/Releases are automated via the /cosh-dev release skill:
- Update version number
- Generate CHANGELOG
- Build and verify
- Create Git tag
- Push to remote