Install and update pyRevit extension from a private repo

@GooseG replying to your second question first:
the token is produced only for the github admin (or whatever github manager role)
so only once.

my approach today, with my colleagues:

  1. user installs pyrevit (could install pyrevit CLI only but that would require to clone and install pyrevit repo as an extra step (pyrevit clone …)
  2. I get them to run from the command line : pyrevit extend ui extensionName https://github.com/gituser/repoName.git --dest="C:\xxxx" --token= "6984ef654eaf6a54f65ef"

Note that I could have make a bat file to do that and provide them with a 1 click solution, but I tend to enforce the use and knowledge of the command line

  1. then I have the following code in the startup.py script at root of my extension + a button in my toolbar to automatically (or by the push of that button) update the extension content. I also have the reload button from the pyrevit toolbar
# -*- coding: UTF-8 -*-

import os

os.system('cmd /c "pyrevit extensions update extensionName --token="6984ef654eaf6a54f65ef""')

then nothing to worry about, except for the “attach” to new revit version, but luckily, you can just add that to the startup.py script to run the cli : pyrevit attach ...

3 Likes