# How to start a repl with command line arguments?

**URL:** <https://discourse.julialang.org/t/how-to-start-a-repl-with-command-line-arguments/71877>\
**Category:** New to Julia\
**Tags:** question, repl\
**Created:** [November 22, 2021, 2:13am UTC](https://discourse.julialang.org/t/how-to-start-a-repl-with-command-line-arguments/71877 "2021-11-22T02:13:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lilith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lilith/32/27492_2.png) [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Post date:** [November 22, 2021, 2:13am UTC](https://discourse.julialang.org/t/how-to-start-a-repl-with-command-line-arguments/71877/1 "2021-11-22T02:13:28Z")

</div>

I want to do this:

```julia
$ julia ?*HelloWorld?*
julia> ARGS
String["HelloWorld"]

```

But I can’t figure out how.

---

<div class="post-metadata">

**Author:** ![magister-ludi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/magister-ludi/32/4003_2.png) [@magister-ludi](https://discourse.julialang.org/u/magister-ludi)\
**Post date:** [November 22, 2021, 6:08am UTC](https://discourse.julialang.org/t/how-to-start-a-repl-with-command-line-arguments/71877/2 "2021-11-22T06:08:35Z")

</div>

The following is not very pretty, but it works:

```julia
julia -i -e "" -- HelloWorld

```

The `-e ""` says “run the contents of the empty string” (which does nothing, but tells the program not to expect a file name after the `--`). The `-i` says “drop into the REPL after running the argument of the `-e`”.  
If I do that, I can do

```julia
julia> ARGS
1-element Vector{String}:
 "HelloWorld"

```
