mirror of
https://github.com/jackwener/OpenCLI.git
synced 2026-09-14 18:25:42 +08:00
c42b040af4
* Rename chatgpt adapters: desktop → chatgpt-app, web → chatgpt Aligns with existing `-app` suffix convention (discord-app, doubao-app): - clis/chatgpt/ (desktop, AppleScript) → clis/chatgpt-app/ - clis/chatgptweb/ (browser, chatgpt.com) → clis/chatgpt/ - electron-apps.ts: chatgpt → chatgpt-app - Updated all docs and README references Closes #283 * Fix review findings: update cli-manifest.json and skill docs - cli-manifest.json: update site/modulePath/sourceFile from chatgpt to chatgpt-app - skills/opencli-usage/desktop.md: update commands from chatgpt to chatgpt-app
25 lines
960 B
JavaScript
25 lines
960 B
JavaScript
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
import { ConfigError } from '@jackwener/opencli/errors';
|
|
import { activateChatGPT, selectModel, MODEL_CHOICES } from './ax.js';
|
|
export const modelCommand = cli({
|
|
site: 'chatgpt-app',
|
|
name: 'model',
|
|
description: 'Switch ChatGPT Desktop model/mode (auto, instant, thinking, 5.2-instant, 5.2-thinking)',
|
|
domain: 'localhost',
|
|
strategy: Strategy.PUBLIC,
|
|
browser: false,
|
|
args: [
|
|
{ name: 'model', required: true, positional: true, help: 'Model to switch to', choices: MODEL_CHOICES },
|
|
],
|
|
columns: ['Status', 'Model'],
|
|
func: async (page, kwargs) => {
|
|
if (process.platform !== 'darwin') {
|
|
throw new ConfigError('ChatGPT Desktop integration requires macOS');
|
|
}
|
|
const model = kwargs.model;
|
|
activateChatGPT();
|
|
const result = selectModel(model);
|
|
return [{ Status: 'Success', Model: result }];
|
|
},
|
|
});
|