Skip to content

Latest commit

 

History

History
121 lines (97 loc) · 4.03 KB

File metadata and controls

121 lines (97 loc) · 4.03 KB

Contributing to iTwin CLI

Welcome, and thank you for your interest in contributing to the iTwin CLI! 🚀
There are many ways to contribute, from reporting bugs and suggesting improvements to submitting pull requests.


Providing Feedback & Reporting Issues

Your feedback is essential to improving the iTwin CLI. If you've found a bug or have a feature request, please report it.

1. Check for Existing Issues

Before creating a new issue, search the open issues to see if it has already been reported. If you find a similar issue:

  • 👍 Upvote to indicate you're also experiencing it.
  • 💬 Add relevant comments to provide more context.

If no existing issue matches your problem, create a new issue.

2. Submitting a Good Bug Report

To help us reproduce and resolve the issue efficiently, include:

  • A clear title and description
  • Steps to reproduce the issue
  • Expected vs. actual behavior
  • Screenshots, logs, or error messages (if applicable)
  • CLI version and environment details

Open an Issue


Contributing Code

We’d love to accept your contributions! Follow these steps to get started:

1. Set Up Your Development Environment

Clone the Repository

git clone https://github.com/itwin/itwin-cli.git
cd itwin-cli

Setup Test Environment

  • Create .env file in the project root and put the following environment variables into it:
ITP_ISSUER_URL=https://ims.bentley.com
ITP_API_URL=https://api.bentley.com
# Your service client, created in the same environment as the provided API and IMS URLs.
ITP_SERVICE_CLIENT_ID=
ITP_SERVICE_CLIENT_SECRET=
# Your native client, created in the same environment as the provided API and IMS URLs. 
ITP_NATIVE_TEST_CLIENT_ID=
# Email and password of a test user. (Belonging to an organization is needed by some of the tests)
ITP_TEST_USER_EMAIL=
ITP_TEST_USER_PASSWORD=

Install Dependencies

npm ci

Run the CLI in Development Mode

  • Windows:
    ./bin/dev [command]
  • Linux/macOS (First, make the scripts executable):
    chmod +x ./bin/dev.js
    ./bin/dev.js [command]

2. Create a Branch

git checkout -b [your-username]/your-feature-name

Example:

git checkout -b johndoe/add-auth-command

3. Make Your Changes

  • Follow existing code patterns and structure.
  • Write clear commit messages.
  • If you add a new command or modify documentation, run the following command to ensure commands and documentation are synchronized:
    npm run docs-generator

4. Commit Your Changes

git commit -m "Add detailed description of your changes"

5. Push Your Branch

git push origin [your-username]/your-feature-name

6. Submit a Pull Request


Contributor License Agreement (CLA)

A Contributor License Agreement with Bentley must be signed before contributions can be accepted. Upon opening a pull request, you will be prompted to use cla-assistant for one-time acceptance.


Best Practices

Write Clear Commit Messages – Describe what your change does and why.
Keep Pull Requests Focused – One issue per PR makes reviews easier.
Follow Code Standards – Match the project’s formatting and structure.
Stay Engaged – Monitor your PR for feedback and respond to requested changes.


Support & Questions

Thank you for helping improve the iTwin CLI! 🚀