1 Star 0 Fork 60

ciaranyoung/cocopilot

forked from 屁屁啊哈/cocopilot 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vscode.sh 972 Bytes
一键复制 编辑 原始数据 按行查看 历史
屁屁啊哈 提交于 2023-09-11 10:41 . 'init'
#!/bin/bash
set -e
EXTENSIONS_DIR="$HOME/.vscode/extensions"
if [ ! -d "$EXTENSIONS_DIR" ]; then
echo "ERROR: VSCode extensions directory not found!"
exit 1
fi
COPILOT_DIR=$(ls -lt "$EXTENSIONS_DIR" | grep '^d' | awk '{print $9}' | grep -E '^github\.copilot-[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)
if [ -z "$COPILOT_DIR" ]; then
echo "ERROR: Copilot extension not found!"
exit 1
fi
COPILOT_DIR="$EXTENSIONS_DIR/$COPILOT_DIR"
EXTENSION_FILE="$COPILOT_DIR/dist/extension.js"
if [ ! -f "$EXTENSION_FILE" ]; then
echo "ERROR: Copilot extension entry file not found!"
exit 1
fi
TMP_FILE="$COPILOT_DIR/dist/extension.js.tmp"
echo 'process.env.CODESPACES="true";process.env.GITHUB_TOKEN="ghu_ThisIsARealFreeCopilotKeyByCoCopilot";process.env.GITHUB_SERVER_URL="https://github.com";process.env.GITHUB_API_URL="https://api.cocopilot.org";' > "$TMP_FILE"
cat "$EXTENSION_FILE" >> "$TMP_FILE"
mv "$TMP_FILE" "$EXTENSION_FILE"
echo 'done. please restart your vscode.'
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ciaranyoung/cocopilot.git
git@gitee.com:ciaranyoung/cocopilot.git
ciaranyoung
cocopilot
cocopilot
master

搜索帮助