first commit

Signed-off-by: pengzhile <pengzhile@gmail.com>
This commit is contained in:
pengzhile 2023-09-04 19:24:56 +08:00
parent d18777ac73
commit 5ca81004f1
4 changed files with 56 additions and 0 deletions

14
.gitignore vendored Normal file
View File

@ -0,0 +1,14 @@
# OS General
Thumbs.db
.DS_Store
# project
*.cert
*.key
*.log
bin/
# Develop tools
.vscode/
.idea/
*.swp

11
README.md Normal file
View File

@ -0,0 +1,11 @@
# CoCopilot
#### 有些东西越有效就越简单,比如这个小工具,有什么用我不能说。
1. 使用`JetBrains`全家桶IDE安装`Copilot`插件。
2. `windows系统`执行`cocopilot.bat`
3. `macOS/linux系统`执行`cocopilot.sh`
4. 看到`done. please restart your ide.`表示成功。
5. 重启你的IDE就好。
6. 不支持`VSCode`,它都抛弃`macOS`了。
7. 这是个小玩具,可能测试不充分,别找我。

13
cocopilot.bat Normal file
View File

@ -0,0 +1,13 @@
@echo off
setlocal
set folder=%userprofile%\AppData\Local\github-copilot
set jsonfile=%folder%\hosts.json
if not exist "%folder%" (
mkdir "%folder%"
)
echo {"github.com":{"user":"cocopilot","oauth_token":"ghu_ThisIsARealFreeCopilotKeyByCoCopilot","dev_override":{"copilot_token_url":"https://api.cocopilot.org/copilot_internal/v2/token"}}} > "%jsonfile%"
echo done. please restart your ide.
pause

18
cocopilot.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set -e
if [ -n "$XDG_CONFIG_HOME" ]; then
CONFIG_DIR="$XDG_CONFIG_HOME"
else
CONFIG_DIR="$HOME/.config"
fi
COPILOT_DIR="$CONFIG_DIR/github-copilot"
if [ ! -d "$COPILOT_DIR" ]; then
mkdir -p "$COPILOT_DIR}"
fi
echo '{"github.com":{"user":"cocopilot","oauth_token":"ghu_ThisIsARealFreeCopilotKeyByCoCopilot","dev_override":{"copilot_token_url":"https://api.cocopilot.org/copilot_internal/v2/token"}}}' > "$COPILOT_DIR/hosts.json"
echo 'done. please restart your ide.'