Cheat Codes
Start the game with the command-line parameter "-console" to enable the console. While playing, press ~ (tilde) to bring up the console and enter any of the following cheat codes:

Example: "C:Program FilesHalf-Life 2hl2.exe" -console


NOTE: It may be necessary to use the code "sv_cheats 1" before entering other cheat codes into the system.

Code:                             Result:
god                               God Mode
impulse 101                       All Weapons
notarget                          Enemies Ignore You
noclip                            No Clipping Mode
give [item]                       Give Item (See List)
map [mapname]                     Load Map (See List)
maps                              List Maps
buddha                            Reduce Health
infinite_aux_power                Unlimited Power for Suit
hurtme #                          Damage Player (#=amount)
developer #                       Developer Mode (#=0,1,2)
impulse 82                        Spawn a Jeep
impulse 102                       Skulls
ch_createjeep                     Spawn a Scout Car
ch_createairboat                  Spawn an Airboat
npc_kill                          Kill All NPCs in Area
+mlook                            Enable Mouse Look
hud_quickhelp/text? 1             Show Crosshairs
viewmodel_fov #                   Sets Size of Carried Weapon
exec [file]                       Execute Script File
cl_drawhud 0/1                    Show/Hide HUD
cl_enablehud 0/1                  Show/Hide HUD
cl_showfps 0/1                    Show/Hide FPS
npc_create                        Create NPC
npc_create_aimed                  Create NPC
picker                            Picker Mode
setpos [coordinates]              Move to Position
setang #                          Set Pitch Yaw
sv_gravity #                      Set Gravity Value
sv_stopspeed #                    Set Minimum Stopping Speed
sv_friction #                     Set World Friction
sv_bounce #                       Set Bouce Multiplier
sv_maxvelocity #                  Set Maximum Velocity
sv_waterdist #                    Set Vertical View Fixup
air_density #                     Set Air Density
dsp_explosion_effect_duration #   Set Length of Explosion
prop_debug                        Bounding Boxes Debug Mode
sv_soundemitter_filecheck         Report Missing WAV Files
mat_numtexttureunits #            Limit Texture Units
mat_yuv 0                         Unknown Effect


Load Map: (use with the MAP [mapname] command) 
d1_canals_01
d1_canals_02
d1_canals_end
d1_tempanals_02
d1_town_01
d1_town_02
d1_town_03
d1_town_04
d1_town_05
d1_trainstation_01
d1_trainstation_02
d1_trainstation_03
d1_trainstation_05
d1_under_01
d1_under_02
d1_under_03
d1_under_04
d2_coast_01
d2_coast_02
d2_coast_03
d2_coast_04
d2_coast_04_dx60
d2_coast_05
d2_coast_06
d2_coast_07
d2_coast_08
d2_prison_01
d2_prison_02
d2_prison_03
d2_prison_04
d2_prison_05
d3_c17_03
d3_c17_04
d3_c17_05
d3_c17_06a
d3_c17_06b
d3_c17_07 

Give Weapons: (use with the GIVE [item] command) 
weapon_alyxgun
weapon_ar1
weapon_ar2
weapon_bugbait
weapon_cguard
weapon_crowbar
weapon_extinguisher
weapon_flaregun
weapon_frag
weapon_gauss
weapon_hopwire
weapon_iceaxe
weapon_physcannon
weapon_physgun
weapon_pistol
weapon_rpg
weapon_shotgun
weapon_smg1
weapon_smg2
weapon_stickylauncher
weapon_stunstick
weapon_thumper
weapon_sniperrifle
weapon_rollerwand
weapon_molotov
weapon_manhack
weapon_immolator
weapon_irifle
weapon_slam
weapon_hmg1
weapon_cubemap
weapon_binoculars
weapon_ml
weapon_brickbat 

Give Items: (use with the GIVE [item] command) 
item_box_buckshot
item_box_mrounds
item_box_sniper_rounds
item_box_srounds
item_healthkit
item_battery
item_suit
item_ml_grenade
item_ar2_grenade
item_healthvial 
Additional Command-Line Parameters
Use these additional parameters on your hl2.exe shortcut to activate the corresponding function.
Code:                      Result:
-width # -height #         Set Width and Height of Window
-fullscreen                Full Screen Mode
-heapsize #                Set Heap Size
-r_anamorphic 0            Unknown Effect
-netgraph 3                Unknown Effect
-mat_preloadshaders        Unknown Effect
-preload                   Unknown Effect
-dx9                       Unknown Effect
-dxlevel 90                Unknown Effect
-mouselook                 Unknown Effect
-dx8                       Unknown Effect
-sw                        Unknown Effect
-condebug                  Unknown Effect
-startwindowed             Unknown Effect
-window                    Unknown Effect
-windowed                  Unknown Effect