Contributing
We're thrilled that you're interested in contributing to @aigne/cli! Your help is invaluable in making the AIGNE development experience better for everyone. Whether you're fixing a bug, proposing a new feature, or improving documentation, your contributions are welcome.
This guide provides instructions for setting up your development environment, running tests, and submitting your changes.
Getting Started#
The @aigne/cli package is part of the aigne-framework monorepo. To get started, you'll need to clone the main repository and install its dependencies.
1. Clone the Repository#
First, clone the aigne-framework repository from GitHub to your local machine:
Git Clone
git clone https://github.com/AIGNE-io/aigne-framework.git
cd aigne-framework2. Install Dependencies#
We use bun as the primary package manager for the project. Install all the necessary dependencies from the root of the monorepo:
Bun Install
bun installThis will install all dependencies for every package in the monorepo, including @aigne/cli.
Development Workflow#
All development commands for the CLI should be run from within its package directory: packages/cli.
Building the Code#
To compile the TypeScript source code from src/ into JavaScript in the dist/ directory, run the build command. This process is configured by tsconfig.build.json.
Build Command
bun run buildLinting and Type Checking#
We use the TypeScript compiler to perform static analysis and ensure code quality. To check for any type errors without emitting JavaScript files, run the lint command:
Lint Command
bun run lintRunning Tests#
We have a comprehensive test suite to ensure the CLI functions correctly. The following scripts are available for testing:
Command | Description |
|---|---|
| Executes the complete test suite, including tests for the CLI source ( |
| Runs only the unit and integration tests for the CLI's core functionality. |
| Runs tests specifically for the project templates scaffolded by |
| Runs the entire test suite and generates a code coverage report. |
It's important to ensure all tests pass before submitting a pull request.
Code Style#
We use Prettier to maintain a consistent code style across the project. Please ensure your code is formatted before committing your changes. Most editors can be configured to format files automatically on save.
Submitting a Pull Request#
Once you've made your changes and verified them with the build and test scripts, you're ready to submit a pull request.
- Fork the repository on GitHub.
- Create a new branch for your feature or bug fix:
git checkout -b your-feature-name. - Commit your changes with a clear and descriptive commit message.
- Push your branch to your fork:
git push origin your-feature-name. - Open a pull request from your fork to the
mainbranch of theAIGNE-io/aigne-frameworkrepository. - Provide a detailed description of your changes in the pull request, referencing any related issues from the issue tracker.
We'll review your contribution as soon as possible. Thank you for helping us improve AIGNE!