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

  1. 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.
  2. 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.
  3. Type a command and press Enter. For example cl_showfps 1.

If the TF2 console is not opening

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.

CommandWhat it does
bind <key> <command>Binds a key to a command.
unbind <key>Unbinds a key.
key_listboundkeysLists 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.
clearClears the console.
statusShows the map and the connection status.
retryConnects to the last server again.
disconnectLeaves the server.
quitCloses the game.
hud_reloadschemeReloads the HUD layout and animation scripts.
snd_restartRestarts 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

  1. 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.
  2. Add the bots. tf_bot_add 5 adds five bots. tf_bot_add 3 red hard adds three hard bots to RED.
  3. Remove them. tf_bot_kick all.
CommandWhat it does
tf_bot_addAdds 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_quotaThe total number of bots in the game. 0 by default.
tf_bot_quota_modenormal, 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_difficultyThe skill of bots that join: 0 easy, 1 normal, 2 hard, 3 expert. 1 by default.
tf_bot_force_classSet to a class name, every bot respawns as that class.
tf_bot_melee_only1 makes the bots use melee weapons only.
tf_bot_keep_class_after_death1 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.

CommandWhat 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.
godOn and off: the player cannot be hurt.
buddhaOn and off: the player takes damage but does not die.
noclipOn 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.
thirdpersonSwitches to the third person camera.
mp_forcerespawnplayersMakes all players respawn.
nav_generateMakes 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.

CommandWhat it does
mp_disable_respawn_times1 turns the respawn wave times off. 0 by default.
mp_respawnwavetimeThe time between respawn waves, in seconds. 10 by default.
mp_waitingforplayers_cancel1 ends the waiting for players period.
mp_restartgame <seconds>Restarts the game after that many seconds.
mp_scrambleteamsScrambles the teams and restarts the game.
mp_switchteamsSwitches 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

CommandDefaultWhat it sets
fov_desired75Field of view How much of the map you see. 90 is the highest the game allows.
viewmodel_fov54Weapon field of view The field of view your weapon is drawn with. Valve's competitive mode keeps it between 54 and 70.
r_drawviewmodel1Show your weapon
tf_use_min_viewmodels0Minimized weapon models
cl_flipviewmodels0Weapon on the left side
sensitivity3Mouse sensitivity
zoom_sensitivity_ratio1Sensitivity while zoomed in An extra factor on the mouse sensitivity while the field of view is zoomed in.
m_rawinput1Raw mouse input
m_filter0Mouse filtering Averages the mouse movement over 2 frames.

Gameplay

CommandDefaultWhat it sets
hud_fastswitch0Fast weapon switch Switches weapon at once, with no click to confirm.
cl_autoreload1Automatic reload Weapons with a clip reload whenever they are not being fired.
tf_remember_activeweapon0Keep the same weapon out after you die
tf_remember_lastswitched0Keep the same last weapon after you die
hud_classautokill1Die at once when you pick a new class
tf_respawn_on_loadoutchanges1Respawn when you change loadout in the spawn room
tf_medigun_autoheal0Medic: the Medi Gun keeps healing without holding the button
hud_medicautocallers0Medic: mark hurt teammates automatically
hud_medicautocallersthreshold75Medic: mark teammates below this health, in percent
hud_medichealtargetmarker0Medic: marker over the player you are healing
cl_autorezoom1Sniper: zoom back in after a zoomed shot
tf_sniper_fullcharge_bell0Sniper: sound when the Sniper Rifle is fully charged
tf_simple_disguise_menu–Spy: concise disguise menu

HUD and screen

CommandDefaultWhat it sets
cl_hud_minmode0Minimal HUD The game's advanced minimalist HUD mode.
cl_hud_playerclass_use_playermodel13D class model in the HUD
tf_hud_target_id_disable_floating_health0Turn off the floating health bar
tf_colorblindassist0Colourblind mode
tf_scoreboard_ping_as_text0Ping as numbers on the scoreboard
tf_hud_show_servertimelimit0Show the time left before the map ends
cl_use_tournament_specgui0Tournament spectator HUD Used when you spectate in tournament mode.
cl_disablehtmlmotd0Turn off web pages in server welcome messages
cl_showfps0FPS counter
net_graph0Net 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

