### Install Node.js Dependencies and Start Development Server Source: https://cs-demo-manager.com/docs/development/setup_os=windows These commands are used to set up the development environment for the CS Demo Manager. First, it copies an example environment file and allows for its customization. Then, it installs all necessary Node.js packages and finally starts the development server. ```bash # Optional: cp .env.example .env and edit variables if needed npm install npm run dev ``` -------------------------------- ### Start CS Demo Manager Database Container Source: https://cs-demo-manager.com/docs/development/setup_os=windows This script starts the PostgreSQL database container for the CS Demo Manager project. It may involve copying an environment file and then executing the start script. Ensure you are in the root project folder before running. ```bash # Optional: cp .env.example .env and edit configuration variables ./docker/start.sh ``` -------------------------------- ### Install PostgreSQL Client on Ubuntu Source: https://cs-demo-manager.com/docs/development/setup_os=windows This command installs the PostgreSQL client tools on Ubuntu systems using the apt package manager. It is necessary for interacting with PostgreSQL databases, especially when using Docker for the database. ```bash sudo apt install postgresql-client -y ``` -------------------------------- ### Run CS Demo Manager AppImage on Linux Source: https://cs-demo-manager.com/docs/installation_os=windows Installs and runs the CS Demo Manager application on Linux using an AppImage. This involves downloading the AppImage, making it executable, and then running it. ```bash chmod +x cs-demo-manager-.AppImage ./CS-Demo-Manager-.AppImage ``` -------------------------------- ### Install CS Demo Manager on Red Hat-based Linux Source: https://cs-demo-manager.com/docs/installation_os=windows Installs the CS Demo Manager application on Red Hat-based Linux distributions using an .rpm package. Requires downloading the latest installer from GitHub and using dnf to install. ```bash sudo dnf install ./cs-demo-manager-.rpm ``` -------------------------------- ### Install CS Demo Manager from AUR on Arch Linux Source: https://cs-demo-manager.com/docs/installation_os=windows Installs the CS Demo Manager application on Arch Linux using an AUR helper like paru or yay. This method is recommended for easier installation and updates. ```bash paru -S cs-demo-manager-appimage # or yay -S cs-demo-manager-appimage ``` -------------------------------- ### Install CS Demo Manager on Debian-based Linux Source: https://cs-demo-manager.com/docs/installation_os=windows Installs the CS Demo Manager application on Debian-based Linux distributions using a .deb package. Requires downloading the latest installer from GitHub and using apt to install. ```bash sudo apt install ./cs-demo-manager__amd64.deb ``` -------------------------------- ### Install PostgreSQL Client via Homebrew on macOS Source: https://cs-demo-manager.com/docs/development/setup_os=windows This command installs the PostgreSQL client libraries using Homebrew on macOS. It's a prerequisite for interacting with PostgreSQL, especially when using Docker. The subsequent command adds the libpq bin directory to the zshrc for path accessibility. ```bash brew install libpq echo 'export PATH="/opt/homebrew/opt/libpq/bin:$PATH"' >> ~/.zshrc ``` -------------------------------- ### Enable GNOME AppIndicator on Red Hat-based Linux Source: https://cs-demo-manager.com/docs/installation Installs and enables the GNOME AppIndicator extension on Red Hat-based Linux distributions to display the application tray icon. A reboot is required after installation. ```bash sudo dnf install gnome-shell-extension-appindicator sudo dnf install gnome-extensions-app Reboot Open the `Extensions` application and enable `AppIndicator and KStatusNotifierItem Support` ``` -------------------------------- ### Install Python 3.9 on Windows using Winget Source: https://cs-demo-manager.com/docs/development/setup_os=windows This command uses the Windows Package Manager (winget) to install Python version 3.9. This is a requirement for the CS Demo Manager project on Windows, particularly for handling native dependencies. ```powershell winget install -e --id Python.Python.3.9 ``` -------------------------------- ### Install CS2 Server Plugin Source: https://cs-demo-manager.com/docs/development/cs-server-plugin Describes the automatic installation process of the CS2 server plugin by CS:DM. This involves copying the binary, updating the gameinfo.gi file, and launching CS2 with the -insecure option. The plugin is essential for enabling communication between CS:DM and the game. ```text 1. Copy the binary from the `static` folder to the `game\csgo\csdm\bin` folder. 2. Add a reference to the plugin in the file `game\csgo\gameinfo.gi`: ``` SearchPaths { Game_LowViolence csgo_lv // Perfect World content override + Game csgo/csdm Game csgo Game csgo_imported Game csgo_core Game core ``` 3. Launch CS2 with the launch option `-insecure` ``` -------------------------------- ### Enable GNOME AppIndicator for Tray Icon on Red Hat-based Linux Source: https://cs-demo-manager.com/docs/installation_os=windows Enables the GNOME AppIndicator tray extension on Red Hat-based Linux distributions to display the CS Demo Manager application icon. This involves installing specific packages, rebooting, and enabling the extension. ```bash sudo dnf install gnome-shell-extension-appindicator sudo dnf install gnome-extensions-app # Reboot # Open the Extensions application and enable AppIndicator and KStatusNotifierItem Support ``` -------------------------------- ### Restart Windows Network Services for Permission Issues Source: https://cs-demo-manager.com/docs/development/setup_os=windows These PowerShell commands are used on Windows to resolve 'listen EACCES: permission denied' errors. They stop and then restart the 'winnat' service, which can help clear network-related permission conflicts. ```powershell net stop winnat net start winnat ``` -------------------------------- ### Install CS:DM CLI on Linux Source: https://cs-demo-manager.com/docs/cli_os=linux This snippet guides users on how to add the CS:DM CLI to their PATH on Linux using bash. It requires finding the application's installation path first, which varies by distribution. After running the command, the terminal needs to be restarted. For other shells, the configuration file should be updated accordingly. ```bash echo '\nexport PATH="/the/app/path:$PATH"' >> ~/.bashrc ``` -------------------------------- ### Generate Video by Tick Range (CLI) Source: https://cs-demo-manager.com/docs/cli_os=macos This command generates a video from a specified demo file between a start and end tick. It requires the demo path, start tick, and end tick. Various options can be appended to customize the output. ```bash csdm video [options] ``` -------------------------------- ### Generate Video using Config File (CLI) Source: https://cs-demo-manager.com/docs/cli_os=macos This command generates videos using a JSON configuration file, which must include the demo path. This method allows for more complex setups and is useful for repeatable configurations. Additional options can be provided on the command line. ```bash csdm video --config-file [options] ``` -------------------------------- ### JSONC Configuration for CS:DM Recording Overrides Source: https://cs-demo-manager.com/docs/cli_os=macos An example JSONC configuration file that can be used to drive CS:DM recording. It specifies the demo path and allows for optional overrides of settings like framerate, resolution, and FFmpeg parameters. ```jsonc { // Required demo path "demoPath": "E:\\cs\\demo.dem", // Optional overrides (fallback to CS:DM settings) "framerate": 60, "width": 1920, "height": 1080, "concatenateSequences": true, "ffmpegSettings": { "videoCodec": "libx264", "videoContainer": "mp4" } } ``` -------------------------------- ### CS:DM CLI: Recording using JSON Configuration File Source: https://cs-demo-manager.com/docs/cli_os=macos Drives the recording process using a JSON or JSONC configuration file, allowing for complex settings to be managed externally. This command simplifies the setup for recurring or intricate recording tasks. ```bash csdm video --config-file "E:\\configs\\record.jsonc" --encoder-software FFmpeg ``` -------------------------------- ### Download 5EPLAY Demos Source: https://cs-demo-manager.com/docs/cli Download the latest demos from a specified 5EPLAY account or the currently configured account. ```APIDOC ## Download 5EPLAY Demos ### Description Download the last demos of the current 5EPLAY account set in the application or from its ID. ### Method `csdm dl-5eplay` ### Parameters #### Query Parameters - **--id** (string) - Optional - Account's 5EPLAY ID to download demos. Defaults to the current account's 5EPLAY ID set in the application. - **--output** (string) - Optional - Directory where demos will be downloaded. Defaults to: 1. Folder specified in the CS:DM settings 2. CS folder `replays` 3. Current directory ### Request Example ``` csdm dl-5eplay csdm dl-5eplay --id "Player5EPLAYID" csdm dl-5eplay --output "C:\Users\username\Downloads" ``` ### Response No specific response format is detailed, but the command downloads demo files to the specified or default output directory. ``` -------------------------------- ### Download 5EPLAY Demos Source: https://cs-demo-manager.com/docs/cli_os=linux Downloads the latest demos from a specified 5EPLAY account or the currently configured account. Allows specifying an output directory for the downloaded demos. ```bash csdm dl-5eplay [--id] [--output] ``` ```bash csdm dl-5eplay ``` ```bash csdm dl-5eplay --id "Player5EPLAYID" ``` ```bash csdm dl-5eplay --output "C:\Users\username\Downloads" ``` -------------------------------- ### Download 5EPLAY Demos Source: https://cs-demo-manager.com/docs/cli_os=linux Download the latest demos from a 5EPLAY account, either the one set in the application or specified by its ID. ```APIDOC ## Download 5EPLAY Demos ### Description Download the last demos of the current 5EPLAY account set in the application or from its ID. ### Method CLI Command ### Endpoint `csdm dl-5eplay [--id] [--output]` ### Parameters #### Query Parameters - **--id** (string) - Optional - Account's 5EPLAY ID to download demos. Defaults to the current account's 5EPLAY ID set in the application. - **--output** (string) - Optional - Directory where demos will be downloaded. Defaults to a prioritized list: 1. Folder specified in CS:DM settings, 2. CS folder `replays`, 3. Current directory. ### Request Example ``` csdm dl-5eplay csdm dl-5eplay --id "Player5EPLAYID" csdm dl-5eplay --output "C:\Users\username\Downloads" ``` ### Response No specific response format detailed, but implies successful download or error messages. ``` -------------------------------- ### Build CS:GO Server Plugin on Windows Source: https://cs-demo-manager.com/docs/development/cs-server-plugin Provides commands to build the CS:GO server plugin on Windows using MSBuild. It includes updating submodules, navigating to the project directory, and executing the build command. The resulting binary will be located in the 'static' folder. ```bash git submodule update --init --recursive msbuild csgo-server-plugin.sln ``` -------------------------------- ### Add psql to PATH Environment Variable (macOS) Source: https://cs-demo-manager.com/docs/installation_os=macos This command adds the PostgreSQL 'bin' directory to the PATH environment variable in the user's zsh configuration file (~/.zshrc). This allows the system to find and execute the 'psql' command from any terminal session. Ensure the path reflects your PostgreSQL installation directory. ```bash echo '\nexport PATH="/Library/PostgreSQL/17/bin:$PATH"' >> ~/.zshrc ``` -------------------------------- ### Test PostgreSQL Connection Source: https://cs-demo-manager.com/docs/installation_os=windows Tests the connection to the PostgreSQL server using the psql command-line tool. This is useful for troubleshooting ECONNREFUSED errors by verifying the host and port. ```bash psql -h 127.0.0.1 -U postgres -p 5432 ``` -------------------------------- ### Import Database using psql Source: https://cs-demo-manager.com/docs/guides/database This command imports a database backup file using psql. It requires specifying the host, port, username, and database name, along with the backup file path. A fresh database must be created before importing. ```bash psql -h host -p port -U username -d db_name -f backup.sql ``` ```bash psql -h 127.0.0.1 -p 5432 -U postgres -d csdm -f backup.sql ``` -------------------------------- ### Change PostgreSQL User Password (Linux) Source: https://cs-demo-manager.com/docs/installation_os=macos This snippet demonstrates how to change the password for the 'postgres' user on a Linux system using the psql command-line interface. It requires superuser privileges. ```bash sudo -u postgres psql ALTER USER postgres PASSWORD 'mypassword'; \q ``` -------------------------------- ### Create Fresh Database for Import Source: https://cs-demo-manager.com/docs/guides/database These SQL commands are used to drop an existing database if it exists and then create a new, empty database. This is a prerequisite for importing a database backup using psql. ```sql DROP DATABASE IF EXISTS db_name; CREATE DATABASE db_name; ``` -------------------------------- ### Build CS2 Server Plugin on Windows Source: https://cs-demo-manager.com/docs/development/cs-server-plugin Provides commands to build the CS2 server plugin on Windows using MSBuild. It includes updating submodules, navigating to the project directory, and executing the build command. The resulting binary will be located in the 'static' folder. ```bash git submodule update --init --recursive msbuild cs2-server-plugin.sln ``` -------------------------------- ### Install CS:DM CLI on macOS Source: https://cs-demo-manager.com/docs/cli_os=linux This snippet provides instructions to add the CS:DM CLI to your PATH on macOS using zsh. It assumes the application is installed in the default location and requires restarting the terminal after execution. If using a different shell, the configuration file path needs to be adjusted. ```bash echo '\nexport PATH="/Applications/CS Demo Manager.app/Contents/Resources:$PATH"' >> ~/.zshrc ``` -------------------------------- ### Build CS2 Server Plugin on Linux Source: https://cs-demo-manager.com/docs/development/cs-server-plugin Provides commands to build the CS2 server plugin on Linux using Make. It includes updating submodules and running the 'make' command. The resulting binary will be located in the 'static' folder. ```bash git submodule update --init --recursive make ``` -------------------------------- ### Install CS:DM CLI on Linux (Debian/RPM) Source: https://cs-demo-manager.com/docs/cli_os=macos Instructions to add the CS:DM CLI to your PATH on Linux. This involves finding the application's installation path and appending an export command to the ~/.bashrc file. The specific command to find the path varies between Debian and RPM-based systems. Remember to restart your terminal after modification. ```shell # For Debian: dpkg -L cs-demo-manager # For RPM: rpm -ql cs-demo-manager # After finding the path (e.g., /opt/CS Demo Manager): ``` ```shell echo '\nexport PATH="/the/app/path:$PATH"' >> ~/.bashrc ``` -------------------------------- ### Execute Game Commands Source: https://cs-demo-manager.com/docs/guides/video Specifies game commands to be executed when a sequence starts. Each command should be on a new line. HLAE commands (e.g., `mirv_`) can also be included on Windows. ```cfg # Example CFG commands game_command_1 game_command_2 mirv_command_example ``` -------------------------------- ### Stop CS Demo Manager Database Container Source: https://cs-demo-manager.com/docs/development/setup_os=windows This script stops the PostgreSQL database container for the CS Demo Manager project. It should be executed from the root project folder. ```bash ./docker/stop.sh ```