DEV Community

Cover image for Using NanoAPI on Game Mods
Thea for NanoAPI

Posted on

Using NanoAPI on Game Mods

Why This Matters

Game mods often evolve into monolithic codebases over time. With the industry shifting toward cloud-native and serverless architectures, tools like NanoAPI help developers to discover dependencies and can help to guide developers to improve these without full rewrites. Hereโ€™s how we applied it to the Archipelago Hollow Knight mod.

Note: NanoAPI is compatible with Windows by running it on WSL (Windows Linux Subsystem) at the moment.

  1. Clone the Mod Repo
cd /mnt/c/Mods  # Windows path mounted in WSL
git clone https://github.com/ArchipelagoMW-HollowKnight/Archipelago.HollowKnight
Enter fullscreen mode Exit fullscreen mode

I downloaded the mods into a folder on my Windows partition called C:/Mods, and then in my WSL terminal I am going to the correct directory cd Archipelago.HollowKnight-main/

Screenshot of Terminal

napi works out of the box on both mac and Linux systems. To use this tool on Windows, you will need to install WSL (Windows Subsystem for Linux) and run the CLI commands from there.
Make sure that Node.js (>=22) and npm are installed https://nodejs.org/en.
Then the command we run is npm install -g @nanoapi.io/napi

Showing the installing process

โš ๏ธ These warning are to be expected, no worries!

Then we are going to run napi init in the terminal.

Give the backend a minute on first run; C# reflection is ๐Ÿขโ€‘slow on big projects.

Image description

Then we select the codebaseโ€™s language (which in this case is C#)

Image description

Then I kept press enter to choose the default ouput file for for NanoAPI

Image description

I type โ€œYโ€, because I want to use the selected include patterns

Image description

I type Y again

Image description

I type Y again Because I want to use the code Metrics

Image description

Then I kept pressing enter to use the suggested default values of nanoAPI

Image description

Image description

Now that we have the configuration configured, weโ€™ll run napi audit view

Then there will be a link to a localhost port which we can view in the web browser.

Set up complete

Now this is what our website looks like:
Image description

Once set up, you can:

  • Open the web viewer.
  • Use the sidebar to explore extracted symbols.
  • Investigate how each symbol is traced and annotated.
  • Review warnings such as dependency overloads and decide what to address or ignore.

Image description
Image description

Finished!

For more information - read the docs: for advanced configs and API extraction.

Want More Information or Help Get Involved?

Weโ€™d love your feedback, ideas, and contributions.

Troubleshooting Notes

I had an issue where it stated
Error: No .csproj files found.

Image description

so then I nano'd into .napirc and I manually included .csproj

{
  "language": "c-sharp",
  "project": {
    "include": [
      "**/*.cs",
      "**/*.csproj"  # Added this line
    ],
    "exclude": [ ... ]
  }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)