Pyrevit CLI explaination

Hello pyreviteers!

I have been working these past months building my companies extensions for the varies disciplines’ we have. I have built a solid set of tools. Some I built and others I have grabbed from various other projects.

I have started “integrating” this into the pyrevit ecosystem. Mainly allowing users to control what extensions they see via the pyrevit extension manager. Before I was using the custom add folder location for the extensions. To expand on this. When updating my tools I have built a .bat file that deletes the extensions locally on the c drives and then copies the repository from our server. This works well and ensures users get the most up to date tools.

Now we are about to roll this out company wide and we have hit a snag. My IT department wants to package this a single install file.

So I have spent some time reading about the CLI and distributing to a team. I am just lost at where to start. I watched the youtube video about the CLI and and I could along a little.

In my journey so far I have learned I work best when I have something to reverse engineer. So I have some general questions to maybe help me understand the process a bit.

We have a couple of items here. We have pyrevit, my extensions, the need to disable some pyrevit tools(something about great power comes great something…).

From my readings I understand the CLI can handle all of this. My question is how?

Does the CLI generate a install file? Does that install file have pyrevit and my extensions baked in? does it pull from a repository that I can update? Every time I make changes to my extensions do I need to build a new CLI file or does it pull from my repository?

I have limited coding experience and no understanding of how install files are built.

Any help is appreciated.

Hey @Bmoreawesom3 ,

I think all you really need is here Notion – The all-in-one workspace for your notes, tasks, wikis, and databases.

If I reverse engineer your train of thoughts, I would:

  1. Fork pyrevit repo from github
  2. edit that fork to rearrange pyrevit base tools as required
  3. install pyrevit from that forked and modified repo of pyrevit using CLI (you would need to get the pyrevit CLI installed first) and the pyrevit clone ... function then pyrevit attach ... _ use the --help argument after both function to get the explaination on how they work
  4. then pyrevit extend to add your extension from a github repo (the git can be private and you would use a token to get it installed) (along these lines an old conversation Install and update pyRevit extension from a private repo - #23 by giused8)
  5. finally to make sure your extension is always up to date on everybody’s computer your can write something like this in the startup.py file of your extension
# -*- coding: UTF-8 -*-

import os

os.system('cmd /c "pyrevit extensions update YourExtensionName --token="yourGithubToken""')

image

2 Likes

@Jean-Marc Thank you for your response. I will read more into this.

@Jean-Marc You know it would be really awesome…If you did something like this for CLI. haha

Side question though, in using CLI, is github required?

@Bmoreawesom3 There is already some documentation made by Ehsan all over the place. And for the CLI, it is pretty clear imho. But if you are willing to pay me to create something more detailed ;)…
Joke aside, I don’t know ig a github account is required, I don’t think so as long as your repo are public and you provide the .git address. For private repo on other platform like gitlab the authentification process might be slightly different → CLI might not work, but you would have to try.