Skip to content

feat(repl): add --endpoint and --provider for one session's connection - #195

Merged
fuseraft merged 1 commit into
mainfrom
feature/repl-endpoint-flag
Nov 1, 2026
Merged

fuseraft merged 1 commit into
mainfrom
feature/repl-endpoint-flag

Conversation

@fuseraft

@fuseraft fuseraft commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Adds --endpoint and --provider to fuseraft repl, so one session can use a connection other than the one in ~/.fuseraft/config. fuseraft-web needs this to run each account's chats with the model profile that account picked (fuseraft/fuseraft-web#5).

Changes

  • --endpoint <url> and --provider <type> (openai for any OpenAI-compatible API, anthropic, azure, ollama). They apply to this session only and are never saved, even with --save.
  • Either flag replaces both of the config's values. Without that, the config's endpoint could be called as another provider (an xAI URL called as --provider anthropic). With only --endpoint, the model ID's prefix picks the provider, or an OpenAI-compatible API is assumed.
  • Kept across /model and /resume. /provider replaces them, since it sets up a new connection.
  • --vscode mode needs no config file. --model plus FUSERAFT_API_KEY is now a complete setup. Before, a home without a config refused to start with "fuseraft is not configured", so fuseraft-web had to write one into every new account's home.
  • Docs: CLI reference.

Testing

  • ReplFactoryConnectionTests: no flags keeps the config's connection; both flags replace it but keep the key; each flag alone drops the config's other value and resolves to the right default.
  • Live against xAI, through a local logging proxy that forwards to xAI. The CLI never picks that address on its own, so a request reaching it proves the flag was used:
    • --endpoint set to the proxy: replied, and the proxy logged POST /v1/chat/completions.
    • --endpoint set to a dead port: Connection refused (127.0.0.1:9).
    • No flags: replied with nothing at the proxy.
    • --provider anthropic with the proxy: the proxy logged POST /v1/messages, so the provider flag changes the API.
    • After /model grok-4.3, requests still went to the proxy.
    • With a config pointing at a broken endpoint, --endpoint worked and the config file was unchanged.
    • An empty FUSERAFT_HOME in --vscode mode chatted with no config file created.

Release

fuseraft-web passes these flags, and an older CLI rejects them as unknown options. Release this together with wire protocol v1, which fuseraft-web already requires.

`fuseraft repl --endpoint <url> --provider <type>` points one session at a
connection other than the config's, without changing ~/.fuseraft/config.

- Either flag replaces both of the config's values, so the config's endpoint
  is never called as another provider.
- Kept across /model and /resume; /provider replaces them; never saved, even
  with --save.
- In --vscode mode, --model plus FUSERAFT_API_KEY is a complete setup with no
  config file, which is how fuseraft-web runs a chat per account.
@fuseraft
fuseraft merged commit abba58f into main Nov 1, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant