16 ms·
Just: Just a Command Runner
- golly_ned 2y agoI've used Just at a workplace on a project I didn't start. It seemed slightly simpler than make when putting together task dependencies. But I couldn't figure out what justifies using it over make.
- qznc 2y agoThe manual lists the reasons why using it over make: https://just.systems/man/en/ https://just.systems/man/en/ The question is if those reasons are convincing to someone. The big advantage of Make is that it is probably already installed.
- erichdongubler 2y ago> The big advantage of Make is that it is probably already installed. ...unless you're on Windows, like me!
- deaddodo 2y agoMake is installed on Windows, if you install Microsoft's C/C++ dev stack (typically via installing Visual Studio). They just use nmake instead of GNU make. They also include Cmake these days, as it's the common cross platform option.
- BeetleB 2y ago> if you install Microsoft's C/C++ dev stack (typically via installing Visual Studio). So I have to install this huge dependency just to use make, when my project is in Python? Way easier to install just :-)
- deaddodo 2y agoYou wouldn't use GNU Make (the thing that comes for "default" on Linux) with Python either. What a weird way to converse.
- BeetleB 2y ago> You wouldn't use GNU Make (the thing that comes for "default" on Linux) with Python either. But people do use Make all the time for Python projects - as a command runner. Pelican projects, for example, come with a Makefile to start the server, publish, etc. The whole point of this submission is that many, many people use Makefiles not for incremental builds, but as a convenient place to store commonly used commands. And just is a better and simpler tool than make for that. If you're on Windows, it's a pain to install make, compared to installing just.
- ttyprintk 2y agoBusybox comes with a vestigial make. I wager git might. Those are both in winget.
- fragmede 2y agoWhat does it offer over bazel?
- peterldowns 2y agoNot making you want to shoot yourself in the head. It does one thing very well, and it has well-written and useful documentation. It literally just runs commands in a convenient way.
- fragmede 2y agohow well does it cache across a build farm?
- peterldowns 2y ago[flagged]
- pdimitar 2y agoDid you miss the part that says "it just runs commands in a convenient way" and "it is not a build system"?
- 12_throw_away 2y agoIt's not a build system, it's a command runner, it is for different use cases
- hgs3 2y agoThe manual states that "just is a command runner, not a build system," and mentions "no need for .PHONY recipes!" This seems to suggest that there's no way to prevent Just from rebuilding targets, even if they are up-to-date. For me, one of the key advantages of using Make is its support for incremental builds, which is a major distinction from using a plain shell script to run some commands.
- klabb3 2y agoMaybe it’s the stacks I’m using, but I’ve always had incremental happen with language-native tooling like `go` or `cargo`. So for me at least, having lazy eval features like that would be an unnecessary increase in scope and complexity. With Just, I can just throw together different commands and it just works cross platform. I love it. I much prefer that than the other way, ie letting language tooling become command runners (looking at you npm). That’s the worst of both worlds.
- hgs3 2y ago> I’ve always had incremental happen with language-native tooling like `go` or `cargo` That makes sense, but for me, Make is incredibly useful for incremental file processing outside of programming. I've written tiny Makefiles that use glob patterns to batch-convert thousands of SVGs into PNGs and WebPs, but only for the modified SVG files. I've used Make to batch-convert modified LaTeX files to PDFs and render modified Blender projects into WebM videos for the web. Rendering videos is very time-consuming, so only rendering modified video files is a huge win.
- guipsp 2y agoIf you need incrementalism, Just is not for you.
- pdimitar 2y agoThe programming languages that I use don't need to be told to not rebuild from scratch so yours is a pretty strange argument.
- BeetleB 2y ago
- badsectoracula 2y ago> You can disable this behavior for specific targets using make’s built-in .PHONY target name, but the syntax is verbose and can be hard to remember. I think this is overstating things a bit. I first read `.PHONY` in a Makefile while i was a teenager and i figured out what it does just by looking at it in practice. Makefiles do have some weirdness (e.g. tab being part of the syntax) but `.PHONY` is not one of them.
- BeetleB 2y agoHaving recipes just for Windows/Linux. Being able to write your recipes in another language. Not having to be in the directory where the Makefile resides. Being able to call a recipe after the current recipe with && syntax. Overall lower mental burden than make. make is very complex. just is very simple. If you know neither of the two, you'll get going much faster with just.
- nucleardog 2y agomake is a build system and has a lot of complexity in it to make it optimal (or at least attempt to) for that use case. just is a "command runner" and functionally the equivalent of packing up a folder full of short scripts into a single file with a little bit of sugar on top. (E.g., by default every script is executed with the CWD being the folder the justfile is in so you don't need to go search for that stackoverflow answer about getting the script's folder and paste that in the top of every script.) If you use just as a build system, you're going to end up reimplementing half of make. If you try and use make as a command runner, you end up fighting it in many ways because you're not "building" things. I've generally found the most value in just in situations where shell is a good way to implement whatever I"m doing but it's grown large enough that it could benefit from some greater organization.
- 12_throw_away 2y ago> search for that stackoverflow answer about getting the script's folder and paste that in the top of every script Ah, a fellow Person of Culture.
- clintonc 2y agoFor me, it's a fit-for-purpose issue. Make is great when you're creating artifacts and want to rebuild based on changes. Just is a task runner, so while there's a notion of dependent tasks, there's no notion of dependent artifacts. If you're using a lot of .PHONY targets in a Makefile, you're mostly using it as a task runner -- it works, but it's not ergonomic. I like that just will search upward for the nearest justfile, and run the command with its directory as the working directory (optional -- https://just.systems/man/en/attributes.html https://just.systems/man/en/attributes.html -- with fallback available -- https://just.systems/man/en/fallback-to-parent-justfiles.html https://just.systems/man/en/fallback-to-parent-justfiles.htm...). For example, I might use something like `just devserver` or `just testfe` to trigger commands, or `just upload` to push some assets -- these commands work from anywhere within the project. My life wouldn't be that different if I just had to use Make (and I still use Make for some tasks), but I like having a language-agnostic, more ergonomic task runner.
- peterldowns 2y agoAs a heavy Just user, I agree with all of this — great answer.
- nrclark 2y agoJust a quick note for interested readers: you don't need to explicitly mark things as .PHONY in make, unless your Makefile lives next to files/folders with the same name as your targets. So unless you had some file called "install" in the same folder, you wouldn't need to have something like ".PHONY: install".
- vbezhenar 2y agoThat's the right thing to do, so you should. Relying on implicit condition of specific file missing in current directory is very wrong IMO.
- metaltyphoon 2y agoThe moment you need to build the same software on windows its already justified IMO
- richie_adler 2y agoFor me is not needing to chain a lot of commands with && to ensure that it fails with the first command that fails. With just, if one of the commands of the recipe fails, it stops.
- deleted 2y ago[deleted]
- bsnnkv 2y agoThis is one of the most important pieces of software in my development stack that "just" gets out of the way and does what it's supposed to do. Also has excellent Windows[1] support so I can take it everywhere! [1]: https://github.com/LGUG2Z/komorebi/blob/master/justfile https://github.com/LGUG2Z/komorebi/blob/master/justfile example justfile on my biggest and most active Windows project- might not seem like a lot but this has probably cumulatively saved me months of time
- guitarbill 2y ago[flagged]
- bsnnkv 2y ago> I get that your project is Windows-only, but many projects aren't. Nit: At this point you're better off starting a separate comment thread since you yourself already know that what you are about to talk about is not what my comment is talking about.
- guitarbill 2y ago> Also has excellent Windows[1] support so I can take it everywhere! Nit: You mentioned it can be used "everywhere". That would be a useful feature! But while it's kinda true, there's some quite big limitations IMO
- 3eb7988a1663 2y agoThe shell can be configured per OS. So, Windows can be set to use PowerShell and Linuxy systems will use sh. From the docs set windows-shell := ["powershell.exe", "-NoLogo", "-Command"] hello: Write-Host "Hello, world!" Few things work seamlessly across platforms, and that does not seem like a huge burden.
- squeaky-clean 2y ago> Wait, by "has excellent Windows support" you mean you have to set it to use Powershell or hope `sh` is installed on I don't get what the problem is here? Do you protest against shebangs too? Why does a build script for a Windows only app need to use sh instead of powershell? I think you're interpreting "excellent windows support" to mean cross platform, and that's not what it means. > So not only do you need just installed, which is yet another dependency, Yeah if you want to use some software, your computer needs that software. That's not a dependency. So we're talking zero dependencies, or one of you absolutely need sh.
- Brianna4962598 2y ago[flagged]
- gurgeous 2y agoWe love just and are using it in all projects now. So great. Our typical justfile has around ~20 rules. Here is an example rule (and helper) to illustrate how we use it in ci: export PATH := justfile_directory() + "/node_modules/.bin:" + env_var('PATH') ci: @just banner yarn install yarn install @just banner tsc tsc --noEmit @just banner lint eslint src prettier --check src @just banner vitest vitest --run @just banner done! banner *ARGS: @printf '\e[42;37;1m[%s] %-72s \e[m\n' "$(date +%H:%M:%S)" "{{ARGS}}" This example is a bit contrived, more typically we would have a rule like "just lint" and you might call it from "just ci". One of the best features is that just always runs from the project root directory. Little things like that add up after you've spent years wrestling with bash scripts.
- alsetmusic 2y ago> Little things like that add up after you've spent years wrestling with bash scripts. Can you please explain what you mean here? I looked at the GitHub examples and wondered why this would be preferable to Bash aliases and functions. I must be missing something.
- ricardobeat 2y agoBash has a thousand pitfalls, and as you accumulate layers of scripting they start compounding. Little things like “what the hell directory is this command actually running from”, parsing input parameters, quoting rules, exit statuses, pipelining, etc. Tools like just provide a very consistent and simple base to start with, and you can always still call a separate script, or drop directly into inline shell scripting.
- jensenbox 2y agoI have been using this for months now - way easier than Taskfile. The parameter injection and passing to commands was the thing that converted me.
- jcalabro 2y agoI've been using just at work and in personal projects for almost a year, and I like it a lot. In particular, its self documentation with `just --list` makes onboarding new folks easy. It's also just a nicer syntax than make.
- mike-cardwell 2y agoI don't have my work laptop to hand to compare, but I usually run "just" to get a list of commands and what they do, rather than "just --list". Hope that saves you 7 key presses going forwards.
- peterldowns 2y agoRunning `just` will invoke the first recipe, so you need to add one that invokes `just --list` for this to work — see https://just.systems/man/en/listing-available-recipes.html https://just.systems/man/en/listing-available-recipes.html and my sibling comment.
- fmbb 2y agoThat seems like the most useless pattern to take from make, especially when you name your tool ”just”. Just what?
- TeMPOraL 2y ago> Just what? "Oh... come on! Just... <waving hands angrily>" Pretty clear to me :).
- deleted 2y ago[deleted]
- layer8 2y agoJust execute.
- Cthulhu_ 2y agoThe same applies to make without arguments though, make what? Grammar / word meaning aside, unknown / missing commands printing the help file or suggestions is a good pattern.
- throwaway743950 2y agoI recently looked at various alternatives to make and landed on https://taskfile.dev/ https://taskfile.dev/ It handles dependencies and conditions well without needing to be a full blown bash expert.
- majkinetor 2y agoI use Invoke-Build[1] everywhere and I highly recommend it. It's cross-platform, uses PowerShell so we have serious programming language in the background and is extremely simple yet powerful: dependencies, integrated help, good defaults for error handling and starting directory, vs code support, DOT charts of task dependencies, incremental task, persistent builds, parallel stuff etc. See example usage here [2] [1]: https://github.com/nightroman/Invoke-Build https://github.com/nightroman/Invoke-Build [2]: https://github.com/majkinetor/mm-docs https://github.com/majkinetor/mm-docs
- no_circuit 2y agoTask is in a similar problem space. Unlike Just which clearly states it is not a build system [1], Task can be told about expected files so tasks can be skipped to avoid unnecessary work [2]. So if your task is to build software, IMO make and the others like Task would be better. If your tasks only care about the success code from a process, and/or are a Rust fan instead of Go, then Just should be fine. Otherwise, for specific use-cases like CI, you are likely already coding in a proprietary YAML/JSON/XML format. [1] https://github.com/casey/just/blob/e1b85d9d0bc160c1ac8ca3bcadb2342ea37e8e9b/README.md?plain=1#L47-L49 https://github.com/casey/just/blob/e1b85d9d0bc160c1ac8ca3bca... [2] https://taskfile.dev/usage/#prevent-unnecessary-work https://taskfile.dev/usage/#prevent-unnecessary-work
- jensenbox 2y agoThe one thing that converted us from Taskfile to Justfile is how it handle parameters injected at instantiation. https://just.systems/man/en/recipe-parameters.html https://just.systems/man/en/recipe-parameters.html just works better for us than https://taskfile.dev/usage/#forwarding-cli-arguments-to-commands https://taskfile.dev/usage/#forwarding-cli-arguments-to-comm... We use Docker Compose for our dev environment and were trying to do something like (notice the extra dash dash for separating the arguments out): task poetry -- add requests django It was not working as we expected for some of the users due to the argument dash dash stuff - they were forgetting due to muscle memory but the following does: just poetry add requests django under the hood it was just calling (the equivalent): docker compose run --rm --build poetry poetry "$@" Just arguments are more ergonomic. This is how just does it: poetry +command: docker compose run --rm --build poetry poetry {{command}}
- lormayna 2y agoI agree with you: I automate many K8S command with task but everytime I forget about the - - Having a better input system will be a great improvement from usability perspective
- trallnag 2y agoCurrently, every few months, I switch between Task and Just. Started with Task, went to Just, now I'm using Task again. Procrastination at its best
- brokegrammer 2y agoI switched from make a while ago because I was using it to run tasks in my Python projects, which doesn't require any of make's build tools. I didn't like make's complicated syntax either. Everything just makes more sense now.
- jascha_eng 2y agoWe recently switched pgai over to just. And are quite happy so far. The hierarchical nature is quite nice: https://github.com/timescale/pgai https://github.com/timescale/pgai
- Traubenfuchs 2y agoWhy use this over .sh files?
- petesergeant 2y agoWhy use .sh files over this?
- al_borland 2y agoFewer tools to manage. It seems like this could also be replaced by some aliases in a .bashrc file. I don't like adding extra dependencies and complicating things if they aren't adding significant benefit. What am I missing here? It seems like an alias with extra steps.
- xigoi 2y agoBecause they don’t require installing a new tool and learning new syntax.
- homebrewer 2y agoWhen this tool becomes as available out of the box as POSIX sh (i.e. practically everywhere, including embedded systems and containers), then this reversed argument will make some sense. I'm willing to bet anything that POSIX sh will still be with us 50+ years from now, and 'just' will be long forgotten by then. You really should have a stronger argument for introducing another dependency into your build process (and onto your developers) than "it has a slightly simpler syntax compared to the industry standard".
- bigstrat2003 2y agoIt's not "slightly simpler", it's massively simpler. Shell scripts are pretty much the worst syntax in existence (barring esolangs that go out of their way to be weird).
- Hackbraten 2y agoWhile shell syntax may be quirky, it absolutely allows you to write scripts that are simple, easy to understand, and maintainable.
- Astronaut3315 2y agoI’ve been happy with Just at our workplace. It lets me focus more on the task at hand instead of Conan / Cmake incantations. It’s consistent, easy to use and maintain, and keeps all relevant operations in one place.
- __MatrixMan__ 2y agoI'm not a fan. It works well for what it is, but what it is is an additional language to know in a place where you probably already have one lying around. Also, like make, it encourages an imperative mode for project tooling and I think we should distance ourselves from that a bit further. It's nice that everybody is on the same page about which verbs are available, but those verbs likely change filesystem state among your .gitignored files. And since they're starting from an unknown state you end up with each Just command prefixed by other commands which prepare to run the actual command, so now you're sort of freestyling a package manager around each command in an ad-hoc way when maybe it's automation that deserves to be handled without depending on unspecified state in the project dir. None of this is Just's fault. This is people using Just poorly. But I do think it (and make) sort of place you on a slippery slope. Wherever possible I'd prefer to reframe whatever needs doing as a build and use something like nix which is less friendly up front, but less surprising later on because you know you're not depending on the outputs of some command that was run once and forgotten about--suddenly a problem because the new guy can't get it to work and nobody else remembers why it works on theirs.
- nerdponx 2y agoI mainly don't understand how Just is any better than a run/ directory full of executable shell scripts.
- zwerdlds 2y agoThat works too. I've done both and I currently use Just because it collects the entrypoints to the project into a single file. This can provide an advantage where there's a bit of interdependence across your entrypoints. E.g: You have a docker container, you might be `run`ning it, `exec`ing it etc. from the same compose-file. So Just gives you the ability to link those shared commands within the same file. Once the entrypoints get too numerous you can either break them into scripts (I do this partially depending on the level of behavioral complexity in the script) or partition your justfiles and import them into a single master.
- pdimitar 2y agoIf that works well for you, use it. I did that for 10+ years and got fed up with having to remember which names I gave to my scripts that month. I gradually evolved my views and that got reflected with the names of the scripts. `just` helped me finally move away from that. Now I have i.e. `just check` in projects in different languages that all do the same thing -- check types and/or run various linters. I can go in a directory and run `just check` and I know I have taken care to have all checks that I want in place. Similarly I can run `just test` and I know I'll have the test suite ran, again regardless of the programming language or framework. Absolutely nothing wrong with a directory full of scripts but I lost patience for having to scan what each does and moved away from them.
- pdimitar 2y agoI love `just` and have adopted it universally in all my projects. For what it does, it gets the job done fantastically. That being said, I found myself needing a tool that builds a DAG of dependent tasks and automatically figures out what can be ran in parallel and what cannot -- obviously you have to spell out all tasks and who depends on what first. Anybody knows such a tool? EDIT: Apparently people did not get the hint that I believe `make` is an over-engineered pile of metric tons of legacy and I'll sooner slash my wrists than to learn it in full. I did mean something ergonomic and easy to read and write. And no I'll never view `make` as such. I tried. Many times. I have better things to do in my life than to memorize exceptions of the exceptions.
- guipsp 2y agoMake?
- pdimitar 2y agoCome on, be serious. If I wanted ancient sh-isms and bash-isms I would have learned make to 100% some 15 years ago. I meant something ergonomic and easy to read and write.
- ofrzeta 2y agoThey are right, though, aren't they? I mean .. if you want something "modern", go ahead and learn Bazel. Make is quite a bit easier to learn, I'd say, and you don't need much (also no shell/bash) to express your DAG dependencies.
- pdimitar 2y agoI'll agree on the DAG bit but I'll never use `make` again and I tried for no less than 10 years (on and off, not 24/7, otherwise I would have learned it long ago indeed). I stay away from `make` almost religiously. Its complications _always_ find a way to creep into your file one day. Always. :( So while they are technically correct and it's my fault for not saying I don't want `make` in the comment up-thread, I don't think my comment deserved the down arrows but oh well, I'll live through it.
- sgarland 2y agoI love just. The main benefit for me at work is that it's much easier to convince others to use, unlike make. I like make just fine, and it's useful to learn, but it's also a very opaque language to someone who may not even have very much shell experience. I've frequently found Makefiles scattered around a repo – which do still work, to be clear – with no known ownership, the knowledge of their creation lost with the person who wrote them, and subsequently left.
- biztos 2y agoI'm hoping for this effect, as more and more I work with people who don't consider `make` the default (or, more often, have never heard of it). But I think the hard part -- for any build system -- is achieving the ubiquity `make` had back in the day. You could "just" type "make" and you'd either build the project, or get fast feedback on how much that project cared about developers.
- soulofmischief 2y agoCan anyone with experience with just and tools like npm/yarn explain if there are any benefits to use just instead of codifying commands into the "scripts" field of the package.json? Commands can also be enumerated. How often would I benefit from just's other features?
- zemo 2y agopackage.json is specific to node projects, just can be used for anything. Why learn the quirks of something you can only use with a single programming language? I'm also a fan of the shebang recipes: https://just.systems/man/en/shebang-recipes.html https://just.systems/man/en/shebang-recipes.html
- soulofmischief 2y agoI place package.json files into non-node projects all the time just for some organizational benefits like workspaces and scripts. As a web-first engineer this doesn't particularly bother me. I'll check out shebang recipes, thanks!
- lolinder 2y agoWe don't use Just, but we have a Makefile that doesn't take advantage of any of Make's dependency features just to easily be able to run several commands in sequence. JSON is just a really bad format for script configuration—you either have to string commands together on one big line with && or you have to pair package.json with some other strategy for organizing commands. That may end up being a `scripts` directory with a file per script, it could be that you use a framework that bakes all the complexity into shorter wrapper commands (a la vite), or you could use something like Just to sequence them.
- soulofmischief 2y agoIt's not perfect but it gets the job done. Sometimes it's ugly but in the end it forces me to break commands down into subcommands, which can increase clarity. But sometimes you do have to write a collection of script files for complex multi-line scripts. I assumed I would still do that with just? Is the idea for these to all live in a single just file? I like having larger programs separated as individual files. All good points, though. I like make too, but it can definitely be needlessly verbose. My main thing would be not wanting to need users to have another binary installed locally. Can just live in my repository? Edit: Nevermind! https://just.systems/man/en/nodejs-installation.html https://just.systems/man/en/nodejs-installation.html > `just-install` will install a local, platform-specific binary as part of the npm install command. This removes the need for every developer to install just independently using one of the processes mentioned above.
- sunshine-o 2y agoI love just, this is such a great piece of software. I was thinking the other day: why don't we use just instead of Dockerfiles to define containers?
- diimdeep 2y agoJust use programming language to build itself, it is even possible with C [0] [0] https://github.com/tsoding/nob.h https://github.com/tsoding/nob.h If it is painful, ditch that language.
- throwaway984393 2y ago[dead]
- gurgeous 2y agoQuestion - mise is also incorporating a command runner. Anyone tried it yet? We love just, of course. Always curious about new tools.
- hv42 2y agomise tasks (https://mise.jdx.dev/tasks/ https://mise.jdx.dev/tasks/) are great! IMO, mise tasks are much better than `just`. A few things that make mise superior: — solid environment variables support — can run tasks in parallel, has a watch task feature, support for skipping tasks,… — mise supports file tasks (i.e., running shell scripts, as many comments are suggesting here - https://mise.jdx.dev/tasks/file-tasks.html https://mise.jdx.dev/tasks/file-tasks.html) — mise tasks are defined using `toml`, and not a custom syntax
- drewbitt 2y agoI started writing my tasks in mise (https://mise.jdx.dev/tasks/ https://mise.jdx.dev/tasks/) instead of just, but I found that others didn’t want to install it. Something about mise being an all-in-one tool—combining asdf/direnv/virtualenv/global npm/task management—made installing it just for the task feature off-putting. At least that's my theory. So, I’m back to using just. I am happy that there isn't a ton of pushback on adding a justfile here and there. Maybe it’s the name—‘just’ feels lightweight and is known to be fast, so people are cool with it.
- byproxy 2y agoI'm starting to use `mise` for tooling management and task running on greenfield projects, myself. Anything you feel `just` does better with regards to running tasks?
- jdxcode 2y ago(author of mise) The biggest advantage just has is that it's been around longer, in mise tasks only came out of experimental like a month ago. mise tasks themselves are stable, but there are still experimental things and some portions that need to be used more—like windows. That said, most of the stuff that needs polish are features just doesn't even have. I had a look at the top issues for just and pretty much all of them I've handled in mise: https://github.com/casey/just/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc https://github.com/casey/just/issues?q=is%3Aissue+is%3Aopen+... here's my unashamedly biased thoughts on why I like mise tasks compared to just: * tool integration - this is the obvious benefit. If you run `mise run test` on CI or wherever it'll setup your toolchains and wire them up automatically * parallel tasks - I saw this as table-stakes so it's been there since the very beginning * flags+options - mise tasks are integrated with usage (https://usage.jdx.dev https://usage.jdx.dev) which provides _very_ comprehensive CLI argument support. We're talking way more than things like flags and default options, as an example, you can even have mise tasks give you custom completion support so you can complete `mise run server --app=<tab><tab>` * toml syntax - it's more verbose, but I think it's more obvious and easier to learn * file sources/outputs - I suspect just doesn't want to implement this because it would make it more of a "build tool" and less of a "task runner". I chose to despite having the same position that mise tasks is also not a "build tool". Still, I think even in the world of running tasks you want to only run things if certain files changed often. * `mise watch` - this is mostly just a simple wrapper around `watchexec -- mise run ...` for now, but it's an area of the codebase I plan to focus on sometime in the next few months. Still, even as a simple wrapper it's a nice convenience. * "file tasks" - in mise you can define tasks just by being executable and in a directory like "./tasks". This is great for complex scripts since you don't also need to add them to mise.toml. I have not used just very much, but I did go through the docs and there are a handful of things I like that it definitely does better: * help customization - it looks like you can split tasks into separate sections which is nice, I don't have that * invoking multiple recipes - I don't love how this is done in mise with `mise run task1 ::: task2` but I _also_ wanted to make it easy to pass arguments. At least for now, the ":::" won out in the design—but I don't like it. Probably too late to change it anyhow. * [no-cd] flag - both just and mise run tasks in the directory they're defined, but I prefer how this is overridden in just vs mise. * expression/substitutions - mise uses tera for templating, which is very flexible, but it requires a bit more verbosity. I like that in just you can just use backticks or reference vars with minimal syntax. Same thing with things like joining paths and coalescing. I have all of this, but the syntax is definitely more verbose in mise. Arguably though, mise's verbosity might be easier to read since it's more obvious what you're saying. * confirmation - I love that in just you can just add `[confirm]` to get a confirmation dialog for the task. I'm sure we'll get around to this at some point, mise already has confirmation dialogs so it shouldn't be hard to add. The tricky part will be getting it to work right when running a bunch of stuff in parallel. * task output - I haven't used just that much so I can't actually say that it's "better", but having more control over how tasks are output is definitely a weak part of mise right now and is in need of more functionality like in just how you can add/remove "@" to echo out the command that's running I want to call out one very silly thing that from reading these github issues sounds crazy. It sounds like both just and taskfile have the same behavior with `.env` files. In just and taskfile, variables defined in .env are ignored if they're already defined. I don't think anyone would want that—nobody has asked for mise to behave that way—and it doesn't appear either tool even allows you to change it!
- nunez 2y agoJust recipes accepting command line arts and supporting documentation might be enough to finally push me away from Make.
- mgaunard 2y agoI already have a command runner, it's called a shell. Apparently just also needs one to run.
- j0057 2y agoCan you set a variable from one task and use it from another, or is it a bad thing to want this?
- petabyt 2y agoI've used make for years, even partially wrote my own make interpreter once, I hate it as much as anybody else. But I don't feel confident investing in a new tool that has widespread industry adoption. I wish there was a 'better make' that tries to replace make the same way Zig wants to replace C, where they have great interop and make it easy to rewrite code into the new language.
- dmead 2y agoThere are a ton of better makes. It still didn't matter.
- enbugger 2y agoAny examples besides the subject?
- ttyprintk 2y agoI’m old enough that Solaris came with SVR4 make as an alternative. On Windows, Borland make and nmake come to mind.
- GuB-42 2y ago"just" is not a better make, it is, well, just a command runner. Make is designed, well, to make stuff, it is a build system. But now, it is showing its age as a build system, and other, more advanced systems have taken over, these are the "better make" [1]. But it turns out that make is flexible and can be used for other things, namely running commands, and it has been rather popular for this. Problem is, make is still a build system at its core, and it has some quirks that make it less than ideal as a simple command runner, notably the ".PHONY" target. Just is like make, but it is explicitly not a build system, which allows it to do away with most of these quirks. So is it a "better make"? As a build system, no, it is intentionally a "worse make", but as "just a command runner", then it is indeed a "better make", and I am not aware of a similar project. [1] https://en.wikipedia.org/wiki/List_of_build_automation_software https://en.wikipedia.org/wiki/List_of_build_automation_softw...
- 2y ago
- ramon156 2y agoUsed it in my graduate internship. It really made using the garbage ASP.NET commands easier. Thanks!
- silasdavis 2y agoI'm Stockholm syndrome with make at this point. I'm not sure I'd want it any other way.
- olvrng 2y agoMy favorite command runner setup is just a simple bash script and .envrc I can put my commands in a run file, which source a simple bash script, and use it like: run do-foo run build-bar You can even `run help` to list all available commands. The setup is explained here: https://olivernguyen.io/w/direnv.run/ https://olivernguyen.io/w/direnv.run/
- olvrng 2y agoCreate a bash script `run`: #!/bin/bash set -eo pipefail run-hello() { echo "Hello, World!" } # -------- this is the magic ------- # source "scripts/_cli.sh" And source a simple script `_cli.sh`: #!/bin/bash set -eo pipefail show-help(){ items=() while IFS='' read -r line; do items+=("$line"); done < \ <(compgen -A "function" | grep "run-" | sed "s/run-//") printf -v items "\t%s\n" "${items[@]}" usage="USAGE: $(basename "$0") CMD [ARGUMENTS] CMD:\n$items" printf "$usage" } name=$1 case "$name" in "" | "-h" | "--help" | "help") show-help ;; *) shift if compgen -A "function" | grep "run-$name" >/dev/null ; then run-"${name}" "$@" else echo "ERROR: run-$name not found." exit 123 fi ;; esac
- luismedel 2y agoNice. I didn't know about Just. Just (pun intended) a personal plug: I always liked the Make ease of use and the declarative GH Actions phylosophy. I also like to have the same workflows in local and in my remote CI, so I recently wrote a task runner with the (IMHO) ease of use of Make and GH Actions-like philosophy. It still lacks good docs, but I use it everyday on my projects and works like a charm. https://github.com/luismedel/bluish/ https://github.com/luismedel/bluish/ Some day I need to do a proper Show HN :-)
- throawayonthe 2y ago[dead]
- nrclark 2y agoFrom my perspective, Just would be more useful if it had some ability to skip steps where the input hasn't changed. Like maybe a Justfile's recipe could produce a "<task>.complete" kind of file, and could decide whether to re-run the task based on whether the task's inputs (or its dependencies' inputs). Also if that sounds like a useful feature, consider using Make.
- maccard 2y agoMake solves that problem. The problem that I have is that all of the tools I use day to day do their own dependency tracking and re-run tracking. Say I want to deploy a dotnet app to a k8s cluster - none of helm, docker, dotnet build, dotnet test expose their dependency tracking in a way that is straightforward to use with make. The most straightforward way to do it is to just run the commands anyway, IME.
- hobofan 2y ago> Also if that sounds like a useful feature, consider using Make Just not having that feature is _the_ defining difference in design between the two. If just were to ever add that it would likely kill its appeal. Not having that is what keeps the logic of a just invocation simple and what keeps Justfiles from devolving into the mess that Makefiles tend to with entangled build targets.
- tgmatt 2y agoI'm surprised nobody mentioned Rake yet. Having the full capability of Ruby and whatever gem you want makes it a dream for these kind of tasks. Absolutely love it.
- ufmace 2y agoThat's what I dropped in to say. I've used most of them, and I think Rake is my favorite. Pretty much all of the others are shell command runners with a couple of extra bits bolted on. Well and good most of the time, but it's another language to learn, and you're mostly SOL if it doesn't support something you want to do nicely. With Rake, you get the same basic ability to do pre-set shell commands as the others, a single one or a sequence. But you also have the full power of Ruby, a full-fledged programming language, if you want to do anything more complex.
- flomo 2y agoI was looking for this comment, because rake is great. One big thing is it never felt good imposing Ruby on a (say) a JS project (and I'm not sure of the current state of macos default ruby), so next time this comes up, I will be taking a look at just.
- tomjakubowski 2y agoOne reward you get for allowing yourself to become brainwashed by Bazel is you get a pretty nice task runner in every project that you've brought into the fold.
- 25thhour 2y agoI'm also using a global justfile (`-g`) [1] to serve as a convenient location to aggregate any convenience functions, as well as call out to any standalone scripts as necessary. You can also 'convert' all recipes to aliases so you get the best of both worlds, the ability to call with `just -g foo` or `foo`, from anywhere. The docs example [2] uses a `user` justfile, but the principal is the same for global. for recipe in `just --justfile ~/.user.justfile --summary`; do alias $recipe="just --justfile ~/.user.justfile --working-directory . $recipe" done Most recently I've started using `fzf` and `bat` to allow interactive selection of recipes with syntax highlighted previews: _choose: @just -g --summary | \ tr ' ' '\n' | \ sort -r | \ fzf --multi --preview 'just -g --show {} | bat --color=always -l just -pp' | \ xargs just -g Now with a global `alias ji="just -g _choose"` I can interactively choose a recipe if I need a reminder of what I've set up. This was inspired by the native `--choose` flag which does something similar, but by using `--summary` here, all recipes, including those that take arguments *, are listed, as well as any nested modules. And because you can use any shebang, you can also write little python scripts to run with `uv`, including those with dependencies [5] declared in the shebang: # list Cloudflare accounts accounts: #!/usr/bin/env -S uv run --script --with cloudflare --python 3.13 from cloudflare import Cloudflare client = Cloudflare() accounts = client.accounts.list() print(accounts) …here with inline metadata: # list Cloudflare accounts accounts: #!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.13" # dependencies = [ # "cloudflare", # ] # /// from cloudflare import Cloudflare client = Cloudflare() accounts = client.accounts.list() print(accounts) [1] https://just.systems/man/en/global-and-user-justfiles.html https://just.systems/man/en/global-and-user-justfiles.html [2] https://just.systems/man/en/global-and-user-justfiles.html#recipe-aliases https://just.systems/man/en/global-and-user-justfiles.html#r... [3] https://just.systems/man/en/selecting-recipes-to-run-with-an-interactive-chooser.html https://just.systems/man/en/selecting-recipes-to-run-with-an... [4] https://github.com/charmbracelet/gum?tab=readme-ov-file#input https://github.com/charmbracelet/gum?tab=readme-ov-file#inpu... [5] https://docs.astral.sh/uv/guides/scripts/#running-a-script-with-dependencies https://docs.astral.sh/uv/guides/scripts/#running-a-script-w... * interactively selected recipes that take arguments won't work by directly passing to `xargs` here, but in some cases where I do want that flexibility I just add a condition in the recipe to prompt for input, with `gum input` [4]. Flexibility. This is a belt and braces approach and only used where necessary as the `fzf` preview will have made it clear that a recipe takes arguments. [positional-arguments] foo $bar="": #!/usr/bin/env bash if [ -z "$bar" ]; then bar=$(gum input --placeholder "bar") fi echo "looking up $bar"
- okanat 2y agoReliance over a Posix shell basically prevents me from using Just. Using bash from Git on Windows is a very weird choice.
- sebmellen 2y agoJustfiles are really awesome for repos where you have to use a bunch of complex, long to type CLI integrations. Especially if you’re using Deno scripts that all have different permission flags…
- PhilippGille 2y agoSeveral comments mention Task/Taskfile already, which is very similar in that you define tasks in YAML. I think it's worth mentioning Mage/Magefile [1][2] as well, where your tasks are actual Go code. Similar to how Rake is for tasks in Ruby code. It's useful when you have complex tasks. It's like using Pulumi instead of Terraform. [1] https://magefile.org/ https://magefile.org/ [2] https://github.com/magefile/mage https://github.com/magefile/mage
- jmartin2683 2y agoI love just! Any way to avoid remembering things is great.
- rout39574 2y agoWhy is "Just" superior to any other e.g. bash script with a bunch of subcommands?
- gedw99 2y agoI am really moving spok It’s golang based but very like make. https://github.com/FollowTheProcess/spok https://github.com/FollowTheProcess/spok
- shikaan 2y agoI built something similar a couple of years back. Glad to see I wasn't alone in my itches https://github.com/shikaan/shmux https://github.com/shikaan/shmux
- quotemstr 2y agoUh, isn't this just Make? I'd rather people run `make this` and `make that` than install a new tool to do the same damned thing. Sometimes software is just "done" and doesn't need to be reinvented.
- jdxcode 2y agono flags, no parallel tasks, no skipping tasks unless files change, no watching for changes come see a modern task manager: https://mise.jdx.dev/tasks/ https://mise.jdx.dev/tasks/
- dr_kretyn 2y agoSeems that I'm the only one who opened up the website and didn't know what was going on. At least two sentences what the "just" is, otherwise it's "if you, you know" and that isn't inviting page.
- csomar 2y agoI used this until AI became good enough. Now, for most purpose, I can just declare what I want to be done/executed and get perfect bash for it. I have a relatively complex Makefile that build graphql schemas and sets them up. It'd have been a no-go given how weird bash syntax is; but now I can get it generated and working from pretty much the first try. There is lots of bash around and it's a very simple language, so AI models are pretty good at it.
- mikojan 2y agoWhat does that mean? You have a huge LLM generated bash script instead of a human-readable makefile? I do not understand.
- CGamesPlay 2y agoMy favorite entry in this space is Argc. I like it because the only “new syntax” it introduces is metadata comments, and the rest is pure bash. The maintainer is also best-in-class in terms of responsiveness. https://github.com/sigoden/argc https://github.com/sigoden/argc
- WuxiFingerHold 2y agoI find it more powerful and from a certain point easier to create the tooling using the projects programming language. Every dev should be familiar with that language and ecosystem. E.g. for project that had several tools - Rust (server), .NET and Node (CLI tools) and Svelte (frontend) - I wrote all operational tools in Typescript and run them using Deno. Very clean and powerful (typesafe, composable, Deno std lib). You can add all kind of stuff like timings, logging, checks, whatever ...
- grantcarthew 2y agoNobody: Let's write all of our scripts in YAML Me: !
- dimator 2y agoI use it as a somewhat more sane way of collecting my repetitive, project specific commands, without having to rely on shell history. I'll just plop my project-specific workflows (series of shell commands) into a Justfile (that I don't commit, it's just for me). That allows me to be more rigorous and structured with how I'm iterating on a project. It has syntax and semantics that are sufficiently saner than make, so I don't need to know a lot to be productive. If I come back to a project after a couple weeks, I don't need to spelunk shell history. Just --list is enough to get back up to speed with how I was iterating.
- jstrieb 2y agoIn case you want to run Justfiles in places where you can't install the Just binary (for whatever reason), I wrote a compiler that transforms Justfiles into portable shell scripts that have byte-for-byte identical output in most cases. https://github.com/jstrieb/just.sh https://github.com/jstrieb/just.sh Previous HN discussion: https://news.ycombinator.com/item?id=38772039 https://news.ycombinator.com/item?id=38772039
- hiAndrewQuinn 2y agoFantastic! This solves my big fear around getting used to such a tool. My work primarily involves 'nix boxes that have to be very locked down and will be left in a place basically untouched for 20 years after I finish setting them up. Getting a reliable new binary of any sort on them is quite difficult, not least because we need to plan for things other far future people might be able to discover for troubleshooting down the line.
- Kharacternyk 2y agoCould you tell more about these 'nix boxes? Sounds very interesting.
- miroljub 2y agoWhy would you care now? In 20 years somebody else would be paid to fix it.
- k_bx 2y agoI see more projects switch to PIXI, another Rust-written piece of software. RERUN was the one I follow the most https://github.com/rerun-io/rerun https://github.com/rerun-io/rerun It looks like much more than just command runner, but my projects happen to be needing much more than that too.
- udev4096 2y agoCan anyone give me an example where I can actually replace my bash scripts with just? I don't see a point in using it if I can simply write a bash script (at least their examples are very easily replaceable)
- porkbrain 2y agoMany reasons are already mentioned in other comments. I'd add the following nice-to-have. Sometimes you'd find it easier/preferable to run some scripts with some other shell. You can set the shell for some commands, for example: ``` set shell := [ "python3", "-c"] # I can run python! [no-cd] foo-bar: @import sys; major, minor = sys.version_info[:2]; assert (major, minor) >= (3, 7), "This script requires at least Python 3.7. Please link \"python3\" to Python 3.7 or higher and try again." ``` And the API for your commands stays consistent for a very little effort. Of course you can achieve all this with just bash scripts but I find it faster and easier to provide a good devex this way.
- bjackman 2y agoI think of you're ok with "just writing a bash script" the tool is not for you Everything I do with Just can pretty easily be done with Bash. But, doing it with bash is yucky. Doing with with Just is comfortable. If you don't have the yuck factor then I'd say you can just stick with Bash!
- ndr 2y agoI've been using babashka tasks [0] for a while. It has a nice api to run shell commands but it's all clojure based. Am I missing out on justfiles? It seems to be quite popular among rust/nix circles but I'm afraid it's going to be yet another instance of Greenspun's tenth rule. [0] https://book.babashka.org/#tasks https://book.babashka.org/#tasks
- nektro 2y agouse this in my projects and love it
- gutomotta 2y agoI saw many projects like this a while ago, and, although they all seemed great, I kept wondering why do I need such a complex thing just to save/run a bunch of scripts? I ended up building my own script runner, fj.sh [1]. It's dead simple, you write your scripts using regular shell functions that accept arguments, and add your script files to your repos. Run with "fj myfunc myarg ...". Installation is basically downloading an executable shell script (fj.sh) and adding it to your PATH. Uninstall by removing it. That's all. I'm not saying 'just' is bad—it is an awesome, very powerful tool, but you don't always need that much power, so keep an eye on your use case, as always. [1] github.com/gutomotta/fj.sh
- junipertea 2y agoThere is irony in “I don’t understand why people do X and ended up doing X but simpler”
- zahlman 2y agoThere is nothing at all ironic, inconsistent or otherwise strange about "I don't understand why others' implementations of X are so complex".
- hk__2 2y ago'Just' too was simple at the beginning [1], but with time and usage things always become more complex that some script you do for your own specific use-case. [1]: https://github.com/casey/just/tree/v0.2.23 https://github.com/casey/just/tree/v0.2.23
- apitman 2y agoYou didn't mention it's written in Rust. Is that allowed?
- TeamDman 2y agovery neat but already hitting cases where it doesn't play nice with pwsh scripts, even using the shebang. Back to using a dir full of .ps1 files I guess lol