This article's documentation is for Source 2. Click here for more information.

Command line options (Source 2): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Split Command line options)
 
(remove vconsole, as it doesn't seem to have any functionality, and fix some confirms)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{TabsBar|main=CHILLMODEA/Pages/Command line options}}
{{LanguageBar}}
{{TabsBar|main=Command line options}}
'''Command line options''' (frequently '''command line arguments''' or '''command line parameters'''; '''launch options''' on [[Steam]]) are additional arguments specified before the program starts, these functionally change the behavior of the program in some way, such as launching the game and start the game with the specified map directly, or play a [[demo]] for example.
 
Command line arguments are traditionally prefixed with a hyphen ({{code|-}}), but some {{windows|2}} applications (especially system ones) will use a forward slash ({{code|/}}) instead. {{quake|2}} uses plus ({{code|+}}) as a prefix for [[console command]]s or [[cvar]]s that will get executed by the game as soon as it starts, and [[GoldSrc|all]] [[Source|Valve]] [[Source 2|engines]] inherit this syntax.


{{todo|Fill this out. Confirm if launch options are {{dota2|name}}, HLA, or CS2 specific, and does it works or not.}}
{{todo|Fill this out. Confirm if launch options are {{dota2|name}}, HLA, or CS2 specific, and does it works or not.}}
== Engine ==
Most of these command-line parameters will work with any Source 2 engine games ({{hla|4}}, {{cs2|4}}, etc.).
{{syntax|cs2.exe <parameter1> <parameter2> <cvar1> <cvar2>}}
===Usage===
These options can be used with:
* Windows shortcuts pointing to <code>cs2.exe</code> directly.
* Windows shortcuts pointing to <code>steam.exe</code> with the proper <code>-applaunch <AppID></code> specified (more on '''[[Command_line_options_(Steam)|Command line options - Steam page]]''').
* Command-line batch script files launching these applications.
* Game launch options from Steam's Library.
* Linux shell scripts pointing to the application with launch options. <code>executable -command</code>
===Examples===
* <code>steam.exe -applaunch 730 -dev -console +map MyMap</code>
* <code>cs2.exe -dev -console +map de_dust2 +buildcubemaps</code>
=== Command-Line Parameters ===
=== Command-Line Parameters ===
{| class="wikitable sortable"
{| class="wikitable sortable"
Line 8: Line 31:
| '''-addon <addon_name>''' ||  Starts the game mounting <code><addon_name><code>. {{only|{{hla}}{{cs2}}}}{{confirm}}
| '''-addon <addon_name>''' ||  Starts the game mounting <code><addon_name><code>. {{only|{{hla}}{{cs2}}}}{{confirm}}
|-
|-
| '''-allow_third_party_software''' || Launches the game in "Untrusted Mode", which allow third-party programs to injecting its code into game executable. {{cs2|only}}
| '''-allow_third_party_software''' || Launches the game in "Untrusted Mode", which allow third-party programs to inject their code into game executable. {{cs2|only}}
|-
|-
| '''-allowmultiple''' || Allows multiple Source 2 instances to run at the same time. Only works if a <code>VPROJECT</code> environment variable is set. {{hla|only}}{{confirm}}
| '''-allowmultiple''' || Allows multiple Source 2 instances to run at the same time. Only works if a <code>VPROJECT</code> environment variable is set. {{hla|only}}{{confirm}}
Line 24: Line 47:
| '''-full''' || The game will start in full-screen mode. {{cs2|only}}{{confirm}}.
| '''-full''' || The game will start in full-screen mode. {{cs2|only}}{{confirm}}.
|-
|-
| '''-fullscreen''' || The game will start in full-screen mode. {{only|{{hla}}{{cs2}}}}{{confirm}}.
| '''-fullscreen''' || The game will start in full-screen mode. {{hla|since}}.
|-
|-
| '''-gpuraytracing''' || (Confirmed with {{code|csgocfg.exe}}) Enable ray-tracing feature support for Hammer Editor. Without it, Hammer ray-tracing related option such as GPU Path Tracing preview and GPU Ray Tracing Visualization will be disabled and hidden. Usually enabled when launching CS2 Workshop Tools from Steam {{cs2|only}}.
| '''-gpuraytracing''' || (Confirmed with {{code|csgocfg.exe}}) Enable ray-tracing feature support for Hammer Editor. Without it, Hammer ray-tracing related option such as GPU Path Tracing preview and GPU Ray Tracing Visualization will be disabled and hidden. Usually enabled when launching CS2 Workshop Tools from Steam {{cs2|only}}.
Line 66: Line 89:
| '''-tools''' ||  Launches the Workshop Tools {{only|{{hla}}{{cs2}}}}{{confirm}}.
| '''-tools''' ||  Launches the Workshop Tools {{only|{{hla}}{{cs2}}}}{{confirm}}.
|-
|-
| '''-vconsole''' || Allows for using the VConsole program that comes with certain games like Aperture Desk Job which does not provide a way of accessing the console in-game {{confirm}}.
| '''-vconsole''' || Allows for using the VConsole program.
|-
|-
| '''-vrdebug''' || Allows the game to run without a VR headset, by rendering the game as a side-by-side stereoscopic pair. {{hla|only}}{{confirm}}
| '''-vrdebug''' || Allows the game to run without a VR headset, by rendering the game as a side-by-side stereoscopic pair. {{hla|only}}{{confirm}}
Line 74: Line 97:
| '''-width <width>, -w''' || Forces the engine to start with resolution set to <code><width></code>. Ex: <code>-w 1080</code> {{cs2|only}}{{confirm}}
| '''-width <width>, -w''' || Forces the engine to start with resolution set to <code><width></code>. Ex: <code>-w 1080</code> {{cs2|only}}{{confirm}}
|-
|-
| '''-window''', '''-windowed''', '''-startwindowed''' or '''-sw''' || The game will start in the regular window.
| '''-window''', '''-windowed''', '''-startwindowed''' or '''-sw''' || The game will start in the regular window. {{Adj|not}}
|-
|-
| '''-x <x position>''' || Window position along the axis X {{cs2|only}}{{confirm}}
| '''-x <x position>''' || Window position along the axis X {{cs2|only}}{{confirm}}
Line 89: Line 112:
|-
|-
|}
|}
{{Source 2 topicon}}

Latest revision as of 20:33, 20 July 2025

English (en)Translate (Translate)
edit

Command line options (frequently command line arguments or command line parameters; launch options on Steam) are additional arguments specified before the program starts, these functionally change the behavior of the program in some way, such as launching the game and start the game with the specified map directly, or play a demo for example.

Command line arguments are traditionally prefixed with a hyphen (-), but some Windows Windows applications (especially system ones) will use a forward slash (/) instead. Quake Quake uses plus (+) as a prefix for console commands or cvars that will get executed by the game as soon as it starts, and all Valve engines inherit this syntax.

Todo: Fill this out. Confirm if launch options are Dota 2, HLA, or CS2 specific, and does it works or not.

Engine

Most of these command-line parameters will work with any Source 2 engine games (Half-Life: Alyx Half-Life: Alyx, Counter-Strike 2 Counter-Strike 2, etc.).

Syntax: cs2.exe <parameter1> <parameter2> <cvar1> <cvar2>

Usage

These options can be used with:

  • Windows shortcuts pointing to cs2.exe directly.
  • Windows shortcuts pointing to steam.exe with the proper -applaunch <AppID> specified (more on Command line options - Steam page).
  • Command-line batch script files launching these applications.
  • Game launch options from Steam's Library.
  • Linux shell scripts pointing to the application with launch options. executable -command

Examples

  • steam.exe -applaunch 730 -dev -console +map MyMap
  • cs2.exe -dev -console +map de_dust2 +buildcubemaps

Command-Line Parameters

Argument Description
-addon <addon_name> Starts the game mounting <addon_name>. (only in Half-Life: AlyxCounter-Strike 2)[confirm]
-allow_third_party_software Launches the game in "Untrusted Mode", which allow third-party programs to inject their code into game executable. (only in Counter-Strike 2)
-allowmultiple Allows multiple Source 2 instances to run at the same time. Only works if a VPROJECT environment variable is set. (only in Half-Life: Alyx)[confirm]
-autoconfig This command lets you restore config file settings to default. (only in Counter-Strike 2)[confirm]
-console Starts the game with the developer console enabled.
-dev Starts the game with the DEV MENU enabled (only in Half-Life: Alyx)[confirm].
-forcenovsync Switches off Vsync technology. (only in Counter-Strike 2)[confirm]
-freq <refresh_rate> Change the monitor refresh rate. (only in Counter-Strike 2)[confirm]
-full The game will start in full-screen mode. (only in Counter-Strike 2)[confirm].
-fullscreen The game will start in full-screen mode. (in all games since Half-Life: Alyx).
-gpuraytracing (Confirmed with csgocfg.exe) Enable ray-tracing feature support for Hammer Editor. Without it, Hammer ray-tracing related option such as GPU Path Tracing preview and GPU Ray Tracing Visualization will be disabled and hidden. Usually enabled when launching CS2 Workshop Tools from Steam (only in Counter-Strike 2).
-h <height> or -height <height> Forces the engine to start with resolution set to <height>. Ex: -h 1920
-high Sets the game's priority to High. (only in Dota 2Counter-Strike 2)[confirm]
-hlvr_workshop Launches the Workshop Tools. (only in Half-Life: Alyx)
-insecure Starts the server without Valve Anti-Cheat.
-language <language> Interface language customization.
-limitvsconst Limits number of vertex shaders up to 256. (only in Counter-Strike 2)[confirm]
-noborder The game window won’t have edges. (only in Counter-Strike 2)[confirm].
-nohltv Switches off all GOTV and Source TV opportunities. (only in Counter-Strike 2)[confirm]
-nojoy Switching off joysticks, joystick support. (only in Counter-Strike 2)[confirm]
-nopreload Cancels models, files and textures pre-loading. (only in Counter-Strike 2)[confirm]
-nostyle Disables some custom Windows UI styling. Can be used to force the tools into light mode, when Windows is set to light mode.
-novid Intro video is disabled. (only in Counter-Strike 2)[confirm]
-novr or -vr_enable_fake_vr_test Launches the game in flat-screen mode. (only in Half-Life: Alyx)
-nowindow Disables the spectator window. (only in Half-Life: Alyx)
-perfectworld Switch to Steam China (Perfect World) servers. (only in Counter-Strike 2)
-retail Makes it so you cannot see certain items in the sdk, such as /characters/ and /econ/ (only in Half-Life: AlyxCounter-Strike 2)[confirm]
-softparticledefaultoff Rendering particles settings. (only in Counter-Strike 2)[confirm]
-steam Applied by default when launched through Steam, connects game to its 'network'. (only in Half-Life: AlyxCounter-Strike 2)[confirm]
-tools Launches the Workshop Tools (only in Half-Life: AlyxCounter-Strike 2)[confirm].
-vconsole Allows for using the VConsole program.
-vrdebug Allows the game to run without a VR headset, by rendering the game as a side-by-side stereoscopic pair. (only in Half-Life: Alyx)[confirm]
-vulkan Forces the engine to use the Vulkan renderer.
-width <width>, -w Forces the engine to start with resolution set to <width>. Ex: -w 1080 (only in Counter-Strike 2)[confirm]
-window, -windowed, -startwindowed or -sw The game will start in the regular window. (not in Aperture Desk Job)
-x <x position> Window position along the axis X (only in Counter-Strike 2)[confirm]
-y <y position> Window position along the axis Y (only in Counter-Strike 2)[confirm]

Deprecated Command-Line Parameters

Argument Description
-tickrate <tickrate> Sets the game tick interval. In Counter-Strike 2 Counter-Strike 2 at launch, Valve hardcoded the game to use 64 tickrate with subticks, so this does nothing.
Confirm:Confirm whether this does anything on old Limited Test build.