cli-proxy-api
# 源代码编译,在根目录下会生成 cli-proxy-api 文件
go build -o cli-proxy-api ./cmd/server
port: 8317
auth-dir: "~/.cli-proxy-api"
request-retry: 3
quota-exceeded:
switch-project: true
switch-preview-model: true
api-keys:
- "api123"
remote-management:
allow-remote: true
secret-key: "admin123"
disable-control-panel: false
debug: false
logging-to-file: false
usage-statistics-enabled: false
# 启动脚本, 将 config.yaml 文件放到 cli-proxy-api同级目录中
#!/bin/bash
# 查找并终止占用 8317 端口的进程
PID=$(lsof -ti:8317)
if [ -n "$PID" ]; then
echo "Killing process on port 8317 (PID: $PID)"
kill -9 $PID
sleep 1
else
echo "No process found on port 8317"
fi
# 启动 cli-proxy-api (后台运行)
echo "Starting cli-proxy-api in background..."
nohup ./cli-proxy-api > /dev/null 2>&1 &
echo "cli-proxy-api started (PID: $!)"
登录访问
http://127.0.0.1:8317/management.html
愿意一起学习的小伙伴,可以加qq: 285861181 ,共同交流。
本文来自博客园,作者:egreen,转载请注明原文链接:https://www.cnblogs.com/egreen/p/19671674

浙公网安备 33010602011771号