A simple plugin to let users add custom APIs to connect to various services without needing to build a separate plugin for each service. This makes it easier to integrate multiple APIs and manage them within the Logseq environment.
With the rapid emergence of new services, especially those leveraging LLM models, it’s cumbersome to design a custom plugin for every service performing similar tasks. This plugin offers a quick solution to connect to these services, minimizing the maintenance effort required to keep up with service updates.
-
Add Multiple API Configurations: Users can add multiple API configurations that will be reflected as commands in the block context menu.
-
Customizable Actions: When setting up an API, users can define the action to be performed with the response of the request. Currently available actions are:
- Write Below the Block (Child)
- Write After the Block (Sibling)
- Replace Content
- Do Nothing
-
Dynamic Input: The block content can be used as an input for the API request by defining
$1
in the body. If the block content is a file, the user can choose to use either:- File Path
- File Content
- Open the Logseq commands palette.
- Invoke the command
Configure My Custom APIs
. - This will open a configuration panel where you can define your API details and actions.
- Right-click on any block to access the context menu.
- You will see a new item called
My Custom Commands
. - Click on it to see a list of your defined APIs.
- Select an API to perform the request.
- The response will then be processed according to the action you have defined (e.g., writing the response below the block).
- Currently does not support blob responses (files, images, etc.) to avoid issues as the files should be stored locally and referenced in Logseq.
- Add more response actions
- Add keybindings for quicker access
- Post-process responses to better adapt to Logseq's format
- Support input from multiple blocks
Feel free to contribute to this project by opening issues or submitting pull requests. Your feedback and contributions are always welcome!