Adding command line scripts to path when installing packages?

What’s the easiest way to add a julia script to a users path when they install a package? I’m wondering if there is a equivalent to entry_points in pythons setup.py

1 Like

I would package the script as a function in the eponymous module and just have the user do

import ThatPackage; ThatPackage.do_stuff()
1 Like

Yeah I’m looking for something more friendly for developing CLI’s. Say a user adds a package in the REPL

(@v1.4) pkg> add MyPackage

Typically you’d have to run something like.

julia <some long path to file>/cli.jl --some-flag 'hello' arg1 arg2

It’s all abit awkard. In python land once a user has run pip install my_package. Theres a mechanism to add the script to their path with an alias so you can then just run.

my-cli --some-flag 'hello' arg1 arg2
1 Like

I am not sure this is what you are looking for. In HPC it is common to use Modules

2 Likes

Hey yeah something like this could help if it allows me to permanently modify the users PATH then I could use it when build.jl runs. Not sure how I’d clean up thought when the package is uninstalled…

Maybe what I wrote wasn’t clear — the call would be

julia -e 'import ThatPackage; ThatPackage.do_stuff(ARGS)'

or similar. No paths, when the package is in the global environment.

If even that is too complicated, you can hide it in a bash script.

2 Likes

Comonicion is what is was looking for :slight_smile:

2 Likes