Skip to content

Sharing scripts

GenAIScript scripts are files and can be shared like any other code file.

As long as the script file are under the project folder, GenAIScript will look for **/*.genai.js files and **/*.genai.mjs.

Here are some ideas to share files.

Git repository + submodules

If you store your scripts in a git repository, you can use git submodules to share them across multiple projects.

  • repository containing your script (e.g. https://.../shared-scripts)
  • Directoryshared-scripts/ git repository https://.../shared-scripts
    • Directorygenaisrc/
      • my-script.genai.mjs
  • referencing shared-scritps as a git submodule
Terminal window
git submodule add https://.../shared-scripts
git submodule update --init --recursive

GitHub Gists

Gists is a lightweight way to share a couple files.