gangvy be9ad83d13 整理工作区:企微助手新增输出目录标准模块;根目录文档归入 docs;忽略 node_modules 与本地资料 vor 2 Monaten
..
.claude-plugin 96775af9b0 feat(fmode): add fmode-vision/ffmpeg/listen standalone skill packages vor 2 Monaten
bin 96775af9b0 feat(fmode): add fmode-vision/ffmpeg/listen standalone skill packages vor 2 Monaten
scripts 96775af9b0 feat(fmode): add fmode-vision/ffmpeg/listen standalone skill packages vor 2 Monaten
skills be9ad83d13 整理工作区:企微助手新增输出目录标准模块;根目录文档归入 docs;忽略 node_modules 与本地资料 vor 2 Monaten
README.md 96775af9b0 feat(fmode): add fmode-vision/ffmpeg/listen standalone skill packages vor 2 Monaten
package.json 96775af9b0 feat(fmode): add fmode-vision/ffmpeg/listen standalone skill packages vor 2 Monaten
skill-package-manifest.json 96775af9b0 feat(fmode): add fmode-vision/ffmpeg/listen standalone skill packages vor 2 Monaten

README.md

fmode-listen

Claude Code skill + CLI that transcribes audio files via the Fmode gateway (POST /api/listen/transcribe, backed by iFlytek LFASR). iFlytek credentials live only on the server — the client just needs an fmode token, and the server bills by actual audio duration.

Transcribe directly

# transcribe an audio file (auto-probes duration for the pre-check)
npx fmode-listen@latest transcribe -- meeting.mp3

# language + speaker diarization + dump full JSON
npx fmode-listen@latest transcribe -- meeting.mp3 \
  --language autodialect --diarize --speakers 3 --out result.json

# custom gateway (default https://server.fmode.cn/api/listen)
npx fmode-listen@latest transcribe -- meeting.mp3 --gateway https://server.fmode.cn/api/listen

transcribe prints the plain transcript to stdout. Everything after -- is passed through to the runner.

Auth (fmode token only)

The runner resolves the token in this order:

  1. FMODE_API_TOKEN environment variable
  2. ~/.fmode/config.jsonfmodeApiToken / newapiToken (written by FmodeStudio)
  3. ./.fmode/config.jsonfmodeApiToken / newapiToken
  4. ~/.claude/settings.json (plus settings.local.json / project .claude/) → env.ANTHROPIC_AUTH_TOKENthis is Claude Code's sk- token; the runner reads it automatically, no manual config needed. Only accepted when it starts with sk- (real Anthropic sk-ant- is excluded) and the base points to fmode.

A "token not found" error means the token is missing, not that the service is unavailable — do not click any payment/top-up popup; just supply the token via any source above.

Never put iFlytek appId/apiKey/secretKey on the client — they belong to the server only.

Install the Claude Code skill

# project-level → ./.claude/skills/fmode-listen
npx fmode-listen@latest workspace

# user-level → ~/.claude/skills/fmode-listen
npx fmode-listen@latest install

Then prompt Claude Code, e.g. 把 meeting.mp3 转写成文字,开启说话人分离。

Billing

  • Billed by actual audio duration: ceil(minutes) × unit price, minimum 1 minute.
  • The server charges after transcription succeeds (real duration from iFlytek), through the same newapi metering as other Fmode models. The client-supplied duration is only used for the pre-flight balance check.
  • Insufficient balance returns HTTP 402 with a rechargeUrl.

Commands

Command Description
transcribe -- <file> [opts] / run -- ... transcribe an audio file via the gateway
workspace / install install the Claude Code skill
check / smoke / path verify install / run smoke test / print target

Programmatic use

import { transcribeFile, probeDurationMs, resolveApiToken }
  from './skills/fmode-listen/scripts/listen-runner.mjs';

const { text, segments, raw } = await transcribeFile({
  filePath: 'meeting.mp3',
  language: 'autodialect',
  diarize: true,
  speakers: 3,
});

License

MIT