Skip to content
devcards.space
ToolsDevOps

What is Concurrently? Run Multiple Commands at the Same Time

Run npm scripts in parallel with Concurrently. Colored logs, named labels, --kill-others and glob support — collapse your full-stack dev flow into a single terminal.

6 minute read
Concurrently infographic: a single command launches frontend, backend and mock services in parallel with colored, labeled logs across 12 sections

Concurrently is a small but indispensable CLI tool that runs multiple npm scripts or shell commands in parallel inside the same terminal. Instead of juggling separate terminals for frontend, backend and mock services, you start everything with one command and read clearly labeled, colored logs to see exactly what each process is doing. This guide walks through all 12 sections of the infographic, from basic usage to kill-others and glob patterns.

What is Concurrently?

A Node.js-based CLI tool that lets you run multiple shell commands in parallel. It's built to keep dev server, mock API, type checker and watcher visible inside a single terminal.

Why Use It?

Modern projects routinely run several processes at once. Concurrently launches them all with one command and makes onboarding easier for new team members.

  • Start N processes with a single command
  • Colored, labeled logs — clear which line came from where
  • Saves time during development
  • Great for fullstack and microservice setups
  • Simplifies developer experience

Installation

Add it with one line; usually as a dev dependency.

bash
npm install -D concurrently

# or
npm install -g concurrently --version

Basic Usage

Pass quoted commands to concurrently and they all start in parallel.

bash
npx concurrently "npm run dev" "npm run api"

package.json Example

The most common pattern: a root dev script that fans out to sub-scripts via concurrently.

package.json
json
{
  "scripts": {
    "dev": "concurrently \"npm run client\" \"npm run server\"",
    "client": "vite",
    "server": "node db.json --port 3001"
  }
}

Output Behavior

Details that make Concurrently's output easy to read:

  • All commands run in parallel
  • Logs go to a shared terminal with labels and colors
  • Exit codes propagate to the parent process — safe in CI
  • Easy to track multiple microprocesses

Common Options

The flags you'll reach for most often:

bash
--names           Assign names to commands
--prefix-colors   Set custom colors for logs
--kill-others     Stop all if one fails
--restart-tries   Retry failed processes
--group           Group output together

Example with Options

Combining names, colors and kill-others gives you a much more readable terminal.

bash
npx concurrently \
  -n CLIENT,API \
  --prefix-colors "cyan.bold,magenta" \
  --kill-others \
  "npm run client" \
  "npm run api"

Sequential Mode

Use --sequential to run commands one after another. This is for step-by-step build/start flows rather than truly parallel work.

bash
npx concurrently --sequential \
  "npm run build" \
  "npm run start"

Use Cases

Real-world scenarios where Concurrently saves the day:

  • Running frontend + API server together
  • Fullstack development setups
  • Microfrontend development
  • Running watchers (lint + test) at the same time
  • Docker or local dev orchestration

Tips

For a cleaner setup:

  • Keep scripts short and readable
  • Use --kill-others for safer shutdowns
  • Combines great with tools like Vite and JSON Server
  • Glob pattern: "npm:dev:*" matches every dev: script automatically

Summary

Concurrently simplifies running multiple commands, improves terminal organization and is essential for modern dev workflows. It's lightweight, fast and easy to use — and noticeably improves team onboarding.

Frequently Asked Questions

Common questions about this topic.

How is it different from npm-run-all?

Both run scripts in parallel, but npm-run-all has been unmaintained for a while; concurrently is actively developed and offers richer color/label options and advanced features like kill-others. For new projects, prefer concurrently.

Is it safe to use in CI?

Yes — especially with --kill-others-on-fail. When one process fails the others stop, you don't burn extra CI minutes, and exit codes propagate correctly.

Does it work on Windows?

Yes, it's cross-platform. Avoid shell operators like && or & inside scripts; use concurrently's quoted syntax instead — that guarantees the same behavior on POSIX and Windows shells.

How do I run things sequentially?

Pass --sequential or chain commands with &&. For complex monorepo workflows, Turborepo or Nx may be a better fit.

Is there glob support?

Yes. "npm:dev:*" matches every script that starts with dev:, so you don't have to update the root script every time you add a new service.

Other infographics on connected topics.

Discover more developer infographics

Visit the homepage so you don't miss new content.

See all infographics