Standalone CLI tool to get CS demo download links from share codes (CSCheck fork)
npm install cscheck-cs2-sharecode-clibash
npm install -g cscheck-cs2-sharecode-cli
`
Then use it anywhere:
`bash
cs-sharecode info CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
`
Local installation (Library):
`bash
npm install cscheck-cs2-sharecode-cli
`
Then import in your code:
`ts
import { getDownloadLinkFromShareCode } from "cscheck-cs2-sharecode-cli/lib";
`
$3
If you want to build from source:
`bash
npm install
npm run build
Or for Windows (includes boiler-writter.exe):
npm run build:win
`
Usage
$3
If installed globally via npm:
`bash
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 --verbose
`
Or use with npx (without installing):
`bash
npx cscheck-cs2-sharecode-cli info CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
`
If built from source:
`bash
node dist/index.js info CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
node dist/index.js demo-url CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
`
$3
`ts
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
$3
`
http://replay382.valve.net/730/003767418281950970048_1750155669.dem.bz2
`
$3
`
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-xxxxx
`
$3
`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
1. Decode Share Code: Extracts match ID, reservation ID, and TV port from the share code
2. Connect to Steam: Uses the boiler-writter tool to communicate with Steam's Game Coordinator
3. Fetch Match Data: Retrieves match information including demo download URL
4. Validate Link: Checks if the download link is still active
5. Return Results: Provides match details and download information
Dependencies
This tool uses several key dependencies:
- csgo-sharecode: For encoding/decoding CS share codes
- csgo-protobuf: For handling Steam's protobuf messages
- @akiver/boiler-writter: For communicating with Steam
- commander`: For CLI interface