{"id":21385,"date":"2026-06-07T10:36:15","date_gmt":"2026-06-07T10:36:15","guid":{"rendered":"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/"},"modified":"2026-06-07T10:36:15","modified_gmt":"2026-06-07T10:36:15","slug":"sbox-console-commands-concmd-convar-explained","status":"publish","type":"post","link":"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/","title":{"rendered":"s&#038;box Console Commands: ConCmd &#038; ConVar Explained"},"content":{"rendered":"<p>If you come from Garry&#8217;s Mod or Source 1, s&amp;box&#8217;s console works differently &mdash; there&#8217;s no big <code>server.cfg<\/code> or fixed ConVar list. Instead, commands and variables are defined in C# with attributes, and you pass them on the launch line. Here&#8217;s how ConCmd and ConVar actually work in s&amp;box.<\/p>\n<h2>The big difference from Source 1<\/h2>\n<p>s&amp;box has a deliberately small configuration surface. There&#8217;s no <code>server.cfg<\/code> and no master ConVar list like the old engine. Anything you&#8217;d put in a config, you instead pass as a launch parameter when the server boots &mdash; those run as ConVars or ConCmds at startup.<\/p>\n<h2>ConCmd &mdash; console commands<\/h2>\n<p>A <code>[ConCmd]<\/code> attribute turns a C# method into a console command. The backend converts your string arguments to the method&#8217;s parameter types automatically:<\/p>\n<pre><code>[ConCmd( \"greet\" )]\npublic static void Greet( string name )\n{\n    Log.Info( $\"Hello {name}\" );\n}<\/code><\/pre>\n<p>Add the <code>ConVarFlags.Server<\/code> flag to force a command to run on the server, and make the first parameter a <code>Connection<\/code> to know <em>who<\/em> ran it &mdash; essential for admin commands.<\/p>\n<h2>ConVar &mdash; console variables<\/h2>\n<p>A <code>[ConVar]<\/code> exposes a value you can read and change from the console. ConVars take flags that can be combined:<\/p>\n<ul>\n<li><strong>Saved<\/strong> &mdash; persists between sessions.<\/li>\n<li><strong>Replicated<\/strong> &mdash; synced from server to all clients.<\/li>\n<li><strong>UserInfo<\/strong> &mdash; sent from client to host in UserInfo.<\/li>\n<li><strong>GameSetting<\/strong> &mdash; exposed on the game&#8217;s creation screen.<\/li>\n<\/ul>\n<h2>Permissions &mdash; who can run what<\/h2>\n<p>Command and variable access is gated at the engine level with permission flags &mdash; <strong>Admin<\/strong>, <strong>Server<\/strong>, <strong>Replicated<\/strong>, and <strong>Cheat<\/strong> &mdash; plus <code>Connection.HasPermission<\/code> and the <code>NetPermission<\/code> enum. This is how you stop a random client from running server-only or cheat commands. Who counts as an admin is set in <code>users\/config.json<\/code> &mdash; see our <a href=\"\/docs\/sbox\/user-permissions\">user permissions guide<\/a>.<\/p>\n<h2>Generate them without the boilerplate<\/h2>\n<p>Writing ConCmd\/ConVar attributes with the right flags by hand is error-prone. Our free <a href=\"\/tools\/sbox\/concmd-convar\">ConCmd \/ ConVar generator<\/a> builds the C# snippet with your chosen flags and parameters, and the <a href=\"\/docs\/sbox\/admin-commands\">admin commands guide<\/a> covers running them on a live server. Hosting on <a href=\"\/sbox-server-hosting\">XGamingServer s&amp;box hosting<\/a> gives you console and file access to test it all.<\/p>\n<h2>FAQ<\/h2>\n<p><strong>Is there a server.cfg in s&amp;box?<\/strong> No &mdash; pass settings as launch parameters; they execute as ConVars\/ConCmds on boot.<\/p>\n<p><strong>How do I make a command server-only?<\/strong> Add <code>ConVarFlags.Server<\/code> to the <code>[ConCmd]<\/code> attribute.<\/p>\n<p><strong>How do I know who ran a command?<\/strong> Make the method&#8217;s first parameter a <code>Connection<\/code>.<\/p>\n<p><em>Sources: <a href=\"https:\/\/sbox.game\/dev\/doc\/code\/code-basics\/console-variables\" rel=\"nofollow\">s&amp;box Docs &mdash; Console Variables<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you come from Garry&#8217;s Mod or Source 1, s&amp;box&#8217;s console works differently &mdash; there&#8217;s no big server.cfg or fixed ConVar list. Instead, commands and variables are defined in C# with attributes, and you pass them on the launch line. Here&#8217;s how ConCmd and ConVar actually work in s&amp;box. The big difference from Source 1 [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_gspb_post_css":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[143],"tags":[],"class_list":["post-21385","post","type-post","status-publish","format-standard","hentry","category-sbox"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.5 (Yoast SEO v26.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>s&amp;box Console Commands: ConCmd &amp; ConVar Explained - XGamingServer<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"s&amp;box Console Commands: ConCmd &amp; ConVar Explained\" \/>\n<meta property=\"og:description\" content=\"If you come from Garry&#8217;s Mod or Source 1, s&amp;box&#8217;s console works differently &mdash; there&#8217;s no big server.cfg or fixed ConVar list. Instead, commands and variables are defined in C# with attributes, and you pass them on the launch line. Here&#8217;s how ConCmd and ConVar actually work in s&amp;box. The big difference from Source 1 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/\" \/>\n<meta property=\"og:site_name\" content=\"XGamingServer\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/web.facebook.com\/xgamingserver69\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-07T10:36:15+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@xgamingserver\" \/>\n<meta name=\"twitter:site\" content=\"@xgamingserver\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"s&#038;box Console Commands: ConCmd &#038; ConVar Explained\",\"datePublished\":\"2026-06-07T10:36:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/\"},\"wordCount\":401,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/#organization\"},\"articleSection\":[\"s&amp;box\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/\",\"url\":\"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/\",\"name\":\"s&box Console Commands: ConCmd & ConVar Explained - XGamingServer\",\"isPartOf\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/#website\"},\"datePublished\":\"2026-06-07T10:36:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/xgamingserver.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"s&amp;box\",\"item\":\"https:\/\/xgamingserver.com\/blog\/category\/sbox\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"s&#038;box Console Commands: ConCmd &#038; ConVar Explained\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/#website\",\"url\":\"https:\/\/xgamingserver.com\/blog\/\",\"name\":\"XGamingServer\",\"description\":\"Dedicated Game Server Hosting\",\"publisher\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/xgamingserver.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/#organization\",\"name\":\"XGamingServer\",\"url\":\"https:\/\/xgamingserver.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/xgamingserver.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/xgamingserver.com\/blog\/wp-content\/uploads\/2020\/09\/logo.svg\",\"contentUrl\":\"https:\/\/xgamingserver.com\/blog\/wp-content\/uploads\/2020\/09\/logo.svg\",\"width\":\"1024\",\"height\":\"1024\",\"caption\":\"XGamingServer\"},\"image\":{\"@id\":\"https:\/\/xgamingserver.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/web.facebook.com\/xgamingserver69\/\",\"https:\/\/x.com\/xgamingserver\",\"https:\/\/www.instagram.com\/xgamingserver\/\",\"https:\/\/www.linkedin.com\/company\/xgamingserver\/\",\"https:\/\/www.pinterest.com\/xgamingserver\/\",\"https:\/\/www.youtube.com\/channel\/UCHnOtWxpzaL2r3jM9Jm40EQ\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"s&box Console Commands: ConCmd & ConVar Explained - XGamingServer","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/","og_locale":"en_US","og_type":"article","og_title":"s&box Console Commands: ConCmd & ConVar Explained","og_description":"If you come from Garry&#8217;s Mod or Source 1, s&amp;box&#8217;s console works differently &mdash; there&#8217;s no big server.cfg or fixed ConVar list. Instead, commands and variables are defined in C# with attributes, and you pass them on the launch line. Here&#8217;s how ConCmd and ConVar actually work in s&amp;box. The big difference from Source 1 [&hellip;]","og_url":"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/","og_site_name":"XGamingServer","article_publisher":"https:\/\/web.facebook.com\/xgamingserver69\/","article_published_time":"2026-06-07T10:36:15+00:00","twitter_card":"summary_large_image","twitter_creator":"@xgamingserver","twitter_site":"@xgamingserver","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/#article","isPartOf":{"@id":"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/"},"author":{"name":"","@id":""},"headline":"s&#038;box Console Commands: ConCmd &#038; ConVar Explained","datePublished":"2026-06-07T10:36:15+00:00","mainEntityOfPage":{"@id":"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/"},"wordCount":401,"commentCount":0,"publisher":{"@id":"https:\/\/xgamingserver.com\/blog\/#organization"},"articleSection":["s&amp;box"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/","url":"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/","name":"s&box Console Commands: ConCmd & ConVar Explained - XGamingServer","isPartOf":{"@id":"https:\/\/xgamingserver.com\/blog\/#website"},"datePublished":"2026-06-07T10:36:15+00:00","breadcrumb":{"@id":"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/xgamingserver.com\/blog\/sbox-console-commands-concmd-convar-explained\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/xgamingserver.com\/blog\/"},{"@type":"ListItem","position":2,"name":"s&amp;box","item":"https:\/\/xgamingserver.com\/blog\/category\/sbox\/"},{"@type":"ListItem","position":3,"name":"s&#038;box Console Commands: ConCmd &#038; ConVar Explained"}]},{"@type":"WebSite","@id":"https:\/\/xgamingserver.com\/blog\/#website","url":"https:\/\/xgamingserver.com\/blog\/","name":"XGamingServer","description":"Dedicated Game Server Hosting","publisher":{"@id":"https:\/\/xgamingserver.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/xgamingserver.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/xgamingserver.com\/blog\/#organization","name":"XGamingServer","url":"https:\/\/xgamingserver.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/xgamingserver.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/xgamingserver.com\/blog\/wp-content\/uploads\/2020\/09\/logo.svg","contentUrl":"https:\/\/xgamingserver.com\/blog\/wp-content\/uploads\/2020\/09\/logo.svg","width":"1024","height":"1024","caption":"XGamingServer"},"image":{"@id":"https:\/\/xgamingserver.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/web.facebook.com\/xgamingserver69\/","https:\/\/x.com\/xgamingserver","https:\/\/www.instagram.com\/xgamingserver\/","https:\/\/www.linkedin.com\/company\/xgamingserver\/","https:\/\/www.pinterest.com\/xgamingserver\/","https:\/\/www.youtube.com\/channel\/UCHnOtWxpzaL2r3jM9Jm40EQ"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/posts\/21385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/comments?post=21385"}],"version-history":[{"count":0,"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/posts\/21385\/revisions"}],"wp:attachment":[{"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/media?parent=21385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/categories?post=21385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xgamingserver.com\/blog\/wp-json\/wp\/v2\/tags?post=21385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}