This project aims to retrieve information located in a XWiki instance from to a Matrix Bot. It uses under the hood the REST APi of XWiki and ChatGPT to provide resume of Wiki's pages.
- Search pages in the wiki and get a summary of each of them
- Retrieve the list of users
- Ask for questions resumed from the Wiki
To run this project, you will need to copy the .env.example
file into a .env
and fill values for all variables.
API_KEY
in order to use ChatGPT resume functions !
- This project uses Npm as package manager.
- A Matrix Bot setup is needed to query commands. You can follow this tutorial to creates one.
-
Clone the project
git clone https://github.com/GridexX/XWiki-Matrix-Bot.git
-
Go to the project directory
cd XWiki-Matrix-Bot
-
Install dependencies
npm install
-
Start the application in development mode
npm run start:dev
To deploy this project, you should first completed the getting started and follow those steps
-
Compile TypeScript code into JavaScript:
npm run build
-
Build the Docker image:
docker build . -t <NAME>
-
Upload the image to the docker hub
docker push <NAME>
-
Then run the image into a production server:
docker run <options> <NAME>
This is a somewhat opinionated template that is runnable out of the box. The project is TypeScript with a linter that matches the bot-sdk itself. All the good bits of the bot are under src/
.
This is where the bot's entry point is. Here you can see it reading the config, preparing the storage, and setting up other stuff that it'll use throughout its lifetime. Nothing in here should really require modification - most of the bot is elsewhere.
When the bot receives a command (see index.ts
for handoff) it gets processed here. The command structure
is fairly manual, but a basic help menu and processing for a single command is there.
Here are located the commands functions used.
Type aibot help
to have a list of the available comands
This is simply a typescript interface for your config so you can make use of types.
This is where the project's build files go. Not really much to see here.
This is the default storage location. Also not much to see here.
Contributions are always welcome!
Distributed under the Apache License. See LICENSE.md
for more information.
GridexX - @gridexx - [email protected]
Project Link: https://github.com/GridexX/XWiki-Matrix-Bot