Files
archived-orca/src/cli/specs/speech.ts
T
Neil d563f8e0e0 feat(speech): set the OpenAI dictation key on a headless host (#31230)
* feat(speech): set the OpenAI dictation key on a headless host (orca speech openai-key)

Cloud dictation needs an OpenAI key on the host that transcribes, and
desktop Settings was the only way to save one. A headless orca serve or
managed server had none. speech.openAiKey.{status,set,clear} save it
through the host's existing key store and secret sealing; the CLI reads
the key from stdin so it never lands in shell history.

* fix(cli): name the update when an older server lacks the speech key methods; one key length cap; PowerShell example (Opus review)
2026-10-20 15:12:28 -07:00

34 lines
1.2 KiB
TypeScript

import type { CommandSpec } from '../args'
import { GLOBAL_FLAGS } from '../args'
export const SPEECH_COMMAND_SPECS: CommandSpec[] = [
{
path: ['speech', 'openai-key', 'status'],
summary: 'Show whether this host has an OpenAI key for cloud voice dictation',
usage: 'orca speech openai-key status [--json]',
allowedFlags: [...GLOBAL_FLAGS],
examples: ['orca speech openai-key status --json']
},
{
path: ['speech', 'openai-key', 'set'],
summary: 'Save the OpenAI key cloud voice dictation uses on this host, read from stdin',
usage: 'orca speech openai-key set [--json] < key-file',
allowedFlags: [...GLOBAL_FLAGS],
notes: [
'Reads the key from stdin so it never lands in shell history or a process list.',
'The host that runs dictation seals it, so a headless `orca serve` host can use it.'
],
examples: [
'printf %s "$OPENAI_API_KEY" | orca speech openai-key set',
'$env:OPENAI_API_KEY | orca speech openai-key set'
]
},
{
path: ['speech', 'openai-key', 'clear'],
summary: 'Remove the OpenAI key cloud voice dictation uses on this host',
usage: 'orca speech openai-key clear [--json]',
allowedFlags: [...GLOBAL_FLAGS],
examples: ['orca speech openai-key clear']
}
]