William Mulianto

Justfile as a Task Runner

· 1 min read

When I’m working on a project with a separate frontend and backend, I need to start both dev servers every time. Open two terminals, cd into each directory, run npm run dev in both. It’s not hard, but it gets old.

just is a simple command runner that lets me put all of that into one file. I drop a justfile in the project root:

# Start both frontend and backend
dev:
    cd frontend && npm run dev &
    cd backend && npm run dev &
    wait

# Start only frontend
dev-frontend:
    cd frontend && npm run dev

# Start only backend
dev-backend:
    cd backend && npm run dev

Now I just run:

just dev

Both servers start in parallel. One command, one terminal.

Install with brew install just and drop a justfile in your project root.

Related