cscheck-cs2-sharecode-cli
v0.1.1
Published
Standalone CLI tool to get CS demo download links from share codes (CSCheck fork)
Maintainers
Readme
CSCheck CS2 ShareCode CLI
CSCheck's standalone CLI tool to get Counter-Strike 2 demo download links from share codes. This tool is extracted from the CS Demo Manager project and adapted for the CSCheck ecosystem.
📦 NPM Package: cscheck-cs2-sharecode-cli
🔗 GitHub Repository: sh1dan/CSCheck-cs2-sharecode-cli
Features
- Extract match information from CS:GO/CS2 share codes
- Get direct download links for demo files
- Support for both JSON and human-readable output
- Validates download link availability
- Works with both CS:GO and CS2 matches
Prerequisites
- Node.js 18 or higher
- Steam must be running and logged in
- Counter-Strike must be closed during operation
Installation
Install from NPM (Recommended)
Global installation (CLI):
npm install -g cscheck-cs2-sharecode-cliThen use it anywhere:
cs-sharecode info CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxxLocal installation (Library):
npm install cscheck-cs2-sharecode-cliThen import in your code:
import { getDownloadLinkFromShareCode } from "cscheck-cs2-sharecode-cli/lib";Build from Source
If you want to build from source:
npm install
npm run build
# Or for Windows (includes boiler-writter.exe):
npm run build:winUsage
CLI Usage
If installed globally via npm:
cs-sharecode info CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
cs-sharecode demo-url CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
cs-sharecode info CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx --json
cs-sharecode info CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx --verboseOr use with npx (without installing):
npx cscheck-cs2-sharecode-cli info CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxxIf built from source:
node dist/index.js info CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
node dist/index.js demo-url CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxxLibrary Usage
import { getDownloadLinkFromShareCode, type DownloadResult } from "cscheck-cs2-sharecode-cli/lib";
const result: DownloadResult = await getDownloadLinkFromShareCode("CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx");
console.log(result.demoUrl);Example Output
Demo URL only (demo-url command):
http://replay382.valve.net/730/003767418281950970048_1750155669.dem.bz2Human-readable format (info command):
Match ID: 3456789012345678901
Game: cs2
Map: de_mirage
Date: 2024-01-15T14:30:00.000Z
Demo URL: https://replay123.valve.net/730/003456789012345678901_1234567890.dem.bz2
File Name: match_3456789012345678901_de_mirage_2024-01-15.dem
Share Code: CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxxJSON format (info command with --json):
{
"matchId": "3767413896789360699",
"game": "cs2",
"mapName": "de_inferno",
"date": "2025-08-04T20:20:05.000Z",
"demoUrl": "http://replay382.valve.net/730/003767418281950970048_1750155669.dem.bz2",
"fileName": "match730_003767418281950970048_1750155669_382",
"sharecode": "CSGO-tqboe-XUxQS-rieDD-ynNY2-KWtrD"
}Error Handling
The tool handles various error conditions:
- Invalid Share Code: The provided share code format is invalid
- Steam Not Running: Steam must be running and logged in
- No Matches Found: No match data found for the share code
- Download Link Expired: The demo download link is no longer valid
- Communication Errors: Issues connecting to Steam or Valve servers
How It Works
- Decode Share Code: Extracts match ID, reservation ID, and TV port from the share code
- Connect to Steam: Uses the boiler-writter tool to communicate with Steam's Game Coordinator
- Fetch Match Data: Retrieves match information including demo download URL
- Validate Link: Checks if the download link is still active
- Return Results: Provides match details and download information
Dependencies
This tool uses several key dependencies:
csgo-sharecode: For encoding/decoding CS share codescsgo-protobuf: For handling Steam's protobuf messages@akiver/boiler-writter: For communicating with Steamcommander: For CLI interface
Limitations
- Requires Steam to be running and logged in
- Counter-Strike must be closed during operation
- Download links may expire after some time
- Some older matches may not be available
Credits
This tool is based on the excellent work from CS Demo Manager by AkiVer.
License
MIT
