Skip to content

Commit f47e806

Browse files
committed
initial release
1 parent c3567af commit f47e806

25 files changed

Lines changed: 1638 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Bun
19+
uses: oven-sh/setup-bun@v2
20+
21+
- name: Setup just
22+
uses: extractions/setup-just@v2
23+
24+
- name: Install dependencies
25+
run: bun install --frozen-lockfile
26+
27+
- name: Run checks
28+
run: just check
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Update Models
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
update-models:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Bun
19+
uses: oven-sh/setup-bun@v2
20+
21+
- name: Setup just
22+
uses: extractions/setup-just@v2
23+
24+
- name: Fetch models
25+
id: fetch
26+
run: just fetch-models
27+
continue-on-error: true
28+
29+
- name: Check for changes
30+
id: check_changes
31+
run: |
32+
if git diff --quiet models.json; then
33+
echo "changed=false" >> $GITHUB_OUTPUT
34+
else
35+
echo "changed=true" >> $GITHUB_OUTPUT
36+
fi
37+
38+
- name: Commit and push
39+
if: steps.check_changes.outputs.changed == 'true'
40+
run: |
41+
git config user.name "github-actions[bot]"
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
git add models.json
44+
git commit -m "chore: update models [skip ci]"
45+
git push
46+
47+
- name: Fail if fetch had missing models
48+
if: steps.fetch.outcome == 'failure'
49+
run: |
50+
echo "❌ fetch-models exited non-zero: some hub models are missing from models.dev"
51+
exit 1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# CoreInfra OpenCode Plugin
2+
3+
Плагин для [OpenCode](https://opencode.ai), который добавляет [CoreInfra AI Hub](https://hub.coreinfra.ai/) в качестве внешнего провайдера моделей.
4+
5+
## Что это
6+
7+
CoreInfra AI Hub — это платформа доступа к AI-моделям с тарификацией в рублях. Плагин интегрирует Hub с OpenCode и позволяет использовать модели OpenAI и Anthropic напрямую из CLI через инфраструктуру CoreInfra.
8+
9+
## Установка
10+
11+
```bash
12+
# Установка плагина
13+
opencode plugin -g 'coreinfra-opencode-plugin@github:CoreInfraAI/opencode-plugin'
14+
# Авторизация с вводом API-ключа
15+
opencode providers login --provider coreinfra
16+
```
17+
18+
Во время авторизации потребуется API-ключ CoreInfra AI Hub.
19+
20+
## Возможности
21+
22+
- **Актуальный список моделей** — каталог динамически загружается из API Hub при каждом запуске и всегда отражает его текущее состояние.
23+
- **Модели OpenAI и Anthropic** — поддерживаются обе линейки, включая GPT-5.x и Claude 4.x.
24+
- **Поддержка reasoning** — для моделей Anthropic автоматически включается режим `interleaved thinking`.
25+
26+
## Ограничения
27+
28+
На данный момент OpenCode поддерживает только цены в долларах.
29+
Поэтому стоимость пока не переопределяется: OpenCode показывает цены из исходного API OpenAI/Anthropic.
30+
31+
## Использование
32+
33+
После установки и авторизации модели будут доступны с префиксом `coreinfra/`:
34+
35+
```bash
36+
opencode run -m coreinfra/gpt-5.4-nano
37+
opencode run -m coreinfra/claude-sonnet-4-20250514
38+
```
39+
40+
Посмотреть список всех доступных моделей:
41+
42+
```bash
43+
opencode models coreinfra
44+
```
45+
46+
## Поддерживаемые модели
47+
48+
Полный список моделей определяется содержимым Hub на момент запуска. Плагин поддерживает все модели, перечисленные на странице:
49+
https://hub.coreinfra.ai/pricing
50+
51+
## Разработка
52+
Форматирование кода:
53+
54+
```bash
55+
just fmt
56+
```
57+
58+
Полная проверка проекта:
59+
60+
```bash
61+
just check
62+
```

biome.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.4.11/schema.json",
3+
"files": {
4+
"includes": ["**", "!dist", "!node_modules"]
5+
},
6+
"formatter": {
7+
"indentStyle": "space"
8+
},
9+
"javascript": {
10+
"formatter": {
11+
"quoteStyle": "double",
12+
"semicolons": "always",
13+
"trailingCommas": "all"
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)