Open the Simulink models changed in a pull request β automatically, straight from the PR link.
Reviewing model-based (Simulink) pull requests by hand is repetitive: open the PR, read the diff, figure out which .slx / .sldd files changed, find each one in your local workspace, and open them one by one in MATLAB.
Automation OpenPR turns that whole routine into a single command. Give it a pull request URL and it opens every changed Simulink model (.slx) and data dictionary (.sldd) for you, ready to review.
| Step | Manual | With Automation OpenPR |
|---|---|---|
| Find changed models | Read the PR diff, file by file | Done for you |
| Locate them locally | Navigate the workspace by hand | Resolved from your repo path |
| Open in MATLAB | One model at a time | All of them at once |
| Effort per review | Several manual steps | openpr <pr_url> |
- Uses the GitHub CLI (
gh) to fetch the pull request and list its changed files. - Filters for Simulink artifacts (
.slx,.sldd). - Opens each one in MATLAB from your configured local repository path.
- Python 3.6+ β https://www.python.org/
- GitHub CLI (
gh) β https://cli.github.com/ - MATLAB (with Simulink)
- Access to the target GitHub repository
Replace the placeholders (
<...>) with your own values.
1. Install Python and the GitHub CLI (links above).
2. Authenticate the GitHub CLI:
gh auth loginFollow the prompts and complete the browser flow when asked.
3. Confirm the tools are available β in Git Bash:
gh --version
python --versionIf both print a version, you're good to go.
4. Configure your local path β open local_config.py and set the path to your local model repository.
Run the script with a PR URL:
python /c/<your-path>/script.py <your_pr_url>Create an alias so you can call it from anywhere. In Git Bash:
nano ~/.bashrcAdd this line:
alias openpr='python /c/<your-path>/script.py'Save (Ctrl + O, then Enter) and exit (Ctrl + X), then reload:
source ~/.bashrcNow you can simply run:
openpr <your_pr_url>Enjoy! π
Model-based design reviews happen constantly, and the manual "find-and-open" step adds friction to every one of them. Automating it keeps the reviewer focused on the models, not on hunting for files around them β saving time on every single PR.