`jlpkg` -- a command line interface to Pkg

Quick update with things that has been added since the initial release

Bash completion

The only thing that I have found annoying when using jlpkg compared to the real Pkg REPL is tab-completion. jlpkg now provides Bash completion. It completes the CLI switches, the Pkg REPL commands (including options), and also some more fancy things. Here are some examples:

After the project flag, the completion filters out any paths that is not a directory or a toml file:

$ ls
A  file.jl  Project.toml

$ jlpkg --project=<TAB>
A/            Project.toml

The add command completes packages found in installed registries:

$ jlpkg add Exa<TAB>
ExactDiagonalization  ExactPredicates       ExactReals            ExactWrightFisher     Example

Any command that acts on packages in the current project completes only those, in project/manifest mode as appropriate:

$ pkg status <TAB>
Example  JSON     

$ pkg status --manifest <TAB>
Dates    Example  JSON     Mmap     Parsers  Printf   Unicode

The completion has been written with compatibility with Bash 3 in mind, to properly function on macOs too.

Alternative installation methods

See the README, in addition to installing from Julia you there are now two additional methods:

  1. Tarball download: You can now download jlpkg from GitHub releases and unpack in some folder on PATH. With this methods you don’t have to start Julia nor add the jlpkg Julia package:

    $ curl -fsSL https://github.com/fredrikekre/jlpkg/releases/download/v1.3.2/jlpkg-v1.3.2.tar.gz | \
      tar -xzC ~/bin
    
  2. asdf package manager: You can install and update jlpkg using the asdf version manager using the asdf-jlpkg plugin. See the plugin README for details. This is probably mostly useful if you use asdf for other things, for example for managing Julia version.

New CLI options

There are some nice new CLI options:

  • The --julia flag can be used for specifying the Julia binary. This is sometimes useful if you want to repeat something for multiple Julia versions, for example:

    $ for julia in julia10 julia11 julia12 julia13 julia14 julia15; do
        jlpkg --julia=$julia test Example
    done
    
  • The --offline flag can be used to enable Pkg’s offline mode.

13 Likes