منظمة العفو الدولية في سطر الأوامر.

تحتاج فقط إلى كتابة تعليق أو اسم متغير وسيقوم الذكاء الاصطناعي بكتابة الرمز المقابل.
هذا مكون إضافي ZSH يمكّنك من استخدام إكمال رمز AI في سطر الأوامر. وهو يدعم الآن كل من مخطوطة Openai و AI (Gemini) من Google. Openai Codex هو الذكاء الاصطناعى الذي يعمل أيضًا على تشغيل GitHub Copilot ، في حين أن Gemini هو نموذج اللغة المتقدم من Google.
pip3 install openaiأو
pip3 install google-generativeaiأو
pip3 install boto3git clone https://github.com/tom-doerr/zsh_codex.git ~ /.oh-my-zsh/custom/plugins/zsh_codex .zshrc الخاص بك.باستخدام Oh-My-Zsh:
plugins=(zsh_codex)
bindkey ' ^X ' create_completionبدون يا-يا زيش:
# in your/custom/path you need to have a "plugins" folder and in there you clone the repository as zsh_codex
export ZSH_CUSTOM= " your/custom/path "
source " $ZSH_CUSTOM /plugins/zsh_codex/zsh_codex.plugin.zsh "
bindkey ' ^X ' create_completionzsh_codex.ini في ~/.config . مثال: ; Primary service configuration
; Set 'service' to match one of the defined sections below.
[service]
service = groq_service
; Example configuration for a self-hosted Ollama service.
[my_ollama]
api_type = openai
api_key = dummy_key
model = llama3.1
base_url = http://localhost:11434/v1
; OpenAI service configuration
; Provide the 'api_key' and specify a 'model' if needed.
[openai_service]
api_type = openai
api_key = <openai_apikey>
; Groq service configuration
; Provide the 'api_key'.
[groq_service]
api_type = groq
api_key = <groq_apikey>
model = gemma2-9b-it
; Mistral service configuration
; Provide the 'api_key'.
[mistral_service]
api_type = mistral
api_key = <mistral_apikey>
model = mistral-small-latest في ملف التكوين هذا ، يمكنك تحديد خدمات متعددة بتكويناتها الخاصة. يتم تحديد المعلمات المطلوبة والاختيارية لـ api_type في services/sevices.py . اختر أي خدمة لاستخدامها في قسم [service] .
zsh ، وابدأ الكتابة وأكملها باستخدام ^X !ZSH_CODEX_PYTHON على Python قابلة للتنفيذ حيث يتم تثبيت openai أو google-generativeai . على سبيل المثال ، يمكنك استخدام miniconda : export ZSH_CODEX_PYTHON= " $HOME /miniconda3/bin/python " zsh-syntax-highlighting: unhandled ZLE widget 'create_completion'
zsh-syntax-highlighting: (This is sometimes caused by doing `bindkey <keys> create_completion` without creating the 'create_completion' widget with `zle -N` or `zle -C`.)
أضف الخط
zle -N create_completion
قبل استدعاء bindkey ولكن بعد تحميل المكون الإضافي ( plugins=(zsh_codex) ).
fatal: destination path '~.oh-my-zsh/custom/plugins'
حاول تنزيل البرنامج المساعد ZSH مرة أخرى.
git clone https://github.com/tom-doerr/zsh_codex.git ~/.oh-my-zsh/custom/plugins/zsh_codex

نسخة السمك
إحصاءات المرور