Developer console
The console provides a command-line interface for the advanced configuration of GoldSrc, Source and Source 2 games, aswell as the Steam client. Just about any configuration task can be completed from the console, and in fact many have to be.
Enabling the console
On Source and Source 2 games, the console starts disabled by default. To enable it, load the game and visit Options > Keyboard > Advanced. There will be a pop-up that will include two options, one of them labeled "Enable Developer Console". Once enabled, it can be opened and closed by pressing the button above Tab ⇆, known as the "tilde." ~
GoldSrc games start with the console enabled by default (ever since Steam was released), but the previous version (also known as retail/WON version), needs -console launch option. The previous version of GoldSrc games cannot use ~ key to open the console (unless the player is in-game), instead the player clicks on the Console menu option.
For the Steam client, to open the developer console, you can use steam://nav/console or steam://open/console (simply click on it, or type this command in the "Run" application on Windows, or through your internet browser and submit). You can also launch Steam with -console to start Steam with the "Console" option available on the client tabs, and in the context menu.
-console to the game's launch options to force it to open. Once open, type bind your_key toggleconsole to add a new binding and fix it in the future. Replace your_key with the key you wish to open the console with.Submitting
The grey box across the bottom of the console window is where commands are entered. They come in two forms: commands and variables. Commands are simply keywords, but variables ("cvars") require a value of some sort before they are accepted. When setting a cvar you might type something like this:
When you've finished typing, hit Return or ↵ Enter to submit. You'll see everything you type 'echoed' to the console with a preceding ].
A few notes:
- Multiple values are separated with spaces. If a value contains a space, surround it with quote marks. (e.g.
say "Hello everyone on the server".) - The console will suggest commands and sometimes values in a pop-out box beneath the input field. Press ↑/↓ to navigate the list and Tab ⇆ to accept the highlighted suggestion.
- Only "archived" cvars are stored after the game closes. Use autoexec if you want to set any others when a game loads.
- Some commands are serverside, others clientside. In multiplayer, you can only set clientside ones, unless you are the server owner.
- There are many command prefixes. The most common are
cl("clientside") andsv("serverside").
Useful commands
Category:Source base console commands
The console window
con_enable <boolean>- Allows the console to be activated.
showconsolehideconsoletoggleconsole- Simple command that opens/closes/toggles the console.
toggleconsoleis bound to ` by default.
Find commands
find <term>- The ever-useful
findcommand searches console command names and descriptions for the term you provide.Note.pngNote:Usecvarlistin GoldSource.
help <command name>- Displays any help text for a command, without affecting its value.
Controlling console output
clear- Clear console output, i. e. empties the console. This is useful to execute before other commands to tell where some text starts and ends such as after
find <string>.
echo <string>- Display user-defined text in the console.
con_log <file>condump- Use one of these commands if you want to record what goes on in the console for later use.
con_logwrites output constantly, whilecondumprecords the current text in the console when invoked.Tip.pngTip:The console only displays 241 lines at a time. Usecon_logif you run up against this.
con_filter_enable <0-2>- Filters console output based on the setting of
con_filter_textandcon_filter_text_out. If set to1, all other console output is not shown at all. If set to2, all other console output is printed in gray to highlight the filtered text. con_filter_text <string>- If this is not the empty string and
con_filter_enableis not 0, then any console output is filtered out if it does not match this. con_filter_text_out <string>- If this is not the empty string and
con_filter_enableis not 0, then any console output is filtered out if it does match this.
Cheats and debugging tools
developer <0-2>- Developer mode enables more verbose console output, enables cheats and the console automatically, and makes various other useful changes. If set to
2, the last few lines of console output will be printed at the top of the screen as well.
sv_cheats <boolean>- Most cvars that affect gameplay, especially in multiplayer games, are flagged as "cheats". Submit
sv_cheats 1to unlock them.Note.pngNote:Achievements will be disabled when cheats is enabled.Note.pngNote:You will never be VAC banned for using built-in cheat commands.
noclip- Allows you to fly trough your level without player collisions. Requires
sv_cheatsto be set to 1.
getpos- Prints the current position of the local player to the console.
cl_showpos <0-1>can be used to show the position on the screen continuously.
cl_showfps <0-2>- Display the current frames per second. If set to "2", will also show the lowest and highest FPS with an average, and the latency.
find_ent <term>- Similar to the
findcommand above, but searches for entities within the map by name.
impulse <number>- A generic client command with various game dependent uses, both cheat and not cheat.
map <mapname>- Starts a game on a map.
connect <address>- Tries to connect to a server and load its current map.
disconnect- Disconnects the game from the current server.
status- Shows information about the server that a client is connected to.
quit- Closes the game.
Command prefixes
Most console commands and variables have prefixes in their name to show the subsystem they belong to, but this isn't always the case, especially for commands coming from Half-Life 1, where the old name was kept unchanged.
Commonly used console command prefixes are:
Command prefixesai_
single player AI
bot_
bot system
cc_
close caption system
cl_
multiplayer game (client; see also mp_)
demo_
demo playback
disp_
terrain displacement maps
dsp_
audio DSP settings
ent_
entity control/debug
fire_
firing entity events
g_
single player game
host_
host system
hud_
client HUD
joy_
joystick input
log_
logging system
m_
mouse input
mat_
material system
mp_
multiplayer game (server; see also cl_)
nav_
navigation meshes
net_
engine networking
npc_
single player game NPCs
phys_
physics system
r_
video renderer
rcon_
remote control access
sk_
player skill / difficulty
snd_
sound system
sv_
server settings (engine)
tv_
SourceTV
v_
client view
vgui_
VGUI
voice_
ingame player voice
vprof_
code profiler
wc_
WorldCraft/Hammer helpers
See also
- Developer Console Control - for programmers
- Console Command List - partial list of console commands and variables available in all GoldSrc, Source and Source 2 games
- Game Specific Console Command List - List of all cvars for each game
- Category:Console commands - list of written articles for console commands
- Category:Console variables - list of written articles for console variables