Skip to content

mi-erasmusmc/launchPro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

launchPro

launchPro is a small Python CLI for opening local Positron or RStudio projects, optional Shiny project folders, and project GitHub pages from a single command.

Current version: 0.1.5

Requirements

  • Python 3.9 or newer
  • A local project folder
  • An .Rproj file only when opening the project in RStudio
  • Windows, macOS or Linux

Setup

The recommended way to install launchPro is using pipx, which installs the package in an isolated environment and automatically manages your PATH.

Using pipx (Recommended)

git clone https://github.com/mi-erasmusmc/launchPro
cd launchPro
pipx install .

Run the CLI

Show help:

launch --help

Register a project first:

launch register MyProject ~/Documents/my-project - https://github.com/your-org/my-project
launch register MyStudy ~/Documents/my-study ~/Documents/my-study/inst/shiny/App https://github.com/your-org/my-study --app rstudio

Then open the main project folder:

launch MyProject -p

Open the same project in RStudio:

launch MyProject -p --app rstudio

Open the Shiny project and GitHub page:

launch MyStudy -s -g

Open the project folder in a terminal:

launch MyProject -t

If no flag is provided, launch uses the registered app for that project, or Positron when no project default was saved:

launch MyProject

Choose the project application explicitly with --app positron or --app rstudio.

Register a New Project

Add or update a project entry in the app-data projects.json:

launch register MyProject ~/Documents/my-project - https://github.com/your-org/my-project

Save a default project application while registering:

launch register MyProject ~/Documents/my-project - https://github.com/your-org/my-project --app rstudio

Use - when the project does not have a Shiny folder. If it does, pass the Shiny directory instead:

launch register MyStudy ~/Documents/my-study ~/Documents/my-study/inst/shiny/App https://github.com/your-org/my-study

Notes

  • Paths may use ~ and environment variables.
  • Positron opens the project or Shiny folder as a workspace target, even when that folder does not contain an .Rproj file.
  • RStudio still requires the target folder to contain exactly one .Rproj file.
  • On macOS, -t targets the active terminal app instead of falling back to Terminal.app. Terminal, iTerm2, and Alacritty are supported.
  • On macOS, the Alacritty path uses Accessibility-driven keystrokes for the active window and falls back to alacritty msg create-window --working-directory ... if needed.
  • On macOS it opens project files in the selected app with open -a.
  • On Linux and Windows it looks for the selected positron or rstudio executable in PATH.
  • On Linux, terminal detection includes gnome-terminal, konsole, xfce4-terminal, alacritty, and kitty.
  • For local development without installing, run ./launch ... from the repository root.

License

This project is licensed under the Apache License 2.0. See LICENSE for the full text.

About

Python CLI for opening local RStudio projects

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages