首页
44 条评论
simonw超过 2 年前
I've been using this for about six months now and I absolutely love it.<p>Make never stuck for me - I couldn't quite get it to fit inside my head.<p>Just has the exact set of features I want.<p>Here's one example of one of my Justfiles: <a href="https://github.com/simonw/sqlite-utils/blob/fc221f9b62ed8624b1d2098e564f525c84497969/Justfile">https://github.com/simonw/sqlite-utils/blob/fc221f9b62ed8624...</a> - documented here: <a href="https://sqlite-utils.datasette.io/en/stable/contributing.html#using-just-and-pipenv" rel="nofollow">https://sqlite-utils.datasette.io/en/stable/contributing.htm...</a><p>I also wrote about using Just with Django in this TIL: <a href="https://til.simonwillison.net/django/just-with-django" rel="nofollow">https://til.simonwillison.net/django/just-with-django</a>
评论 #34318081 未加载
评论 #34320277 未加载
评论 #34317472 未加载
评论 #34323294 未加载
velcrovan超过 2 年前
One of the listed benefits of just is "Recipes can be listed from the command line."<p>There is a nice trick that gives makefiles this ability: <a href="http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html" rel="nofollow">http://marmelab.com/blog/2016/02/29/auto-documented-makefile...</a><p>Adding .PHONY targets and so forth is a bit inelegant, but I can share a makefile with confidence that any Linux/Mac OS/BSD user can use it without needing additional software, and I will never have to worry about make becoming unavailable or no longer maintained. Just my personal opinion.
评论 #34318344 未加载
评论 #34317820 未加载
评论 #34319088 未加载
评论 #34317412 未加载
评论 #34319984 未加载
评论 #34320413 未加载
评论 #34319662 未加载
评论 #34321541 未加载
评论 #34318296 未加载
l0b0超过 2 年前
If you're going to use it like Make without the build system parts, why not just have a directory of tiny scripts? More portable than either, the only boilerplate is a shebang line, and you can use static analysis tools (shellcheck), formatters (shfmt) and the like.<p>Take the example they've screenshotted in the readme[1]:<p><pre><code> alias b := build
host := `uname -a`
# build main
build:
cc *.c -o main
# test everything
test-all: build
./test --all
# run a specific test
test TEST: build
./test --test {{TEST}}
</code></pre>
The equivalent would just be something like the following:<p>build.bash:<p><pre><code> #!/usr/bin/env bash
set -o errexit
cc *.c -o main
</code></pre>
test-all.bash:<p><pre><code> #!/usr/bin/env bash
set -o errexit
"$(dirname "${BASH_SOURCE[0]}")/build.bash"
./test --all
</code></pre>
test.bash:<p><pre><code> #!/usr/bin/env bash
set -o errexit
"$(dirname "${BASH_SOURCE[0]}")/build.bash"
./test --test "$@"
</code></pre>
If you want to get <i>really</i> fancy you could make a common.bash with safety pragmas and things like the host string.<p>[1]: <a href="https://github.com/casey/just/blob/master/examples/screenshot.just">https://github.com/casey/just/blob/master/examples/screensho...</a>
评论 #34320267 未加载
Ameo超过 2 年前
Huge fan of just; I add a Justfile to pretty muc hevery new repo I create regardless of language or stack.<p>My personal favorite feature is the ability to load environment variables from a `.env` file and set them for all commands run. Just have to add this to the top of your `Justfile` to make it happen:<p>`set dotenv-load := true`
评论 #34318034 未加载
rcarmo超过 2 年前
As someone who _extensively_ uses Makefiles everywhere to speed up things (why bother remembering how to start a server in a particular language when “make serve” will work anywhere), I almost understand why this exists, but then I remember that make is available everywhere and has tab auto completion and I have to wonder why…
评论 #34318058 未加载
评论 #34321489 未加载
评论 #34318010 未加载
评论 #34317272 未加载
评论 #34318808 未加载
评论 #34318098 未加载
评论 #34323075 未加载
kjgkjhfkjf超过 2 年前
This is actually very different than `make`, since it will always run the tasks even if their inputs haven't changed[0].<p>It's a bit bizarre to me that their example involves building code, since that application generally benefits from this "idiosyncratic" behavior of `make`.<p>You probably would want the behavior of `make` for the `test` command too, to avoid running potentially time-consuming tests unnecessarily. Bazel caches test results to avoid this, for example.<p>[0] <a href="https://github.com/casey/just#what-are-the-idiosyncrasies-of-make-that-just-avoids">https://github.com/casey/just#what-are-the-idiosyncrasies-of...</a>
评论 #34320859 未加载
tejtm超过 2 年前
I do love me some make, and have since forever.
but we do have to look for a successor
as cleaning out all of make's historical baggage
would be a disservice to too many (really any is too many).<p>If you are not sure of what I am talking about, try typing<p>`make -p`<p>those builtin rules can be disabled if you are not building
ancient artifacts but that we have to is why one of these
work-a-likes is going to win some day.
rsanheim超过 2 年前
I dig the general idea, but question the value add over a directory of `scripts` that follow sane conventions (ie `script/test`, `script/build` etc). Is the main thing that you can do `just -l` to see available commands? I have never really reached for `make` when I've had a choice, as I've done mostly ruby, JS, or java where you have more sane, humane tools (i.e. Rake, Yarn, Maven though that one is never fun).<p>My general approach is every repo should have something that follows <a href="https://github.com/github/scripts-to-rule-them-all">https://github.com/github/scripts-to-rule-them-all</a>, written in sh (maybe bash, its 2023), linted with shellcheck. When you need something fancy Rake is great or grab some nice bash command line helper and source it from all your scripts. Is a command listing really worth another dependency over what you get from `ls script` or `cat script/README` ?
评论 #34321681 未加载
elliotshep超过 2 年前
If you don't have enough yaml in your life, <a href="https://taskfile.dev/" rel="nofollow">https://taskfile.dev/</a> is excellent.
jacobsenscott超过 2 年前
I use <a href="https://github.com/davetron5000/gli">https://github.com/davetron5000/gli</a> for this, since I work in ruby. Adding something like just or gli to your project is a huge win. Every dev can just `just update_db` to refresh their dev db, `just update_secrets` to update dev secrets. Whatever. So much better than putting snippets in a wiki or whatever.<p>I like gli because it gives you subcommands, like `gli database refresh` etc.
oakesm9超过 2 年前
Another simple tool similar to this is makesure[1]. It’s written in shell so the idea is you include makesure itself in your repo, which avoids needing to install another tool to run commands on your project.<p>It’s very simple so isn’t good for everything, but works well as a simple command runner.<p>[1] <a href="https://github.com/xonixx/makesure">https://github.com/xonixx/makesure</a>
评论 #34322403 未加载
JakaJancar超过 2 年前
Competition: <a href="https://pydoit.org/" rel="nofollow">https://pydoit.org/</a><p>I've been using it for a while and it's pretty flexible:<p><pre><code> - dependencies
- parallelism
- programmatically generated tasks (since the config file is just a Python file)
- "udf" to specify when a task is up-to-date and can be skipped</code></pre>
评论 #34318766 未加载
letmeinhere超过 2 年前
I like the idea of trying to rethink the Make interface, but it just seems like most projects could actually benefit from build targets (conditional execution based on file existence/age), even if it's not the first thing you need to automate. I don't want to give that up because PHONY is confusing.
garganzol超过 2 年前
Nah, just does not support automatic parallelization of the dependency graph. This is a deal breaker for me. Also I'm not a huge fun of a yet another built-in language that tries to mimic a full-featured programming language.
评论 #34318376 未加载
cute_boi超过 2 年前
I have been using Just for 3 months and it is such a fantastic tool. I never looked back at make. I don't even look at npm scripts anymore. I love Just.
gempir超过 2 年前
I don't see anything about including other Justfiles or just generally other file.
Might be nice to split up huge projects.<p>The alternative Taskfile can do that <a href="https://taskfile.dev/usage/#including-other-taskfiles" rel="nofollow">https://taskfile.dev/usage/#including-other-taskfiles</a>
评论 #34322634 未加载
brabel超过 2 年前
It seems to me much nicer choice is <a href="https://taskfile.dev/" rel="nofollow">https://taskfile.dev/</a><p>Just doesn't seem to even support caching task results (by declaring inputs/outputs)?
Sirikon超过 2 年前
Tools like these are handy, for sure. Problem is: If you're collaborating in a project, then you're requiring a new dependency to be installed in everyone's machine.<p>Stuff like `make` is already there, always. In my case, I assume everyone has Python 3 and include a `task` script using this template, which does something similar: <a href="https://gist.github.com/sirikon/d4327b6cc3de5cc244dbe5529d8f53ae" rel="nofollow">https://gist.github.com/sirikon/d4327b6cc3de5cc244dbe5529d8f...</a>
评论 #34318324 未加载
user3939382超过 2 年前
These issues are part of my daily work. I’ve started converting the make targets/commands to shell scripts because the hacks and ugliness that you have to do to provide make with arguments isn’t worth it. It seems like the more advanced shell features you want to use in a makefile, the more make gets in your way.<p>Not that I fault it. It’s supposed to be for making programs hence the name. We’re abusing it by turning into a script collection.
rochak超过 2 年前
My personal favorite for small projects is invoke: <a href="https://www.pyinvoke.org/" rel="nofollow">https://www.pyinvoke.org/</a>. I prefer it with python because it is just another lean dependency I can directly install along with other dependencies. Works pretty well unless you wanna chain and run long shell commands.
评论 #34322307 未加载
peteatphylum超过 2 年前
Another huge fan of just, here. I love that it's installable with a one-liner and I've added this as an option to my dotfile setup.<p>I'm done trying to cast spells at Make
xaduha超过 2 年前
Make is firmly in a category of 'better the devil you know' for me. Not that I deeply know it, I use just a subset of it anyway and for that it's fine.<p>If there's was a short <i>Make: The Good Parts</i> O'Reilly book, then I would probably read it.
gregwebs超过 2 年前
Just is designed for running commands, make is designed for tracking dependencies. I use them both in the same project calling each other if need be: there isn’t a competition here.
评论 #34402121 未加载
politician超过 2 年前
I use github.com/TekWizely/run for this use case. It's a robust way to build one-off command-line "APIs" for managing projects and documenting processes. I deploy it in production environments along with application-specific Runfiles for devops.<p>It makes life a lot easier when onboarding new folks, or for remembering how to do something months later.<p>I also use make, but limit it to just building software. All of my repos have a Runfile and a Makefile.
pingwin超过 2 年前
I use make extensively for a company wide build system across most/all products. Normalized everything.<p>Someone at the company introduced Just in their projects. I’ve used it quite a bit now, it’s great EXCEPT that you cannot include other Justfiles. So abstraction is impossible. If I want to implement something like a push feature, that has to be implemented everywhere, with no way to centrally update all projects.
评论 #34325178 未加载
评论 #34331317 未加载
akdor1154超过 2 年前
I've come across this a few times, it seems to cope very well with all the things I'm abusing Make to do. I'm hesitant to add niche tooling requirements to my projects though.<p>Can anyone comment with their experience using this? (in particular the social ramifications)
评论 #34317522 未加载
jbverschoor超过 2 年前
It’s funny how things evolve. This is clearly something similar to make.<p>All sorts of tools use xxxxfile for their config. But the tool “make” it’s actually short for “make file”. That’s what make does, it makes files (and has modified date dependencies)
评论 #34321673 未加载
davidpfarrell超过 2 年前
A tool that I created in the same category:<p>RUN : A Task runner that helps you easily manage and invoke small scripts and wrappers<p>* <a href="https://github.com/TekWizely/run">https://github.com/TekWizely/run</a><p>Do you find yourself using tools like make to manage non-build-related scripts?<p>Build tools are great, but they are not optimized for general script management.<p>Run aims to be better at managing small scripts and wrappers, while incorporating a familiar make-like syntax.<p>Some features:<p>* Auto generates command list<p>* Auto generates help for commands<p>* Supports defining command-line arguments, which are presented in help text<p>* Can be composed via includes<p>* Each command can define its own shell (or even python, etc)<p>If you're interested in task runners, I hope you'll take a look!
0cf8612b2e1e超过 2 年前
What would it take to unseat Make? Make is installed everywhere, so it is really hard for me to justify leaning on new tooling. Make is ok, but it has enough deficiencies that I longingly look at tools like this.
评论 #34318483 未加载
bilekas超过 2 年前
This looks great and the first time I've come across it.. One thing I notice straight away is the incredible amount and quality of the documentation!
transportheap超过 2 年前
the just dev has questionable privacy view, used to copy all Justfiles on github<p>- <a href="https://github.com/casey/just/issues/1163">https://github.com/casey/just/issues/1163</a>
- <a href="https://github.com/casey/just/issues/503">https://github.com/casey/just/issues/503</a>
评论 #34334447 未加载
zackees超过 2 年前
I'm still waiting on a tool that installs an activate.sh/activate.bat file that will bootstrap the tool when it's not installed, and then load up the environmental variables so that clean/build/deploy/test becomes active.<p>Manually installing stuff sucks. It should be cross platform, automated and local by default whenever possible.
domenukk超过 2 年前
There is also cargo make which, at least in rust land, serves a similar purpose.
<a href="https://github.com/sagiegurari/cargo-make">https://github.com/sagiegurari/cargo-make</a><p>I ended up using it over just because it felt easier to use cross platform, and toml seemed like a right choice
paxys超过 2 年前
This looks incredibly useful. Random question since I couldn't find it in the README – can i define a recipe (or recipe list) in a common location in my home folder and then use them from anywhere? While having a per project config is the intended use case, I'd also like a bunch of global ones.
评论 #34319723 未加载
评论 #34319090 未加载
throwawaaarrgh超过 2 年前
Make is acceptable for running arbitrary bunches of commands. For anything grander, I just write shell scripts that call shell scripts. Once you know shell well, it's <i>very</i> easy to throw together a simple build system. For a complex build system I'd go find a complex build tool.
xwowsersx超过 2 年前
The manual appears to be busted. The installation docs at <a href="https://just.systems/man/en/chapter_2.html#installation" rel="nofollow">https://just.systems/man/en/chapter_2.html#installation</a> just (ha) shows an empty page.
评论 #34317158 未加载
评论 #34317129 未加载
_jcrossley超过 2 年前
Hey, this is really cool! Coincidentally I’ve been doing something really similar with `alias j=‘make -f ~/Makefile’` for a single giant makefile across multiple projects; I also combine it with fzf to allow fuzzy-searching for target names.
shashashasha___超过 2 年前
For rust cargo-make is also pretty good and got lots of cool rust specific features
<a href="https://github.com/sagiegurari/cargo-make">https://github.com/sagiegurari/cargo-make</a>
(just is written in rust)
hestefisk超过 2 年前
How is this different to a shell script / command alias?
评论 #34317921 未加载
评论 #34318905 未加载
Dowwie超过 2 年前
Has anyone got a just recipe for looping through commands using a list of strings as inputs?
AviationAtom超过 2 年前
That README is quite the novel. I guess I prefer overly verbose documentation to under though.
llIIllIIllIIl超过 2 年前
Great project, 40 years late though.
dusted超过 2 年前
Smells like
alias just=make