MCPcopy Index your code
hub / github.com/WilliamVenner/steamlocate-rs

github.com/WilliamVenner/steamlocate-rs @2.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 2.1.0 ↗ · + Follow
139 symbols 258 edges 19 files 24 documented · 17%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

crates.io docs.rs license Workflow Status

steamlocate

A crate which efficiently locates any Steam application on the filesystem, and/or the Steam installation itself.

This crate is best used when you do not want to depend on the Steamworks API for your program. In some cases the Steamworks API may be more appropriate to use, in which case I recommend the fantastic steamworks crate. You don't need to be a Steamworks partner to get installation directory locations from the Steamworks API.

Using steamlocate

Simply add steamlocate using cargo.

$ cargo add steamlocate

Examples

Locate the Steam installation and a specific game

The SteamDir is going to be your entrypoint into most parts of the API. After you locate it you can access related information.

``rust,ignore let steam_dir = steamlocate::locate()?; println!("Steam installation - {}", steam_dir.path().display()); // ^^ prints something likeSteam installation - C:\Program Files (x86)\Steam`

const GMOD_APP_ID: u32 = 4_000; let (garrys_mod, _lib) = steam_dir .find_app(GMOD_APP_ID)? .expect("Of course we have G Mod"); assert_eq!(garrys_mod.name.as_ref().unwrap(), "Garry's Mod"); println!("{garrys_mod:#?}"); // ^^ prints something like vv

```rust,ignore
App {
    app_id: 4_000,
    install_dir: "GarrysMod",
    name: Some("Garry's Mod"),
    universe: Some(Public),
    // much much more data
}

Get an overview of all libraries and apps on the system

You can iterate over all of Steam's libraries from the steam dir. Then from each library you can iterate over all of its apps.

```rust,ignore let steam_dir = steamlocate::locate()?;

for library in steam_dir.libraries()? { let library = library?; println!("Library - {}", library.path().display());

for app in library.apps() {
    let app = app?;
    println!("    App {} - {:?}", app.app_id, app.name);
}

}


On my laptop this prints

```text
Library - /home/wintermute/.local/share/Steam
    App 1628350 - Steam Linux Runtime 3.0 (sniper)
    App 1493710 - Proton Experimental
    App 4000 - Garry's Mod
Library - /home/wintermute/temp steam lib
    App 391540 - Undertale
    App 1714040 - Super Auto Pets
    App 2348590 - Proton 8.0

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the MIT license, shall be licensed as above, without any additional terms or conditions.

Core symbols most depended-on inside this repo

steam_dir
called by 7
src/__private_tests/helpers.rs
locate
called by 6
src/lib.rs
find_app
called by 5
src/lib.rs
expect_test_env
called by 5
src/__private_tests/helpers.rs
libraries
called by 4
src/lib.rs
next
called by 4
src/shortcut.rs
parse_shortcuts
called by 4
src/shortcut.rs
finish
called by 4
src/shortcut.rs

Shape

Method 61
Function 34
Class 30
Enum 14

Languages

Rust100%

Modules by API surface

src/__private_tests/helpers.rs26 symbols
src/app.rs25 symbols
src/error.rs23 symbols
src/shortcut.rs16 symbols
src/library.rs12 symbols
src/lib.rs12 symbols
tests/legacy.rs5 symbols
src/config.rs5 symbols
src/__private_tests/temp.rs5 symbols
src/locate/mod.rs2 symbols
tests/wasm.rs1 symbols
tests/tests.rs1 symbols

For agents

$ claude mcp add steamlocate-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact