jackwener/OpenCLI · error · ConfigError

ChatGPT Desktop integration requires macOS (osascript is not

Error message

ChatGPT Desktop integration requires macOS (osascript is not available on this platform)

What it means

The `chatgpt-app status` command checks whether the ChatGPT Desktop app is running via `osascript -e 'application "ChatGPT" is running'`. On non-macOS platforms osascript does not exist, so it throws this ConfigError before executing anything.

Source

Thrown at clis/chatgpt-app/status.js:16

import { execSync } from 'node:child_process';
import { cli, Strategy } from '@jackwener/opencli/registry';
import { CommandExecutionError, ConfigError } from '@jackwener/opencli/errors';
export const statusCommand = cli({
    site: 'chatgpt-app',
    name: 'status',
    access: 'read',
    description: 'Check if ChatGPT Desktop App is running natively on macOS',
    domain: 'localhost',
    strategy: Strategy.PUBLIC,
    browser: false,
    args: [],
    columns: ['Status'],
    func: async () => {
        if (process.platform !== 'darwin') {
            throw new ConfigError('ChatGPT Desktop integration requires macOS (osascript is not available on this platform)');
        }
        try {
            const output = execSync("osascript -e 'application \"ChatGPT\" is running'", { encoding: 'utf-8' }).trim();
            return [{ Status: output === 'true' ? 'Running' : 'Stopped' }];
        }
        catch {
            throw new CommandExecutionError('Error querying ChatGPT application state');
        }
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Run on macOS
  2. Use `chatgpt` browser commands' health/status flows on other platforms
  3. Add a platform check to your monitoring script and skip/alert accordingly

Example fix

// before
setInterval(() => execSync('opencli chatgpt-app status'), 60000);
// after
setInterval(() => { if (process.platform === 'darwin') execSync('opencli chatgpt-app status'); }, 60000);
Defensive patterns

Strategy: validation

Validate before calling

if (process.platform !== 'darwin') {
  console.warn('chatgpt-app status unsupported here; skipping');
}

Type guard

const isMacOS = (): boolean => process.platform === 'darwin';

Try / catch

try {
  const st = execSync('opencli chatgpt-app status').toString();
} catch (e) {
  if (String(e.message).includes('requires macOS')) return 'unsupported-platform';
  throw e;
}

Prevention

When it happens

Trigger: Running `opencli chatgpt-app status` on Linux or Windows; the platform guard at the top of statusCommand throws.

Common situations: Monitoring scripts deployed to Linux servers; containerized environments; users unaware the -app subcommand family is macOS-only.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/c60a6e684a35b028. Report an issue: GitHub.