command-line switch
in English: command-line flag / command-line option
A short notation written after a command, usually starting with a hyphen, used to tell the program how to operate differently from the default.
In plain terms
When you order coffee in a cafe, 'coffee' is the command, and 'with lactose-free milk, to go' are the switches. You ask for the same thing, just specifying how it should be prepared. A command-line switch does the same with a program: you write one or two short markers after the program name, and it runs differently.
The command line has no buttons, checkboxes, and menus. What you would click together in the Settings menu of a windowed program, you enter here with switches. "--help" for example prints the help, and "--version" shows which version is on your machine.
You will encounter two types of switches. One simply turns something on or off, like a light switch, while the other also expects a value, such as a filename or a number. This matters for AI tools because many coding agents are launched from the command line, and a switch determines which model the agent uses or what it can do without asking for permission.
How it works
- Type the program name, followed by the flags separated by spaces, for example: "program --nyelv hu --csendes".
- When Enter is pressed, the line breaks into words, and the pieces reach the program sequentially. On Linux and macOS, the command interpreter (the shell) does this; on Windows, it is usually the program itself.
- The program reviews the items. Anything starting with a hyphen is treated as a switch. After a single hyphen, a one-letter short form usually follows (-v); after two, a descriptive long form (--verbose). On Windows, many of the system's own commands use a forward slash (/?).
- If the switch expects a value, the program reads the word immediately following it or the part after the equals sign, for example "--model=large".
- The program overrides its default settings according to the switches and runs accordingly. If it receives an unknown switch, it typically stops with an error message and shows the correct usage.
An everyday example
You want to try an AI tool, and the installation guide asks you to enter: 'pip install --upgrade package_name'. Here, '--upgrade' is the switch: without it, the installer would leave the existing older version untouched; with it, the latest version replaces the old one.
Who is affected
A common misconception
Limits and risks
- Some switches disable safety brakes, such as "--force", "--yes", or agent switches that skip permission requests, after which the program does not ask again.
- Case sensitivity usually matters, as does the difference between one and two hyphens, so a typo can yield a completely different result.
- Do not write a password or secret key as a flag value, because the command remains in the command history, and other users on the machine can see it in the process list while it runs.
- Switches may change or disappear from version to version, so a command from an old guide may now produce an error.
Similar, but not the same
- parancssori argumentum – In a broader sense, every word written after the command is an argument, including the switch. In a narrower sense, the argument specifies what the program works on (for example, which file), while the switch specifies how.
- environment variable – An environment variable is a value set in the background that every program started from there sees until you change it. A switch, however, applies only to the single command next to which you write it.
- configuration file – The configuration file permanently saves settings to a file. The switch must be re-entered at every startup and usually overrides the value in the file.
Related concepts
short flag, long option, help toggle
parancssori argumentum, environment variable, configuration file, alparancs, coding agent
A brief history
The convention of switches starting with a hyphen spread in the early 1970s with the Unix operating system. The more descriptive, double-hyphen long form later became common through GNU project programs.
Where things stand
It has been a core element of developer tools for decades. Since late 2026, coding agents run from the command line mean that people who have never opened a terminal now encounter it too.
In the news
- YouTube cuts subscription royalties for fully AI-generated musicDec 4, 2026 · Marketing
- Harvey’s AI agents review documents and flag risks in M&A due diligenceDec 4, 2026 · Law
- AI flagged all 13 confirmed tumours involving the kidney on non-contrast CT scansDec 4, 2026 · Health
- Customers who use AI for financial decisions are more likely to switch banksDec 3, 2026 · Marketing
- Customers using AI for financial decisions are up to five times as likely to switch banksDec 3, 2026 · Money
- Numerai plans to close Sigil fund to new investors at $1 billionDec 2, 2026 · Money
- Tencent, Alibaba and ByteDance shift part of their Nvidia budgets to Chinese chipsDec 2, 2026 · Industry
- Locally run Gemma 3 matches leading commercial models in flagging urgent primary care messagesDec 2, 2026 · Health
Also known as
switch · command-line option · command-line parameter · flag · command-line flag · command-line option · CLI flag · switch
Sources
- Wikipedia: Command-line interface
- The Open Group: POSIX Utility Conventions
- GNU Coding Standards: Command-Line Interfaces
This entry was machine-edited and has undergone machine expert review; the “In the news” section updates automatically from Agent Age stories.