Sharing and keeping scripts in GitHub

Alan AI Studio lets you integrate your projects with GitHub to store dialog scripts and share them with other people. This option can be helpful if you are working on the AI agent as a team and want to safely merge each developer’s contributions into a single project. Additionally, you can keep your dialog scripts in GitHub repositories, outside of Alan AI Studio.

GitHub integration settings are configured separately for every AI agent project. You can store data in personal and organization repositories, both public and private ones.

To be able to work with GitHub repositories, you need to:

  1. Sync with GitHub

  2. Add a regular GitHub repository

Note

Together with dialog scripts, Alan AI saves test cases created to a GitHub repository. For details, see Saving test cases to GitHub.

Syncing with GitHub

To sync with GitHub:

  1. In Alan AI Studio, open the project.

  2. In the left pane of the code editor, click Sync with GitHub.

  3. If you are not signed in yet, sign in to GitHub.

  4. At the Authorize Alan AI step, review and confirm GitHub access settings:

    • If you want to store dialog scripts in an organization repository owned by you, next to the organization name, click Grant.

    • If you want to store dialog scripts in an organization repository owned by another person, next to the organization name, click Request. The organization owner will have to review and grant access to organization resources to Alan AI. For details, see GitHub documentation.

    Then click Authorize alan-ai to allow Alan AI to access your personal and organization data.

../../../_images/github-auth.png

Adding a GitHub repository

To link an AI agent project to a GitHub repository:

  1. In the left pane of the code editor, click Add GitHub repo.

  2. On the GitHub repository URL tab, select the target:

    1. From the Select organization list, select the type of repository in which you want to store dialog scripts: personal or organization.

    2. From the Select repository list, select a repository. If you have access to multiple repositories, use search to find the necessary one.

    3. From the Select branch list, select a branch.

    4. To define a specific folder in the repository, in the files and folders list below, select a folder.

    5. At the bottom of the window, click Add files.

../../../_images/git-integration.png

Once you connect to a GitHub repository, Alan AI automatically pulls its content (dialog script and test case files) and displays it in your project. You can do the following:

  • To pull the latest version of files from the repository, in the left pane of the code editor, click Pull. If the file version in Alan Studio conflicts with the repository one, use the Merge Changes window to resolve the conflict. You can merge the changes using your file version or the remote one.

  • To push an updated file version to the repository, in the left pane of the code editor, click Push and enter a comment on the pushed changes. If there are changes in the remote repository made by other team members, you will need to pull the remote file version before committing the local changes.

  • To disconnect from the repository, in the left pane, click the close icon next to the repository name.

Re-authorizing Alan AI

If you already linked your Alan AI Studio account with GitHub and then were added to an organization, you need to re-authorize Alan AI to see the organization repositories in the repositories list.

  1. In Alan AI Studio, click the main menu button and select Profile.

  2. In the Linked Accounts section, next to your GitHub account, click Revoke GitHub access. After revoking, sync with GitHub repositories and GitHub starring benefits will be disabled.

  3. Then synch with GitHub again as described above.

../../../_images/github-org.png