{"record":{"id":"c60a6e684a35b028","repo":"jackwener/OpenCLI","slug":"chatgpt-desktop-integration-requires-macos-osascr-c60a6e","errorCode":null,"errorMessage":"ChatGPT Desktop integration requires macOS (osascript is not available on this platform)","messagePattern":"ChatGPT Desktop integration requires macOS \\(osascript is not available on this platform\\)","errorType":"validation","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"clis/chatgpt-app/status.js","lineNumber":16,"sourceCode":"import { execSync } from 'node:child_process';\nimport { cli, Strategy } from '@jackwener/opencli/registry';\nimport { CommandExecutionError, ConfigError } from '@jackwener/opencli/errors';\nexport const statusCommand = cli({\n    site: 'chatgpt-app',\n    name: 'status',\n    access: 'read',\n    description: 'Check if ChatGPT Desktop App is running natively on macOS',\n    domain: 'localhost',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [],\n    columns: ['Status'],\n    func: async () => {\n        if (process.platform !== 'darwin') {\n            throw new ConfigError('ChatGPT Desktop integration requires macOS (osascript is not available on this platform)');\n        }\n        try {\n            const output = execSync(\"osascript -e 'application \\\"ChatGPT\\\" is running'\", { encoding: 'utf-8' }).trim();\n            return [{ Status: output === 'true' ? 'Running' : 'Stopped' }];\n        }\n        catch {\n            throw new CommandExecutionError('Error querying ChatGPT application state');\n        }\n    },\n});\n","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/chatgpt-app/status.js#L1-L27","documentation":"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.","triggerScenarios":"Running `opencli chatgpt-app status` on Linux or Windows; the platform guard at the top of statusCommand throws.","commonSituations":"Monitoring scripts deployed to Linux servers; containerized environments; users unaware the -app subcommand family is macOS-only.","solutions":["Run on macOS","Use `chatgpt` browser commands' health/status flows on other platforms","Add a platform check to your monitoring script and skip/alert accordingly"],"exampleFix":"// before\nsetInterval(() => execSync('opencli chatgpt-app status'), 60000);\n// after\nsetInterval(() => { if (process.platform === 'darwin') execSync('opencli chatgpt-app status'); }, 60000);","handlingStrategy":"validation","validationCode":"if (process.platform !== 'darwin') {\n  console.warn('chatgpt-app status unsupported here; skipping');\n}","typeGuard":"const isMacOS = (): boolean => process.platform === 'darwin';","tryCatchPattern":"try {\n  const st = execSync('opencli chatgpt-app status').toString();\n} catch (e) {\n  if (String(e.message).includes('requires macOS')) return 'unsupported-platform';\n  throw e;\n}","preventionTips":["Guard monitoring scripts with a darwin check","Alert on 'unsupported platform' distinctly from 'app stopped'","Prefer browser-based chatgpt health checks on Linux/Windows"],"tags":["macos","platform-check","config-error","desktop-app"],"backgroundTag":"unsupported-platform","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}