diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e3baaf --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# OS General +Thumbs.db +.DS_Store + +# project +*.cert +*.key +*.log +bin/ + +# Develop tools +.vscode/ +.idea/ +*.swp \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c23dc4a --- /dev/null +++ b/README.md @@ -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. 这是个小玩具,可能测试不充分,别找我。 diff --git a/cocopilot.bat b/cocopilot.bat new file mode 100644 index 0000000..bc5b915 --- /dev/null +++ b/cocopilot.bat @@ -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 \ No newline at end of file diff --git a/cocopilot.sh b/cocopilot.sh new file mode 100644 index 0000000..b2decde --- /dev/null +++ b/cocopilot.sh @@ -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.' \ No newline at end of file