Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
MOTIF_ENDPOINT=https://llm.onerouter.pro/v1
MOTIF_MODEL=motif/motif-3
MOTIF_API_KEY=sk-...

# Morphfactory (BETA): choose /provider in the session or use --provider morphfactory.
# When selecting through this file, replace MOTIF_ENDPOINT above with:
# MOTIF_ENDPOINT=https://api-cbt.morphfactory.io/v1
# Keep each provider's key separate; changing providers preserves the other key.
# MOTIF_MORPHFACTORY_API_KEY=your-morphfactory-key
63 changes: 31 additions & 32 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@
<a href="https://discord.gg/5d99wCtzc"><img src="https://img.shields.io/badge/Join_OpenLab-Discord-5865F2?style=for-the-badge&amp;logo=discord&amp;logoColor=white&amp;labelColor=000000" alt="OpenLab Discord 참여하기"></a>
</p>

> **2026년 9월까지 무료.** Motif-3는 [Infron](https://infron.ai)에서 **Motif: Motif 3 (Free)** 로
> 제공됩니다. 입력·출력 모두 100만 토큰당 $0, 262,144 토큰 컨텍스트 전체가 열려 있고,
> 2026년 9월 말까지 무료 제공이 공지되어 있습니다. 계정과 API 키만 있으면 됩니다.
> `npx motifcode`가 키를 물어본 뒤 `motif` 명령까지 설치해 줍니다.
> 조건은 바뀔 수 있으며, [모델 페이지](https://infron.ai/models/motif/motif-3)가 기준입니다.
> **Provider를 선택하세요.** 처음 실행하면 [Infron](https://infron.ai) 또는
> [Morphfactory (BETA)](https://cbt.morphfactory.io/console?view=keys)를 선택할 수 있습니다.
> 이후에는 `/provider`나 `/config`에서 바꾸며, 각 provider의 API 키는 따로 보관합니다.

> **Motif 공식 프로젝트가 아닙니다.** Motifcode는 독립적인 오픈소스 프로젝트입니다.
> 모티프테크놀로지스(Motif Technologies)나 Infron이 인증·보증·후원·관리하는 저장소가
Expand Down Expand Up @@ -98,7 +96,7 @@ Motifcode는 Claude Code의 모양을 한 터미널 코딩 에이전트입니다
<tr>
<td width="50%" align="center" valign="top">
<img src="docs/screen-login.jpg" alt="첫 실행에서 API 키를 묻는 화면" width="100%"><br>
<sub><b>첫 실행.</b> 프롬프트 자리에서 Infron API 키를 물어보고, 확인한 뒤 한 번만 저장합니다.</sub>
<sub><b>첫 실행.</b> Provider를 선택하고 API 키를 입력하면, 확인한 뒤 한 번만 저장합니다.</sub>
</td>
<td width="50%" align="center" valign="top">
<img src="docs/screen-skills.jpg" alt="/skills 목록" width="100%"><br>
Expand All @@ -124,7 +122,7 @@ cd your-project
npx motifcode # 첫 실행: 키를 물어본 뒤 `motif` 명령 설치까지 해 줍니다
```

첫 세션에서 Infron API 키를 한 번만 물어보고 `~/.motif/.env`에 저장합니다. `npx`는
첫 세션에서 **Infron** 또는 **Morphfactory (BETA)** 를 선택하고, API 키를 한 번만 입력해 `~/.motif/.env`에 저장합니다. `npx`는
명령을 남기지 않으므로 이어서 `npm install -g motifcode`를 대신 실행해 줄지
물어봅니다. 예라고 하면 그다음부터는 어느 폴더에서든 `motif`(또는 `motifcode`)로
세션을 엽니다. 처음부터 `npm install -g motifcode`를 직접 해도 같은 결과입니다.
Expand Down Expand Up @@ -388,32 +386,32 @@ motif plugins connect library-docs

---

## Infron에서 API 키 발급하기
## Provider 선택과 API 키 발급

Motif-3는 Infron의 OpenAI 호환 엔드포인트로 접근합니다. 설정 전체는 base URL, 모델
id, 키 세 가지입니다.
처음 실행하면 Infron 또는 Morphfactory (BETA)를 선택합니다. 기존 사용자의 연결은
유지되며, `/provider`나 `/config`의 provider 항목에서 바꿀 수 있습니다. 두 provider
모두 `motif/motif-3` 모델과 OpenAI 호환 엔드포인트를 사용합니다.

| | |
|---|---|
| base URL | `https://llm.onerouter.pro/v1` |
| 모델 | `motif/motif-3` |
| 키 | `MOTIF_API_KEY` |

1. **[infron.ai/login](https://infron.ai/login)** 에서 이메일이나 Google로 로그인합니다.
2. **[Dashboard → API Keys](https://infron.ai/dashboard/apiKeys)** 를 열고 **Add new key** 를 누릅니다.
3. `motif`를 실행하고, 물어볼 때 키를 붙여 넣습니다. 토큰 하나짜리 요청으로
엔드포인트에 확인한 뒤 `~/.motif/.env`에 저장되고(본인만 읽을 수 있는 권한),
모델에게는 절대 보여 주지 않습니다. 세션 밖에서는 `motif login`이 같은 일을
하고, 세션 안에서는 `/login`과 `/logout`이 있습니다. 환경 변수의
`MOTIF_API_KEY`나 프로젝트 옆의 `.env`도 되고, `--env-file <경로>`는 그 파일을
가장 먼저 읽게 합니다.
4. `motif doctor`가 연결을 확인하고, 서버가 도구 호출과 추론을 어떤 형태로
돌려주는지와 프리픽스 캐시가 켜져 있는지를 보고합니다.

**2026년 9월까지 무료.** 이 글을 쓰는 시점에 Infron은 이 모델을 *Motif: Motif 3
(Free)* 로, 입력·출력 모두 100만 토큰당 $0로 올려 두었고, 2026년 9월 말까지 무료
제공을 공지했습니다. 현재 조건은 [모델 페이지](https://infron.ai/models/motif/motif-3)와
Infron의 [무료 모델 약관](https://infron.ai/docs/overview/free-models)에서 확인하세요.
| provider | base URL | API 키 환경 변수 |
|---|---|---|
| Infron | `https://llm.onerouter.pro/v1` | `MOTIF_API_KEY` |
| Morphfactory (BETA) | `https://api-cbt.morphfactory.io/v1` | `MOTIF_MORPHFACTORY_API_KEY` |

1. [Infron API Keys 대시보드](https://infron.ai/dashboard/apiKeys) 또는
[Morphfactory 콘솔](https://cbt.morphfactory.io/console?view=keys)에서 키를 발급합니다.
2. `motif`를 실행해 provider를 선택하고 키를 붙여 넣습니다. 토큰 하나짜리 요청으로
확인한 뒤 본인만 읽을 수 있는 `~/.motif/.env`에 저장합니다. 키는 따로 보관하므로
provider를 바꾸거나 `/logout`을 해도 다른 provider의 키는 유지됩니다.
3. 스크립트에서는 `motif login --provider morphfactory`로 로그인하고
`motif --provider morphfactory -p "질문"`으로 실행합니다. `--provider infron`은
Infron을 선택하며, 명시한 `--endpoint`와 `--model`이 preset보다 우선합니다.
4. `motif doctor --provider morphfactory`로 연결, 도구 호출, 추론과 프리픽스 캐시를
확인합니다. Infron 계정 잔액은 Infron에서만 지원하며, 로컬 세션 토큰 사용량은
두 provider 모두 볼 수 있습니다.

환경 변수나 프로젝트 `.env`도 지원하며 `--env-file <경로>`는 해당 파일을 먼저 읽습니다.
환경 파일에서 provider를 지정하려면 `MOTIF_ENDPOINT`를 설정합니다. 별도 설정이 없으면
기존과 같이 Infron을 사용합니다.

`.env` 파일에서는 `MOTIF_*` 키만 읽고, 어느 것도 환경 변수로 내보내지 않으며, 무엇이든
실행되기 전에 하네스 자신의 환경에서도 키를 지웁니다. 모델의 `bash`도, 프로젝트 훅도
Expand All @@ -433,7 +431,8 @@ Infron의 [무료 모델 약관](https://infron.ai/docs/overview/free-models)에
| `/doctor` | 엔드포인트 점검: 인증, 파서, 캐시, 채널 |
| `/mcp [list\|connect NAME\|disconnect NAME\|reconnect NAME\|login NAME\|logout NAME]` | MCP 관리 화면에서 프리셋 추가, 연결 상태 조회·제어와 로그인 |
| `/mcp-setup <URL>` | 내장 스킬로 MCP 서버 등록과 연결 확인 |
| `/login`, `/logout` | Infron API 키를 붙여 넣어 확인 후 `~/.motif/.env`에 저장; 저장된 키 삭제 |
| `/provider [infron\|morphfactory]` | 각 provider의 키를 유지하며 provider 선택 |
| `/login`, `/logout` | 선택한 provider의 키를 확인해 `~/.motif/.env`에 저장; 해당 키 삭제 |
| `/model [id]`, `/endpoint [url]` | 다음 작업에 쓸 모델 id나 엔드포인트를 보거나 바꿈 |
| `/channel [toolcall\|object\|raw]` | 행동 채널을 보거나 바꿈; 바꾸면 대화가 새로 시작됨 |
| `/max-turns [n]`, `/max-tokens [n\|off]`, `/seed [n\|off]` | 작업당 상한과 샘플링 시드 |
Expand Down
67 changes: 32 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@
<a href="https://discord.gg/5d99wCtzc"><img src="https://img.shields.io/badge/Join_OpenLab-Discord-5865F2?style=for-the-badge&amp;logo=discord&amp;logoColor=white&amp;labelColor=000000" alt="Join OpenLab on Discord"></a>
</p>

> **Free through September 2026.** Motif-3 is served by [Infron](https://infron.ai) as
> **Motif: Motif 3 (Free)** — $0 per million tokens in and out, the full 262,144-token
> window — and free access has been announced through the end of September 2026.
> An account and an API key are all it takes: `npx motifcode` asks for the key, then installs the `motif` command.
> Terms can change, and the [model page](https://infron.ai/models/motif/motif-3) is the source of truth.
> **Choose your provider.** First launch offers [Infron](https://infron.ai) or
> [Morphfactory (BETA)](https://cbt.morphfactory.io/console?view=keys).
> Switch later with `/provider` or from `/config`; each provider keeps its own API key.

> **Not an official Motif project.** Motifcode is an independent open-source project.
> It is not certified, endorsed, sponsored or maintained by Motif Technologies or by
Expand Down Expand Up @@ -104,7 +102,7 @@ session checked feature by feature against Claude Code's.
<tr>
<td width="50%" align="center" valign="top">
<img src="docs/screen-login.jpg" alt="the first run asks for the API key" width="100%"><br>
<sub><b>First run.</b> The Infron API key is asked for in place of the prompt, checked, and saved once.</sub>
<sub><b>First run.</b> Choose a provider, then paste an API key to check and save once.</sub>
</td>
<td width="50%" align="center" valign="top">
<img src="docs/screen-skills.jpg" alt="the /skills list" width="100%"><br>
Expand All @@ -130,8 +128,8 @@ cd your-project
npx motifcode # first run: asks for your key, then offers to install the `motif` command
```

The first session asks for your Infron API key, once, and saves it to
`~/.motif/.env`. Because `npx` leaves no command behind, it then offers to run
The first session lets you choose **Infron** or **Morphfactory (BETA)**, asks for
your API key once, and saves it to `~/.motif/.env`. Because `npx` leaves no command behind, it then offers to run
`npm install -g motifcode` for you; say yes and `motif` (or `motifcode`) opens
the session from any folder from then on. `npm install -g motifcode` directly
does the same without the question.
Expand Down Expand Up @@ -404,34 +402,32 @@ and a bundle being available does not mean its service is signed in. See

---

## Get an API key from Infron
## Choose a provider and get an API key

Motif-3 is reached over Infron's OpenAI-compatible endpoint. The whole
configuration is a base URL, a model id and a key:
First launch offers Infron and Morphfactory (BETA). Existing sessions keep their
current connection; use `/provider` or the provider row in `/config` to switch.
Both use the model id `motif/motif-3` and an OpenAI-compatible endpoint:

| | |
|---|---|
| base URL | `https://llm.onerouter.pro/v1` |
| model | `motif/motif-3` |
| key | `MOTIF_API_KEY` |

1. Sign in at **[infron.ai/login](https://infron.ai/login)** (email or Google).
2. Open **[Dashboard → API Keys](https://infron.ai/dashboard/apiKeys)** and click **Add new key**.
3. Run `motif` and paste the key when asked. It is checked against the
endpoint with a one-token request, saved to `~/.motif/.env` (readable only
by you), and never shown to the model. `motif login` does the same outside
a session, and `/login` and `/logout` inside one. A `MOTIF_API_KEY` in the
environment or in a `.env` next to the project works too; `--env-file
<path>` puts a file first.
4. `motif doctor` confirms the connection and reports how the server returns
tool calls and reasoning and whether prefix caching is on.

**Free through September 2026.** At the time of writing Infron lists the model
as *Motif: Motif 3 (Free)* at $0 per million tokens for input and output, and
has announced free access through the end of September 2026. Check the
[model page](https://infron.ai/models/motif/motif-3) and Infron's
[free-model terms](https://infron.ai/docs/overview/free-models) for the current
conditions.
| provider | base URL | API key environment variable |
|---|---|---|
| Infron | `https://llm.onerouter.pro/v1` | `MOTIF_API_KEY` |
| Morphfactory (BETA) | `https://api-cbt.morphfactory.io/v1` | `MOTIF_MORPHFACTORY_API_KEY` |

1. Create a key at [Infron's API Keys dashboard](https://infron.ai/dashboard/apiKeys)
or [Morphfactory's console](https://cbt.morphfactory.io/console?view=keys).
2. Run `motif`, choose the provider and paste its key. A one-token request checks
it before saving it to `~/.motif/.env` (readable only by you). Provider keys
are stored separately, so switching or `/logout` preserves the other key.
3. In a script, use `motif login --provider morphfactory`, then
`motif --provider morphfactory -p "your question"`. `--provider infron` selects
Infron; explicit `--endpoint` and `--model` flags override the preset.
4. `motif doctor --provider morphfactory` checks the connection, tool calls,
reasoning and prefix caching. Infron's account balance is only available
with Infron; local session token usage remains available for both providers.

Environment variables or a project `.env` work too; `--env-file <path>` reads
that file first. Set `MOTIF_ENDPOINT` to select a provider through an env file.
Infron remains the default when no provider is configured.

Only `MOTIF_*` keys are read from a `.env` file, none of them are exported, and
the key is removed from the harness's own environment before anything is
Expand All @@ -451,7 +447,8 @@ spawned — the agent's `bash` cannot see it, and neither can a project hook.
| `/doctor` | probe the endpoint: auth, parsers, cache, channels |
| `/mcp [list\|connect NAME\|disconnect NAME\|reconnect NAME\|login NAME\|logout NAME]` | open the MCP manager to add a preset, or inspect, control and sign in to a connection |
| `/mcp-setup <URL>` | use the built-in skill to register and check an MCP server |
| `/login`, `/logout` | paste an Infron API key, checked and saved to `~/.motif/.env`; remove the saved key |
| `/provider [infron\|morphfactory]` | choose a provider, preserving each provider's key |
| `/login`, `/logout` | check and save the selected provider's key to `~/.motif/.env`; remove that saved key |
| `/model [id]`, `/endpoint [url]` | show or set the model id or endpoint for the next task |
| `/channel [toolcall\|object\|raw]` | show or set the action channel; changing it restarts the conversation |
| `/max-turns [n]`, `/max-tokens [n\|off]`, `/seed [n\|off]` | per-task ceilings and the sampling seed |
Expand Down
25 changes: 16 additions & 9 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,33 @@ A Claude Code-style terminal session — transcript above, prompt below, `/` com
a permission prompt, a `.motif/` directory behind it — whose tool set, prompt layout, parser and
failure handling follow from what is measurably true about Motif-3.

> **Free through September 2026.** Motif-3 is served by [Infron](https://infron.ai) at $0 per
> million tokens, with free access announced through the end of September 2026. Terms can change;
> the [model page](https://infron.ai/models/motif/motif-3) is the source of truth.
> **Choose your provider.** First launch offers [Infron](https://infron.ai) or
> [Morphfactory (BETA)](https://cbt.morphfactory.io/console?view=keys).
> Switch later with `/provider` or `/config`; each provider keeps its own API key.

> **Not an official Motif project.** Not certified, endorsed, sponsored or maintained by Motif
> Technologies or by Infron. *Motif* and *Motif-3* are their names; this package is a client of the model.

```bash
cd your-project
npx motifcode # asks for your Infron API key once, then offers to install the `motif` command
npx motifcode # choose a provider and enter its API key once, then offers to install the `motif` command
```

Or `npm install -g motifcode` directly; either way `motif` (or `motifcode`) opens the session
from any folder afterwards, with the key saved in `~/.motif/.env`.

1. Sign in at [infron.ai/login](https://infron.ai/login), open [Dashboard → API Keys](https://infron.ai/dashboard/apiKeys), click **Add new key**.
2. Run `motif` and paste the key when asked. It is checked against the endpoint, saved to
`~/.motif/.env` (readable only by you), and never shown to the model. `motif login` does the
same outside a session; `/login` and `/logout` inside one.
3. `motif doctor` reports what the endpoint returns: structured tool calls, reasoning, prefix caching.
1. Create an API key at [Infron's dashboard](https://infron.ai/dashboard/apiKeys) or
[Morphfactory's console](https://cbt.morphfactory.io/console?view=keys).
2. Run `motif`, choose the provider and paste its key. It is checked against the endpoint,
saved to `~/.motif/.env` (readable only by you), and never shown to the model. Use
`/provider` to switch, or `/login` and `/logout` to manage the selected provider's key.
3. Outside a session, use `motif login --provider morphfactory` and
`motif doctor --provider morphfactory`. `--provider infron` selects Infron.

The environment keys are `MOTIF_API_KEY` for Infron and `MOTIF_MORPHFACTORY_API_KEY`
for Morphfactory. Use `--provider morphfactory` for a single invocation, or choose
with `/provider` to save the selection. Explicit `--endpoint` and `--model` flags
still override a provider preset.

```bash
motif # interactive session in the current directory
Expand Down
Loading
Loading