Zulip Chat Archive
Stream: lean4
Topic: lake CLI add dependency
Jakob von Raumer (Sep 24 2024 at 10:50):
Is there a way to add a dependency to a project via the command line? Like what lake new ... math
does, but with math
generalized to an arbitrary dependency?
Kim Morrison (Sep 24 2024 at 12:22):
No, you need to edit your lakefile.toml/lean.
Jakob von Raumer (Sep 24 2024 at 12:26):
Thanks (this is not about manual edits but about generation of Lake projects by a script, so would have been nice if we could have just called the command line tool instead of writing around in the lakefile.lean
..)
Kim Morrison (Sep 24 2024 at 12:30):
I agree! lean#5453
Sebastian Ullrich (Sep 24 2024 at 15:33):
(for a very generic solution, yq
can edit TOML files programmatically)
Jakob von Raumer (Sep 24 2024 at 16:06):
Is lakefile.lean
still valid TOML? :thinking:
Henrik Böving (Sep 24 2024 at 16:09):
No you are supposed to rewrite the file to TOML/Lean or use lake translate-config
if possible
Jakob von Raumer (Sep 24 2024 at 16:34):
Thanks, that didn't know translate-config
!
Kim Morrison (Sep 24 2024 at 22:24):
Hopefully by the next release (depending on how @Mac Malone prioritises things) new projects will all start out with a TOML and life will start getting simpler from there.
Jakob von Raumer (Sep 25 2024 at 08:47):
Im out of the loop here: Didn't we switch from .toml to .lean in the earlier days of Lake for some reason? (Or was that even before Lake was a thing?)
Patrick Massot (Sep 25 2024 at 08:58):
You can still use lakefile.lean
for really complicated projects.
Last updated: May 02 2025 at 03:31 UTC