TF2 console commands: open the console, bots, binds and settings
The developer console is a text box inside Team Fortress 2 where you type commands. It changes settings the options menu does not have, binds keys, adds bots and reloads a HUD without a restart. This page shows how to open it and lists the commands people look for, with the defaults from Valve's own code.
How to open the console in TF2
- Turn the console on. In the main menu, open Options, go to the Keyboard tab and click Advanced. Turn on the developer console there and confirm.
- Press the key left of 1. It is the
` key, also called tilde (~). The console opens over the menu or the game. The same key closes it. - Type a command and press Enter. For example
cl_showfps 1.
If the TF2 console is not opening
- The console is off. The setting behind the option is
con_enable, and it is 0 until you turn it on. Do step 1 again, or put con_enable 1 in your autoexec.cfg; the config maker has it under HUD and screen. - Your keyboard has no such key, or it types a letter. Bind the console to another key with a line such as
bind "f10" "toggleconsole" in autoexec.cfg. - Open it from Steam. In your Steam library, right-click Team Fortress 2, choose Properties and type
-console under Launch options. The game then starts with the console open, even if it is not turned on. The other TF2 launch options go in the same box.
Console commands to know first
A setting is typed as its name and a value, such as fov_desired 90 for the field of view. A command is typed as its name, with or without words after it. Lines in autoexec.cfg run every time the game starts, so a command you want every time goes there.
| Command | What it does |
|---|
bind <key> <command> | Binds a key to a command. |
unbind <key> | Unbinds a key. |
key_listboundkeys | Lists the bound keys with their commands. |
exec <file> | Runs a config file, such as exec autoexec. |
find <text> | Finds the commands with that text in their name or help text. |
help <command> | Shows the help text of a command or setting. |
clear | Clears the console. |
status | Shows the map and the connection status. |
retry | Connects to the last server again. |
disconnect | Leaves the server. |
quit | Closes the game. |
hud_reloadscheme | Reloads the HUD layout and animation scripts. |
snd_restart | Restarts the sound system. |
record <name> | Records a demo. stop ends the recording and playdemo <name> plays it. |
TF2 kill bind: the kill and explode commands
Type bind "k" "kill" to kill your own character with the K key, or bind "k" "explode" to do it with an explosion. In the code, explode always blows the character to pieces and kill never does. Both commands have no cheat flag, so they need no sv_cheats. The config maker writes the bind into your config, for every class or one.
Valve's code makes the key do nothing in a few cases: for 5 seconds after you last used it, while you are dead, before you have picked a class, in the time after a round ends unless your team won, during the match summary, and as a ghost or in a kart in the Halloween modes. A separate setting, hud_classautokill, kills you when you pick a new class. It is 1 by default.
TF2 bot commands: how to add bots
- Start a map of your own. In the main menu, open the console and type
map, a space and a map name, such as map cp_dustbowl. The bot commands work for the host of the server only. - Add the bots.
tf_bot_add 5 adds five bots. tf_bot_add 3 red hard adds three hard bots to RED. - Remove them.
tf_bot_kick all.
| Command | What it does |
|---|
tf_bot_add | Adds a bot. It takes a number of bots, a class name, a team (red or blue), a difficulty (easy, normal, hard or expert) and a name, in any order. |
tf_bot_kick <name> | Removes a bot by name. all removes every bot, red or blue the bots of one team. |
tf_bot_kill <name> | Kills a bot by name, or all bots with all. |
tf_bot_quota | The total number of bots in the game. 0 by default. |
tf_bot_quota_mode | normal, fill or match. fill keeps that many players in the game, people and bots together. match keeps that many bots for each person. |
tf_bot_difficulty | The skill of bots that join: 0 easy, 1 normal, 2 hard, 3 expert. 1 by default. |
tf_bot_force_class | Set to a class name, every bot respawns as that class. |
tf_bot_melee_only | 1 makes the bots use melee weapons only. |
tf_bot_keep_class_after_death | 1 keeps each bot on its class after it dies. |
nav_generate makes a navigation mesh for the current map and saves it; it is a cheat command (see below).
Cheat commands: sv_cheats, addcond, god, noclip
These commands work only while sv_cheats is 1, and only the server can set that. So they are for a map you started yourself: type sv_cheats 1 first. On Valve's servers and on other people's servers they do nothing.
| Command | What it does |
|---|
addcond <number> <seconds> | Puts a condition on your player. The seconds are optional. |
removecond <number> | Takes a condition off. removecond all takes off every one. |
god | On and off: the player cannot be hurt. |
buddha | On and off: the player takes damage but does not die. |
noclip | On and off: the player flies and passes through walls. |
hurtme <health> | Takes that much health from the player. |
currency_give <amount> | Gives in-game money. |
thirdperson | Switches to the third person camera. |
mp_forcerespawnplayers | Makes all players respawn. |
nav_generate | Makes a navigation mesh for the current map and saves it. |
The numbers for addcond are the game's list of conditions. Three of them: addcond 5 is invulnerability, addcond 11 is the crit boost of the Kritzkrieg and addcond 32 is a speed boost. addcond 5 10 gives it for ten seconds.
Third person command
thirdperson moves the camera behind your character and firstperson moves it back. thirdperson is a cheat command, so it needs sv_cheats 1 on your own map; firstperson is not. A server can switch its players to third person on its own, which is how some community servers offer it.
Instant respawn and respawn time commands
Respawn times are the server's settings, so these work on a map you host. For instant respawn, type mp_disable_respawn_times 1: the wait between respawn waves becomes 0. They are not cheat commands.
| Command | What it does |
|---|
mp_disable_respawn_times | 1 turns the respawn wave times off. 0 by default. |
mp_respawnwavetime | The time between respawn waves, in seconds. 10 by default. |
mp_waitingforplayers_cancel | 1 ends the waiting for players period. |
mp_restartgame <seconds> | Restarts the game after that many seconds. |
mp_scrambleteams | Scrambles the teams and restarts the game. |
mp_switchteams | Switches the teams and restarts the game. |
TF2 settings and their defaults
These are the 61 settings of the TF2 config maker, which writes the ones you change into an autoexec.cfg. The defaults are from Valve's code. A dash means the setting is in engine code Valve has not published, so we give no default for it.
View and mouse
| Command | Default | What it sets |
|---|
fov_desired | 75 | Field of view How much of the map you see. 90 is the highest the game allows. |
viewmodel_fov | 54 | Weapon field of view The field of view your weapon is drawn with. Valve's competitive mode keeps it between 54 and 70. |
r_drawviewmodel | 1 | Show your weapon |
tf_use_min_viewmodels | 0 | Minimized weapon models |
cl_flipviewmodels | 0 | Weapon on the left side |
sensitivity | 3 | Mouse sensitivity |
zoom_sensitivity_ratio | 1 | Sensitivity while zoomed in An extra factor on the mouse sensitivity while the field of view is zoomed in. |
m_rawinput | 1 | Raw mouse input |
m_filter | 0 | Mouse filtering Averages the mouse movement over 2 frames. |
Gameplay
| Command | Default | What it sets |
|---|
hud_fastswitch | 0 | Fast weapon switch Switches weapon at once, with no click to confirm. |
cl_autoreload | 1 | Automatic reload Weapons with a clip reload whenever they are not being fired. |
tf_remember_activeweapon | 0 | Keep the same weapon out after you die |
tf_remember_lastswitched | 0 | Keep the same last weapon after you die |
hud_classautokill | 1 | Die at once when you pick a new class |
tf_respawn_on_loadoutchanges | 1 | Respawn when you change loadout in the spawn room |
tf_medigun_autoheal | 0 | Medic: the Medi Gun keeps healing without holding the button |
hud_medicautocallers | 0 | Medic: mark hurt teammates automatically |
hud_medicautocallersthreshold | 75 | Medic: mark teammates below this health, in percent |
hud_medichealtargetmarker | 0 | Medic: marker over the player you are healing |
cl_autorezoom | 1 | Sniper: zoom back in after a zoomed shot |
tf_sniper_fullcharge_bell | 0 | Sniper: sound when the Sniper Rifle is fully charged |
tf_simple_disguise_menu | – | Spy: concise disguise menu |
HUD and screen
| Command | Default | What it sets |
|---|
cl_hud_minmode | 0 | Minimal HUD The game's advanced minimalist HUD mode. |
cl_hud_playerclass_use_playermodel | 1 | 3D class model in the HUD |
tf_hud_target_id_disable_floating_health | 0 | Turn off the floating health bar |
tf_colorblindassist | 0 | Colourblind mode |
tf_scoreboard_ping_as_text | 0 | Ping as numbers on the scoreboard |
tf_hud_show_servertimelimit | 0 | Show the time left before the map ends |
cl_use_tournament_specgui | 0 | Tournament spectator HUD Used when you spectate in tournament mode. |
cl_disablehtmlmotd | 0 | Turn off web pages in server welcome messages |
cl_showfps | 0 | FPS counter |
net_graph | 0 | Net graph Network details and FPS in a corner of the screen. |
fps_max | – | FPS limit The highest frame rate the game can reach. |
con_enable | – | Developer console |
Damage numbers and hit sounds
| Command | Default | What it sets |
|---|
hud_combattext | 1 | Damage numbers |
hud_combattext_redhud_combattext_greenhud_combattext_blue | #ff0000 | Damage number colour |
hud_combattext_batching | 0 | Add up damage numbers that come close together |
hud_combattext_batching_window | 0.2 | Longest gap between hits that are added up, in seconds |
hud_combattext_healing | 1 | Medic: healing numbers over your heal target |
hud_combattext_doesnt_block_overhead_text | 1 | Keep text such as CRIT over the enemy's head |
tf_dingalingaling | 0 | Hit sound Plays a sound every time you hurt an enemy. |
tf_dingaling_volume | 0.75 | Hit sound volume |
tf_dingaling_pitchmindmg | 100 | Hit sound pitch for a small hit A small hit is 10 damage or less. |
tf_dingaling_pitchmaxdmg | 100 | Hit sound pitch for a big hit A big hit is 150 damage or more. |
tf_dingalingaling_repeat_delay | 0 | Shortest time between two hit sounds, in seconds 0 plays a sound for every hit. |
tf_dingalingaling_lasthit | 0 | Kill sound Plays a sound when one of your attacks kills an enemy. |
tf_dingaling_lasthit_volume | 0.75 | Kill sound volume |
tf_dingaling_lasthit_pitchmindmg | 100 | Kill sound pitch for a small hit |
tf_dingaling_lasthit_pitchmaxdmg | 100 | Kill sound pitch for a big hit |
Crosshair
| Command | Default | What it sets |
|---|
crosshair | 1 | Show the game's crosshair Turn it off if your HUD draws a crosshair of its own. |
cl_crosshair_file | none | Crosshair shape None gives each weapon its own crosshair. Weapon-specific crosshair files only work with None. |
cl_crosshair_scale | 32 | Crosshair size |
cl_crosshair_redcl_crosshair_greencl_crosshair_blue | #c8c8c8 | Crosshair colour |
tf_hud_no_crosshair_on_scope_zoom | 0 | Sniper: hide the crosshair in the scope |
Network
| Command | Default | What it sets |
|---|
cl_cmdrate | – | Updates sent to the server each second |
cl_updaterate | – | Updates received from the server each second |
cl_interp_ratio | – | Interpolation buffer, in snapshots mastercomfig uses 1 for the lowest delay, 2 for most players and 3 for an unstable connection. |
cl_interp | – | Interpolation time mastercomfig pairs 0.015 with a buffer of 1, 0.03 with 2 and 0.045 with 3. |
rate | – | Data rate The rate used for communication with the server. |
cl_smooth | 1 | Smooth the view after a prediction error |
cl_smoothtime | 0.1 | Time to smooth a prediction error over, in seconds |
Commands to bind to a key
Each of these 59 commands goes after a key in a bind line: bind "mouse3" "voicemenu 0 0" calls for a Medic with the middle mouse button. A command that starts with + acts for as long as the key is held. The TF2 scripts guide shows how to join commands into a script with alias.
Movement
| Command | What it does |
|---|
+forward | Move forward |
+back | Move back |
+moveleft | Move left |
+moveright | Move right |
+jump | Jump |
+duck | Crouch |
Weapons
| Command | What it does |
|---|
+attack | Primary fire |
+attack2 | Secondary fire |
+attack3 | Special attack |
+reload | Reload |
slot1 | Weapon slot 1 |
slot2 | Weapon slot 2 |
slot3 | Weapon slot 3 |
slot4 | Weapon slot 4 |
slot5 | Weapon slot 5 |
invnext | Next weapon |
invprev | Previous weapon |
lastinv | Last weapon used |
+use_action_slot_item | Use the action slot item |
+inspect | Inspect |
+taunt | Taunt |
dropitem | Drop the intelligence |
Talking
| Command | What it does |
|---|
say | Chat |
say_team | Team chat |
+voicerecord | Voice chat |
voicemenu 0 0 | Voice: Medic! |
voicemenu 0 1 | Voice: Thanks! |
voicemenu 0 2 | Voice: Go! Go! Go! |
voicemenu 0 3 | Voice: Move up! |
voicemenu 1 1 | Voice: Spy! |
voicemenu 1 7 | Voice: ÜberCharge ready |
voicemenu 2 0 | Voice: Help! |
voice_menu_1 | Voice menu 1 |
voice_menu_2 | Voice menu 2 |
voice_menu_3 | Voice menu 3 |
Game
| Command | What it does |
|---|
+showscores | Scoreboard |
changeclass | Change class |
changeteam | Change team |
open_charinfo_direct | Open the loadout of your class |
open_charinfo_backpack | Open the backpack |
load_itempreset 0 | Loadout preset A |
load_itempreset 1 | Loadout preset B |
load_itempreset 2 | Loadout preset C |
load_itempreset 3 | Loadout preset D |
show_quest_log | Open the contracts |
player_ready_toggle | Ready or not ready |
cl_trigger_first_notification | Accept the notification |
cl_decline_first_notification | Decline the notification |
kill | Kill yourself |
explode | Kill yourself with an explosion |
Engineer
| Command | What it does |
|---|
build 2 0 | Build a Sentry Gun |
build 0 0 | Build a Dispenser |
build 1 0 | Build a Teleporter entrance |
build 1 1 | Build a Teleporter exit |
destroy 2 0 | Destroy your Sentry Gun |
destroy 0 0 | Destroy your Dispenser |
destroy 1 0 | Destroy your Teleporter entrance |
destroy 1 1 | Destroy your Teleporter exit |
Spy
| Command | What it does |
|---|
lastdisguise | Last disguise |
Where this comes from
Command names, defaults and cheat flags are read from Valve's published TF2 source code. The engine commands in the first table are from the game's own command list as kept in mastercomfig's docs. How to turn the console on, its key and the -console launch option are from the Team Fortress 2 wiki.
Next
Put your settings and binds in a file with the TF2 config maker, change your crosshair with the crosshair maker, write a TF2 script, or install a custom HUD.