swiftlys2/docs/api/releases/features/ai/

CLI Options

SwiftlyS2 startup behavior can be configured with command-line options passed when launching the game server.

Startup Example

./game/bin/win64/cs2.exe -dedicated +map de_dust2 \
	-sw_path addons/swiftlys2 \
	-sw_logpath addons/swiftlys2/logs \
	-sw_hide_logs_in_console 1 \
	-sw_loglevel WARNING

Options Reference

OptionExampleDetails
-sw_path-sw_path addons/swiftlys2Root directory of the SwiftlyS2 installation, relative to game/csgo: configs, gamedata, extensions, the .NET runtime, dumps and console logs are resolved from it. Default: addons/swiftlys2 (addons\swiftlys2 on Windows).
-sw_logpath-sw_logpath addons/swiftlys2/logsRelative path where the managed (.NET) logger writes its log files, in a managed/ subdirectory. Default: addons/swiftlys2/logs (addons\swiftlys2\logs on Windows).
-sw_hide_logs_in_console-sw_hide_logs_in_console 1Hides managed plugin logs in console; they are still written to files. Accepted values: 1, TRUE, YES, case-insensitive. Any other value leaves the logs visible.
-sw_loglevel-sw_loglevel WARNINGMinimum log level for the core and managed (.NET) loggers; messages below it are dropped. Default: INFO. Accepted values: TRACE, DEBUG, INFO, WARNING, ERROR, CRITICAL, NONE.

Notes

  • -sw_path and -sw_logpath are relative to the game/csgo directory, and a trailing slash is added automatically.
  • Every occurrence of addons/swiftlys2 in -sw_logpath is replaced with the value of -sw_path, so the default log directory follows a custom -sw_path. A value that does not contain addons/swiftlys2 is used as-is.
  • -sw_logpath only affects managed (.NET) log files. Console logs are always written to logs/console/ inside the -sw_path directory, and ConsoleLogger rotation only covers logs/managed/ there, so a custom -sw_logpath is not rotated. Managed log files are only written when core.ConsoleLogger.ManagedEnable is true - see Core Configuration.
  • Use -sw_hide_logs_in_console when you want plugin logs to remain in files but not in console output. Logs from the Core and Shared categories are still printed, and passing the option without one of the accepted values does not enable it.
  • Use -sw_loglevel to reduce noise while preserving higher-severity logs, in console as well as in log files. Values are case-insensitive and unrecognized values fall back to INFO. The native logger accepts the full list above, while the managed (.NET) logger only understands DEBUG, INFO, WARNING, ERROR and OFF and falls back to INFO for anything else.
  • All four options are read once when the core loads. -sw_loglevel sets SWIFTLY_LOG_LEVEL and -sw_hide_logs_in_console sets SWIFTLY_HIDE_LOG_IN_CONSOLE; when an option is not passed the variable is left untouched, so either can also be exported in the server environment instead. Passing the option overwrites an existing value.