Use Notion AI outside Notion!
- HTTP Server: It can run as an HTTP server, receiving and responding to requests.
- Terminal User Interface (TUI): It allows user interaction in a terminal-based interface.
- Normal Prompt: It can run as a normal prompt for command-line inputs.
go install github.com/codercola034/notion-ai@latest
- Open a web browser and login to Notion
- Go to Application panel
- Copy the value and set to your environment variable "NOTION_TOKEN"
NOTION_TOKEN_V2=$(Your Token)
Usage of notion-ai
-http
run in http mode
-port int
port to run http server on (default 8080)
-tui
run in terminal user interface mode
-prompt string
run with custom prompt
notion-ai -http -port 10000
There are only one endpoint listening /prompt
curl http://localhost:10000/prompt -d "write a golang hello world programme"
Response
Here is a simple "Hello World" program written in Golang:
```go
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
```
This program prints "Hello, World!" to the console.