Adding packages over SSH

I’m distributing a Julia package internal to my company and want an easy workflow for users to add package dependencies to their Julia projects.

I can’t use Pkg for this because the default way of adding non registered packages is:

add https://github.com/orgname/reponame

This uses https, which I can’t use since my organisation requires an additional authorisation flow over https. How can I add a git package dependency using ssh? The following does not work:

add git://github.com/orgname/reponame.git
# ERROR: git://github.com/orgname/reponame.git is not a valid packagename

Providing URIs for ssh used to work with clone, but that no longer works.

And as a follow up, how would I create an internal registry that also works via SSH? i.e. when someone types add MyPackage and MyPackage is in the internal registry, make sure that pulls the repo over ssh.

The correct incantation is:

add git@github.com:orgname/reponame.git

See https://julialang.github.io/Pkg.jl/v1/

You should be able to use ssh in a custom registry by using the correct API commands when creating the registry, here: https://julialang.github.io/Pkg.jl/v1/api/#Registry-API-Reference-1

1 Like

https://julialang.github.io/Pkg.jl/v1/api/#Pkg.setprotocol!

1 Like

Thanks platawiec that solves my immediate problem and thanks also fredriekekre!