CommandDefaultWhat it sets
hud_combattext1Damage numbers
hud_combattext_redhud_combattext_greenhud_combattext_blue#ff0000Damage number colour
hud_combattext_batching0Add up damage numbers that come close together
hud_combattext_batching_window0.2Longest gap between hits that are added up, in seconds
hud_combattext_healing1Medic: healing numbers over your heal target
hud_combattext_doesnt_block_overhead_text1Keep text such as CRIT over the enemy's head
tf_dingalingaling0Hit sound Plays a sound every time you hurt an enemy.
tf_dingaling_volume0.75Hit sound volume
tf_dingaling_pitchmindmg100Hit sound pitch for a small hit A small hit is 10 damage or less.
tf_dingaling_pitchmaxdmg100Hit sound pitch for a big hit A big hit is 150 damage or more.
tf_dingalingaling_repeat_delay0Shortest time between two hit sounds, in seconds 0 plays a sound for every hit.
tf_dingalingaling_lasthit0Kill sound Plays a sound when one of your attacks kills an enemy.
tf_dingaling_lasthit_volume0.75Kill sound volume
tf_dingaling_lasthit_pitchmindmg100Kill sound pitch for a small hit
tf_dingaling_lasthit_pitchmaxdmg100Kill sound pitch for a big hit

Crosshair

CommandDefaultWhat it sets
crosshair1Show the game's crosshair Turn it off if your HUD draws a crosshair of its own.
cl_crosshair_filenoneCrosshair shape None gives each weapon its own crosshair. Weapon-specific crosshair files only work with None.
cl_crosshair_scale32Crosshair size
cl_crosshair_redcl_crosshair_greencl_crosshair_blue#c8c8c8Crosshair colour
tf_hud_no_crosshair_on_scope_zoom0Sniper: hide the crosshair in the scope

Network

CommandDefaultWhat 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_smooth1Smooth the view after a prediction error
cl_smoothtime0.1Time 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

CommandWhat it does
+forwardMove forward
+backMove back
+moveleftMove left
+moverightMove right
+jumpJump
+duckCrouch

Weapons

CommandWhat it does
+attackPrimary fire
+attack2Secondary fire
+attack3Special attack
+reloadReload
slot1Weapon slot 1
slot2Weapon slot 2
slot3Weapon slot 3
slot4Weapon slot 4
slot5Weapon slot 5
invnextNext weapon
invprevPrevious weapon
lastinvLast weapon used
+use_action_slot_itemUse the action slot item
+inspectInspect
+tauntTaunt
dropitemDrop the intelligence

Talking

CommandWhat it does
sayChat
say_teamTeam chat
+voicerecordVoice chat
voicemenu 0 0Voice: Medic!
voicemenu 0 1Voice: Thanks!
voicemenu 0 2Voice: Go! Go! Go!
voicemenu 0 3Voice: Move up!
voicemenu 1 1Voice: Spy!
voicemenu 1 7Voice: ÜberCharge ready
voicemenu 2 0Voice: Help!
voice_menu_1Voice menu 1
voice_menu_2Voice menu 2
voice_menu_3Voice menu 3

Game

CommandWhat it does
+showscoresScoreboard
changeclassChange class
changeteamChange team
open_charinfo_directOpen the loadout of your class
open_charinfo_backpackOpen the backpack
load_itempreset 0Loadout preset A
load_itempreset 1Loadout preset B
load_itempreset 2Loadout preset C
load_itempreset 3Loadout preset D
show_quest_logOpen the contracts
player_ready_toggleReady or not ready
cl_trigger_first_notificationAccept the notification
cl_decline_first_notificationDecline the notification
killKill yourself
explodeKill yourself with an explosion

Engineer

CommandWhat it does
build 2 0Build a Sentry Gun
build 0 0Build a Dispenser
build 1 0Build a Teleporter entrance
build 1 1Build a Teleporter exit
destroy 2 0Destroy your Sentry Gun
destroy 0 0Destroy your Dispenser
destroy 1 0Destroy your Teleporter entrance
destroy 1 1Destroy your Teleporter exit

Spy

CommandWhat it does
lastdisguiseLast 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.