No. 101·noun·also called option, switch, command-line option

Flag

An optional setting added to a command with dashes, like --force or -v, that changes how it behaves.

SPECIMEN · DIAGRAM · COMPARE

Short

  • One dash
  • -v -f -m
  • Quick to type

Long

  • Two dashes
  • --verbose --force
  • Easier to read

With a value

  • --port 3000
  • --env production
Definition

What it is

A flag (also called an option) tweaks what a command does. Short flags use one dash and a letter (-v); long flags use two dashes and a word (--verbose). Some take a value: --port 3000.

Almost every tool supports --help, which prints the flags it understands. That's the fastest way to find out what a command can do.

Be careful with flags like --force, -f, or --hard. They usually mean "skip the safety check," and are worth asking about before you run them.

Say it like a builder

How to ask for it

Vague

“Is it okay to run the thing you said with the force bit?”

Precise

“Before I run git push --force, explain what the --force flag will overwrite on the remote, and whether there's a safer flag like --force-with-lease I should use instead.”

Why it works

Naming the exact flag lets the agent explain its specific risk and offer a safer alternative.

In the wild

You've seen this in

  • ·npm install --save-dev
  • ·git push --force
  • ·--help at the end of any command
Usage note

Often confused with