# Adding command line scripts to path when installing packages?

**URL:** https://discourse.julialang.org/t/adding-command-line-scripts-to-path-when-installing-packages/43414
**Category:** General Usage
**Tags:** question
**Created:** [July 21, 2020, 4:37am UTC](https://discourse.julialang.org/t/adding-command-line-scripts-to-path-when-installing-packages/43414 "2020-07-21T04:37:28Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![onetonfoot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/onetonfoot/32/2697_2.png) [@onetonfoot](https://discourse.julialang.org/u/onetonfoot)
#### Post date: [July 21, 2020, 4:37am UTC](https://discourse.julialang.org/t/adding-command-line-scripts-to-path-when-installing-packages/43414/1 "2020-07-21T04:37:28Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [July 21, 2020, 6:03am UTC](https://discourse.julialang.org/t/adding-command-line-scripts-to-path-when-installing-packages/43414/2 "2020-07-21T06:03:50Z")

</div>

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

```julia
import ThatPackage; ThatPackage.do_stuff()

```

---

<div class="post-metadata">

### Author: ![onetonfoot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/onetonfoot/32/2697_2.png) [@onetonfoot](https://discourse.julialang.org/u/onetonfoot)
#### Post date: [July 21, 2020, 6:18am UTC](https://discourse.julialang.org/t/adding-command-line-scripts-to-path-when-installing-packages/43414/3 "2020-07-21T06:18:10Z")

</div>

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

```julia
(@v1.4) pkg> add MyPackage

```

Typically you’d have to run something like.

```julia
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.

```julia
my-cli --some-flag 'hello' arg1 arg2

```

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [July 21, 2020, 6:20am UTC](https://discourse.julialang.org/t/adding-command-line-scripts-to-path-when-installing-packages/43414/4 "2020-07-21T06:20:51Z")

</div>

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

> **[Environment Modules](https://modules.sourceforge.net/)**
>
> The official web page for the Modules software package. The Modules package provides for the dynamic modification of a user's environment via modulefiles.

> **[Environment Modules Using Lmod » ADMIN Magazine](https://www.admin-magazine.com/HPC/Articles/Environment-Modules-Using-Lmod)**
>
> The indispensable Lmod high-performance computing tool allows users to control their build and execution environment.

---

<div class="post-metadata">

### Author: ![onetonfoot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/onetonfoot/32/2697_2.png) [@onetonfoot](https://discourse.julialang.org/u/onetonfoot)
#### Post date: [July 21, 2020, 6:44am UTC](https://discourse.julialang.org/t/adding-command-line-scripts-to-path-when-installing-packages/43414/5 "2020-07-21T06:44:14Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [July 21, 2020, 6:48am UTC](https://discourse.julialang.org/t/adding-command-line-scripts-to-path-when-installing-packages/43414/6 "2020-07-21T06:48:34Z")

</div>

> [@onetonfoot](#):
>
> Typically you’d have to run something like.
> 
> ```julia
> julia <some long path to file>/cli.jl --some-flag 'hello' arg1 arg2
> 
> ```
> 
> It’s all abit awkard.

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

```julia
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.

---

<div class="post-metadata">

### Author: ![onetonfoot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/onetonfoot/32/2697_2.png) [@onetonfoot](https://discourse.julialang.org/u/onetonfoot)
#### Post date: [August 18, 2020, 12:40pm UTC](https://discourse.julialang.org/t/adding-command-line-scripts-to-path-when-installing-packages/43414/7 "2020-08-18T12:40:21Z")

</div>

[Comonicion](https://github.com/Roger-luo/Comonicon.jl) is what is was looking for 🙂
