Desktop app and extension

VS Code extension and the moparmeg CLI — setup with a mop_ key | Moparmeg

The «إضافة VS Code» (VS Code extension, .vsix) card appears on the downloads page only if its file is in the server's release manifest, and the extension's source is not in the repository. What works from the code is the command-line tool in cli/moparmeg.mjs, which talks to the /api/v1 API with an API key starting with mop_.

العربية

On this page
The API keys page with the Create new key panel
The API keys page with the Create new key panel

VS Code extension

The downloads page declares «إضافة VS Code» (VS Code extension) in «.vsix» format as optional: its card is drawn only when the release manifest names it with a SHA-256 checksum and its file exists, and it then downloads from /api/v1/downloads/moparmeg-vscode-extension. The availability rules are the same as in Desktop app.

Not available yet: the extension's source is not in the platform repository, and the repository holds neither its file nor a manifest naming it, so its card does not appear unless the file is uploaded to the server's download source.

What the command-line tool is

The tool is a single file, cli/moparmeg.mjs, which imports the command table and the argument parser from the platform's own code and checks the key's shape with the server's function. It runs on Node (the repository pins version 24). package.json declares the command name moparmeg for this file, but the package is marked private, so it is not published to npm.

Getting the tool file outside the platform repository requires contacting support.

Get an API key

  1. From the dashboard open the «مفاتيح API» (API keys) page (/api-keys).
  2. In the «إنشاء مفتاح جديد» (Create new key) panel type a name in «اسم المفتاح (مثال: تطبيق سطح المكتب)» (Key name, e.g. desktop app).
  3. Under «الصلاحيات» (Scopes) choose what the key may do. Selected by default: every scope except «نشر المشاريع وإلغاء نشرها» (publish, publish and unpublish projects) and «طلب شراء النطاقات ونقلها» (domains:write, buy and transfer domains). deploy needs publish, so pick it deliberately; scopes cannot change after creation.
  4. Press «إنشاء» (Create).
  5. Copy the key immediately: it is shown once and only a fingerprint is stored; if you lose it, create another.

Key shape: mop_ followed by 32 characters of Latin letters, digits, - and _. Of the key commands, an old key created without scopes opens only list, create and generate (it still works for the account check in status). Details in API keys.

Setup and running

  1. Put the key in the environment: in PowerShell $env:MOPARMEG_API_KEY="mop_...", in bash export MOPARMEG_API_KEY=mop_....
  2. Optionally set MOPARMEG_BASE_URL; the default is https://moparmeg-ksa.com.
  3. From the folder containing the tool run node cli/moparmeg.mjs help to see «الأوامر المتاحة» (Available commands), and node cli/moparmeg.mjs <command> --help for one command's help.
  4. Try node cli/moparmeg.mjs list.

The tool never prints the key in any message, including errors. Flags work with a space (--framework nextjs) or with =, and an unknown flag is refused.

Commands

  • list («عرض المشاريع», List projects): up to 50 of your projects with titles, slugs and each project's ID, with a marker for published ones. Needs the projects:read scope.
  • create («إنشاء مشروع جديد», Create a new project): create "Project name" [--framework nextjs|react|html] [--template <id>] [--description <text>], printing the new project's ID. Creation passes the same gates as the dashboard: a title of up to 100 characters, the abuse check, the plan contract (a framework your plan does not include is refused 403 with code STACK_NOT_IN_PLAN) and the project limit; then the starter files are built: a Next.js or React scaffold, or the blank HTML template with no framework. --template takes an id from the templates list (industry templates) and sends it to the server as an industry id: with Next.js or React the scaffold is built for that industry, and with no framework an HTML page for the industry is built (index.html, style.css, script.js). An industry id the server does not know is refused with «قالب المجال المحدد غير موجود» (The selected industry template does not exist), and if the project comes back with no files the tool warns «الخادم لم يُعد ملفّات القالب» (the server returned no template files). Needs projects:write.
  • generate («توليد كود بالـ AI», Generate code with AI): sends the description to /api/v1/ai and prints only the file count, model and tokens; it saves no files to a project or to your machine. Needs ai:chat.
  • deploy («نشر المشروع», Publish a project): deploy <project-id>. It reads the project's files from /api/v1/projects/<id>, then asks to publish those same files and prints «تم النشر» (published) with the address. Needs projects:read and publish, and goes through the same publish path the browser uses: a project you do not own answers «المشروع غير موجود» (Project not found), an edit made between the read and the publish is refused with «تغيّرت نسخة المشروع قبل النشر…» (The project version changed before publishing), and at most 10 publishes per minute. Both create and list print the ID.
  • status («حالة النظام (والحساب إن وُجد مفتاح)», System status and account when a key is set): reads the public health endpoint with no key. With a well-formed key it adds the account name, plan and AI quota; a malformed key does not fail it — the account check is skipped with a notice.
  • templates («عرض القوالب المتاحة», List templates): needs no key.

Exit codes and errors

  • 0: success.
  • 1: the command failed, including «تعذّر الاتصال بـ…» (Could not connect to …) when the server is unreachable.
  • 2: «أمرٌ غير معروف» (Unknown command) with the list of available ones, or an argument error such as «علمٌ غير معروف» (Unknown flag).
  • 3: «لا مفتاح: اضبط MOPARMEG_API_KEY — تسكّه من لوحة مُبَرمِج في /api-keys» (No key: set MOPARMEG_API_KEY — mint it at /api-keys).
  • 4: «شكلُ المفتاح غير صالح — يبدأ بـmop_ ويليه ٣٢ محرفاً. أعد نسخه من /api-keys» (Invalid key shape — mop_ followed by 32 characters; copy it again from /api-keys).

A deleted or unknown key gets «Invalid API key» from the server, and the tool prints «المفتاح مرفوض — اسكك مفتاحاً من /api-keys» (API key refused — mint one at /api-keys). If the server is older than the command, it prints «هذه الأداة تتطلّب إصدار واجهة مبرمج الأحدث» (This command needs a newer API version). See API.

Plans

The key commands (list, create, generate and deploy) pass the API call cap. On «المجانية» (Free) list, create and deploy are refused with «واجهة API البرمجية متاحة في الباقات المدفوعة فقط — خطة المجانية تشمل القوالب الجاهزة والمحرّر المرئي.» (The API is available on paid plans only — the Free plan includes ready templates and the visual editor), and generate is refused before that with code AI_PAID_ONLY and «الذكاء الاصطناعي متاح في الباقات المدفوعة فقط — خطة المجانية تشمل القوالب الجاهزة والمحرّر المرئي.» (AI is available on paid plans only); templates and status still work. A generation that fails on the server does not count against the day's quota. On «الأساسية» (Basic), «المميزة» (Premium), «الاحترافية» (Professional) generate works with the AI quotas below, and key calls per hour are capped at the same number:

  • «المجانية» (Free): no AI requests.
  • «الأساسية» (Basic): 50 AI requests per day.
  • «المميزة» (Premium): 200 AI requests per day.
  • «الاحترافية» (Professional): 1000 AI requests per day.

FAQ

Can I install the tool with npm?

No. package.json declares the moparmeg command, but the package is private and not published; the tool is a file in the platform repository.

Where do I get a --template id?

From moparmeg templates: each line ends with the template id in parentheses. You can combine it with --framework to build that framework's scaffold for the same industry.