{"id":21247385,"url":"https://github.com/akiver/cs-demo-analyzer","last_synced_at":"2026-01-23T02:03:05.804Z","repository":{"id":210367375,"uuid":"726398378","full_name":"akiver/cs-demo-analyzer","owner":"akiver","description":"Analyze and extract data from Counter-Strike demos.","archived":false,"fork":false,"pushed_at":"2026-01-09T01:35:44.000Z","size":283,"stargazers_count":95,"open_issues_count":2,"forks_count":14,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-12T17:55:29.918Z","etag":null,"topics":["counter-strike","cs2","csgo","replay"],"latest_commit_sha":null,"homepage":"https://cs-demo-manager.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akiver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-02T09:21:47.000Z","updated_at":"2026-01-09T13:44:05.000Z","dependencies_parsed_at":"2024-02-11T23:21:52.032Z","dependency_job_id":"2086922d-43ea-44ce-b711-072fec606391","html_url":"https://github.com/akiver/cs-demo-analyzer","commit_stats":null,"previous_names":["akiver/cs-demo-analyzer"],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/akiver/cs-demo-analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiver%2Fcs-demo-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiver%2Fcs-demo-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiver%2Fcs-demo-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiver%2Fcs-demo-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akiver","download_url":"https://codeload.github.com/akiver/cs-demo-analyzer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiver%2Fcs-demo-analyzer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28677716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"online","status_checked_at":"2026-01-23T02:00:08.296Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["counter-strike","cs2","csgo","replay"],"created_at":"2024-11-21T02:19:50.189Z","updated_at":"2026-01-23T02:03:05.720Z","avatar_url":"https://github.com/akiver.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CS Demo Analyzer\n\nA CLI to analyze and export CS2/CS:GO demos.\n\n## Usage\n\nReady-to-use binaries are available on the [releases page](https://github.com/akiver/cs-demo-analyzer/releases).\n\n### Options\n\n```\ncsda -help\n\nUsage of csda:\n  -demo-path string\n        Demo file path (mandatory)\n  -format string\n        Export format, valid values: [csv,json,csdm] (default \"csv\")\n  -minify\n        Minify JSON file, it has effect only when -format is set to json\n  -output string\n        Output folder or file path, must be a folder when exporting to CSV (mandatory)\n  -positions\n        Include entities (players, grenades...) positions (default false)\n  -source string\n        Force demo's source, valid values: [challengermode,ebot,esea,esl,esportal,faceit,fastcup,5eplay,perfectworld,popflash,valve]\n```\n\n### Examples\n\nExport a demo into CSV files in the current folder.\n\n`csda -demo-path=myDemo.dem -output=.`\n\nExport a demo in a specific folder into a minified JSON file including entities positions.\n\n`csda -demo-path=/path/to/myDemo.dem -output=/path/to/folder -format=json -positions -minify`\n\n## API\n\n### GO API\n\nThis API exposes functions to analyze/export a demo using the Go language.\n\n#### Analyze\n\nThis function analyzes the demo located at the given path and returns a `Match`.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/akiver/cs-demo-analyzer/pkg/api\"\n\t\"github.com/akiver/cs-demo-analyzer/pkg/api/constants\"\n)\n\nfunc main() {\n\tmatch, err := api.AnalyzeDemo(\"./myDemo.dem\", api.AnalyzeDemoOptions{\n\t\tIncludePositions: true,\n\t\tSource:           constants.DemoSourceValve,\n\t})\n\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tos.Exit(1)\n\t}\n\n\tfor _, kill := range match.Kills {\n\t\tfmt.Printf(\"(%d): %s killed %s with %s\\n\", kill.Tick, kill.KillerName, kill.VictimName, kill.WeaponName)\n\t}\n}\n```\n\n#### Analyze and export\n\nThis function analyzes and exports a demo into the given output path.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/akiver/cs-demo-analyzer/pkg/api\"\n\t\"github.com/akiver/cs-demo-analyzer/pkg/api/constants\"\n)\n\nfunc main() {\n\texePath, _ := os.Executable()\n\toutputPath := filepath.Dir(exePath)\n\terr := api.AnalyzeAndExportDemo(\"./myDemo.dem\", outputPath, api.AnalyzeAndExportDemoOptions{\n\t\tIncludePositions: false,\n\t\tSource:           constants.DemoSourceValve,\n\t\tFormat:           constants.ExportFormatJSON,\n\t\tMinifyJSON:       true,\n\t})\n\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tos.Exit(1)\n\t}\n\n\tfmt.Println(\"Demo analyzed and exported in \" + outputPath)\n}\n```\n\n### CLI\n\nThis API exposes the command-line interface.\n\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/akiver/cs-demo-analyzer/pkg/cli\"\n)\n\nfunc main() {\n\tos.Exit(cli.Run(os.Args[1:]))\n}\n```\n\n### Node.js API\n\nA Node.js module called `@akiver/cs-demo-analyzer` is available on NPM.  \nIt exposes a function that under the hood is a wrapper around the Go CLI.  \nThe module also exports TypeScript types and constants.\n\n```js\nimport { analyzeDemo, DemoSource, ExportFormat } from '@akiver/cs-demo-analyzer';\n\nasync function main() {\n  await analyzeDemo({\n    demoPath: './myDemo.dem',\n    outputFolderPath: '.',\n    format: ExportFormat.JSON,\n    source: DemoSource.Valve,\n    analyzePositions: false,\n    minify: false,\n    onStderr: console.error,\n    onStdout: console.log,\n    onStart: () =\u003e {\n      console.log('Starting!');\n    },\n    onEnd: () =\u003e {\n      console.log('Done!');\n    },\n  });\n}\n\nmain();\n```\n\n## Developing\n\n### Requirements\n\n- [Go](https://golang.org/dl/)\n- [Make](https://www.gnu.org/software/make/)\n\n### Build\n\n#### Windows\n\n`make build-windows`\n\n#### macOS\n\n`make build-darwin` / `make build-darwin-arm64`\n\n#### Linux\n\n`make build-linux` / `make build-linux-arm64`\n\n### Tests\n\n1. `./download-demos.sh` it will download the demos used for the tests\n2. `make test`\n\n### VSCode debugger\n\n1. Inside the `.vscode` folder, copy/paste the file `launch.template.json` and name it `launch.json`\n2. Place a demo in the `debug` folder\n3. Update the `-demo-path` argument to point to the demo you just placed\n4. Adjust the other arguments as you wish\n5. Start the debugger from VSCode\n\n## Acknowledgements\n\nThis project uses the demo parser [demoinfocs-golang](https://github.com/markus-wa/demoinfocs-golang) created by [@markus-wa](https://github.com/markus-wa) and maintained by him and [@akiver](https://github.com/akiver).\n\n## License\n\n[MIT](https://github.com/akiver/cs-demo-analyzer/blob/main/LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakiver%2Fcs-demo-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakiver%2Fcs-demo-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakiver%2Fcs-demo-analyzer/lists"}