Memuat…
Memuat…
Minimalist high-performance terminal coding agent (pi.dev,开源 dari Earendil). Berbicara ke gateway via Anthropic Messages API. Dua cara pakai: interaktif /login (tanpa file), atau config file models.json untuk endpoint custom seperti EdWorks.
{
"$schema": "https://pi.dev/schemas/models.schema.json",
"providers": {
"edworks": {
"baseUrl": "https://api.edworks.my.id/v1",
"apiKey": "edw-live-ISI_KEY_KAMU",
"api": "anthropic-messages",
"models": [
{
"id": "claude-opus-5.5",
"name": "Claude Opus 5.5",
"contextWindow": 1000000,
"maxTokens": 16384,
"input": ["text", "image"],
"reasoning": true
}
]
}
}
}mkdir -p ~/.pi/agent; f=~/.pi/agent/models.json; if [ -f "$f" ]; then cp "$f" "$f.bak"; fi
# MERGE via jq bila ada, lalu node, terakhir tulis baru. Provider lain tetap aman.
MERGED=0
if [ -f "$f" ] && command -v jq >/dev/null 2>&1; then
jq --arg base "https://api.edworks.my.id/v1" --arg key "edw-live-ISI_KEY_KAMU" '.providers = ((.providers // {}) + {edworks: {baseUrl: $base, apiKey: $key, api: "anthropic-messages", models: [{id: "claude-opus-5.5", name: "Claude Opus 5.5", contextWindow: 1000000, maxTokens: 16384, input: ["text","image"], reasoning: true}]}})' "$f" > "$f.tmp" 2>/dev/null && mv "$f.tmp" "$f" && MERGED=1 || rm -f "$f.tmp"
fi
if [ "$MERGED" = "0" ] && command -v node >/dev/null 2>&1; then
node -e 'const fs=require("fs");const p=process.argv[1];let c={};try{c=JSON.parse(fs.readFileSync(p,"utf8"))}catch(e){}c.providers=Object.assign({},c.providers||{},{edworks:{baseUrl:process.argv[2],apiKey:process.argv[3],api:"anthropic-messages",models:[{id:"claude-opus-5.5",name:"Claude Opus 5.5",contextWindow:1000000,maxTokens:16384,input:["text","image"],reasoning:true}]}});fs.writeFileSync(p,JSON.stringify(c,null,2)+"\n")' "$f" "https://api.edworks.my.id/v1" "edw-live-ISI_KEY_KAMU" && MERGED=1
fi
[ "$MERGED" = "1" ] && echo "Config Pi tersimpan (merge — provider lain aman; backup: models.json.bak)" || echo "Tulis manual blok di atas ke $f"curl -s "https://api.edworks.my.id/v1/models" -H "Authorization: Bearer edw-live-ISI_KEY_KAMU"