İçeriğe geç

OpenCode CLI kurulumu

OpenCode CLI yapılandırmasını ve OAuth yetkilendirmesini tamamlayın.

Gereksinim: Bilgisayarınızda Node.js kurulu olmalı → nodejs.org/en/download

İşletim sisteminize göre aşağıdaki kodu çalıştırın:

macOS / Linux

Terminal komutu
node - <<'YARGI'
const fs=require("fs"),os=require("os"),path=require("path");
const dir=path.join(os.homedir(),".config","opencode"),file=path.join(dir,"opencode.json");
fs.mkdirSync(dir,{recursive:true});
let cfg={};try{cfg=JSON.parse(fs.readFileSync(file,"utf8"))}catch{}
if(typeof cfg!=="object"||cfg===null||Array.isArray(cfg))cfg={};
if(!cfg["$schema"])cfg["$schema"]="https://opencode.ai/config.json";
if(typeof cfg.mcp!=="object"||cfg.mcp===null)cfg.mcp={};
cfg.mcp["yargi-mcp-pro"]={type:"remote",url:"https://app.yargipro.com/mcp"};
fs.writeFileSync(file,JSON.stringify(cfg,null,2)+"\n");
console.log("yargi-mcp-pro eklendi -> "+file);
YARGI

Windows

powershell
@'
const fs=require("fs"),os=require("os"),path=require("path");
const dir=path.join(os.homedir(),".config","opencode"),file=path.join(dir,"opencode.json");
fs.mkdirSync(dir,{recursive:true});
let cfg={};try{cfg=JSON.parse(fs.readFileSync(file,"utf8"))}catch{}
if(typeof cfg!=="object"||cfg===null||Array.isArray(cfg))cfg={};
if(!cfg["$schema"])cfg["$schema"]="https://opencode.ai/config.json";
if(typeof cfg.mcp!=="object"||cfg.mcp===null)cfg.mcp={};
cfg.mcp["yargi-mcp-pro"]={type:"remote",url:"https://app.yargipro.com/mcp"};
fs.writeFileSync(file,JSON.stringify(cfg,null,2)+"\n");
console.log("yargi-mcp-pro eklendi -> "+file);
'@ | node -

Sonra terminalde:

Terminal komutu
opencode mcp auth yargi-mcp-pro

Tarayıcıda WorkOS OAuth açılır.

← Tüm platformları görüntüle