-
Notifications
You must be signed in to change notification settings - Fork 101
Ship a CLI for Pkg.jl #1230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Ship a CLI for Pkg.jl #1230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI - this file is 99% a git mv
of the src/bin/julialauncher.rs
. If you look in the git history you can see this, but for some reason, Github displays it as a new file.
@davidanthoff Any idea what these CI errors might be from? It seems it is not deterministic |
@fredrikekre might be a good reviewer from a product perspective here? |
Cool! Maybe too early for bike shedding but I'm not personally a fan of the name jlpkg. Can I suggest either:
I think I prefer the latter personally. |
Yes please! Note I also discuss the motivations in JuliaLang/julia#59370. I think the main benefit of putting jlpkg into juliaup is that you get to use the same code for managing the underlying Julia binary and channel, and don't need a separate install step. For example: juliapkg +1.10 test Is basically identical to This is equivalent at a low level, because this Line 519 in f283646
P.S., we also get shell completions for every shell which is an added benefit of putting the command spec in clap: > juliapkg completions --help
Generate shell completion scripts
Usage: juliapkg completions <SHELL>
Arguments:
<SHELL> [possible values: bash, elvish, fish, nushell, power-shell, zsh]
Options:
-h, --help Print help |
I am a fan of juliapkg, I like that it fits the pattern of "julia update" => juliaup; "julia package" => juliapkg. Though I think |
I renamed it to |
Btw, regarding
I think the naming semantics aren't quite right: I prefer your |
|
I merged the latest changes from #1232 to this branch just FYI |
Shouldn't this just be an app in Pkg perhaps? |
Maybe? However, note that there are a few julia flag defaults that are inconvenient for a Pkg.jl session. The The other drawback is a Pkg app would miss out on clap.rs-generated shell completions. If Pkg apps eventually reach feature parity for these things, then a |
As the Pkg apps interface matures, one possibility could be for It also seems there might still be advantages to having a dedicated command installed by |
This PR adds a
juliapkg
binary shipped with juliaup that provides a shell CLI for Julia's Pkg manager. See JuliaLang/julia#59370 for the motivation and proposal.I realized it's actually fairly simple to implement this in juliaup, because you get:
+1.11
,+release
, etc.)julia
andjuliaup
commandsTo try it out, run the following:
Here are some usage examples (again, this is just Pkg.jl REPLMode):
Here's the full clap.rs help menu:
The implementation is quite simple since it borrows much of the logic from
julialauncher.rs
, and then forwards the user-provided commands toPkg.REPLMode.pkgstr
. This means there is minimal maintenance burden and it automatically stays in sync with Pkg.jl!