Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@hung319/opencode-iflow-cli

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hung319/opencode-iflow-cli

OpenCode plugin for iFlow providing access to Qwen, DeepSeek, Kimi, GLM, and iFlow ROME models with auto-config and headless OAuth support

latest
Source
npmnpm
Version
5.0.2
Version published
Weekly downloads
40
17.65%
Maintainers
1
Weekly downloads
 
Created
Source

OpenCode iFlow CLI Plugin

npm version npm downloads license

OpenCode plugin for iFlow.cn providing access to Qwen, DeepSeek, Kimi, GLM, and iFlow ROME models with auto-configuration and headless OAuth support.

Features

  • Auto-update models: Automatically fetches latest models from iFlow API every time OpenCode runs
  • Auto-configuration: Models are automatically configured, no manual setup needed.
  • Dual authentication: OAuth 2.0 (PKCE) and API Key support.
  • Headless support: Works in SSH, containers, and CI environments with manual code input.
  • Multi-account rotation: Sticky and round-robin strategies for account selection.
  • Automated token refresh and rate limit handling with exponential backoff.
  • Native thinking mode support for GLM-4.x and DeepSeek R1 models.
  • Flexible OAuth: Automatic browser redirect OR manual code input - both work!

Installation

npm install -g @hung319/opencode-iflow-cli

Or add to your opencode.json with specific version:

{
  "plugin": ["@hung319/opencode-iflow-cli@2.0.0"]
}

Then select "iflow" from the provider list when logging in.

That's it! Models are automatically configured. No manual provider configuration needed.

Quick Start

Interactive Mode (with browser)

opencode auth login
# Select: iFlow → Enter  
# Choose: OAuth 2.0 or API Key

Browser will open automatically. Complete authentication and you're done!

Headless Mode (SSH, CI, Containers)

opencode auth login
# Select: iflow (lowercase) → Enter
# Choose: OAuth 2.0
  • Open the displayed URL in your local browser.
  • Complete authentication on iFlow.cn.
  • Copy the callback URL or authorization code.
  • Paste it back into the terminal.

The plugin automatically detects headless environments and adapts accordingly.

Configuration

Optional configuration file at ~/.config/opencode/iflow.json:

{
  "default_auth_method": "oauth",
  "account_selection_strategy": "round-robin",
  "auth_server_port_start": 8087,
  "auth_server_port_range": 10,
  "max_request_iterations": 50,
  "request_timeout_ms": 300000,
  "enable_log_api_request": false
}

Configuration Options

OptionDescriptionDefault
default_auth_methodAuth method (oauth, apikey)oauth
account_selection_strategyRotation strategy (sticky, round-robin)round-robin
auth_server_port_startOAuth callback server starting port8087
auth_server_port_rangeNumber of ports to try10
max_request_iterationsMax iterations to prevent hangs50
request_timeout_msRequest timeout in milliseconds300000
enable_log_api_requestEnable request/response loggingfalse

Environment Variables

All config options can be overridden via environment variables:

export IFLOW_DEFAULT_AUTH_METHOD=oauth
export IFLOW_ACCOUNT_SELECTION_STRATEGY=round-robin
export IFLOW_AUTH_SERVER_PORT_START=8087
export IFLOW_MAX_REQUEST_ITERATIONS=50
export IFLOW_REQUEST_TIMEOUT_MS=300000

Supported Models

Models are automatically configured when you install the plugin:

ModelContextOutputFeatures
iflow-rome-30ba3b256K64KiFlow ROME 30B
qwen3-coder-plus1M64KQwen3 Coder Plus
qwen3-max256K32KQwen3 Max
qwen3-vl-plus256K32KVision support
qwen3-235b-a22b-thinking-2507256K64KThinking mode
kimi-k2128K64KKimi K2
kimi-k2-0905256K64KKimi K2 0905
glm-4.6200K128KThinking + Vision
deepseek-v3128K32KDeepSeek V3
deepseek-v3.2128K64KDeepSeek V3.2
deepseek-r1128K32KReasoning model
qwen3-32b128K32KQwen3 32B

Data Storage

Linux/macOS:

  • Credentials: ~/.config/opencode/iflow-accounts.json
  • Config: ~/.config/opencode/iflow.json

Windows:

  • Credentials: %APPDATA%\opencode\iflow-accounts.json
  • Config: %APPDATA%\opencode\iflow.json

Thinking Models

GLM-4.6

Variants with thinking budgets:

{
  "model": "glm-4.6",
  "variant": "medium"
}

Available variants:

  • low: 1024 thinking tokens
  • medium: 8192 thinking tokens
  • max: 32768 thinking tokens

DeepSeek R1

{
  "model": "deepseek-r1",
  "variant": "medium"
}

Same variant options as GLM-4.6.

Headless Environment Detection

The plugin automatically detects headless environments via:

  • SSH_CONNECTION, SSH_CLIENT, SSH_TTY
  • OPENCODE_HEADLESS
  • CI, CONTAINER
  • Missing DISPLAY on Linux

In headless mode:

  • OAuth URL is displayed for manual opening
  • Browser auto-open is disabled
  • Manual code input is prompted

License

MIT

Disclaimer

This plugin is provided strictly for learning and educational purposes. It is an independent implementation and is not affiliated with, endorsed by, or supported by iFlow.cn. Use of this plugin is at your own risk.

Feel free to open a PR to optimize this plugin further.

Keywords

opencode

FAQs

Package last updated on 08 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts