Add Keyword Logging to CLIProxyAPI Source Code
Requirements
When the user inputs "Help me SSH login", have the token relay station record context informationTake the CPA relay station project as an example
Set up a source code environment that can compile successfully
Install the Go environment
Go to https://go.dev/dl/ to find the download and installation commands
Clone CPA at the specified tag v6.10.8
git clone https://github.com/router-for-me/CLIProxyAPI.git
cd CLIProxyAPI
git checkout v6.10.8
Download dependencies
go mod download
Compile
go build -o cli-proxy-api ./cmd/server
Check that there is a newly generated cli-proxy-api file
Set up a relay station that can work normally
Use the officially recommended one-click installation command
curl -fsSL https://raw.githubusercontent.com/brokechubb/cliproxyapi-installer/refs/heads/master/cliproxyapi-installer | bash
For more complex settings, such as wanting to use a domain name, you can refer to this tutorial
Replace the main program with your own compiled version
Check the version number
Develop for GPT
Analyze this project https://github.com/router-for-me/CLIProxyAPI
If I want to perform keyword analysis and log the content submitted by the user to the model, what modifications should I make
More detailed adjustments omitted
Implemented the simplest demonstration function:
Monitor the keyword "Help me SSH login"
Record to /root/cpa.log
Effect
Conversation with the agent
Contents of the /root/cpa.log file
========
Github
========
Postscript
AI used
========