IRIS App CLI Reference
Overview
The Magentrix CLI (@magentrix-corp/magentrix-cli) is the primary tool for linking Vue projects, running the development server, building, publishing, and managing the full lifecycle of IRIS Apps. All deployment operations must go through the CLI.
| Command | Description |
|---|
magentrix setup | Configure credentials — API key and instance URL |
magentrix pull | Download existing workspace files from the server |
magentrix publish | Push local changes to the server |
magentrix autopublish | Watch for file changes and publish automatically |
magentrix iris-app-link | Manage the link between a Vue project and the CLI |
magentrix vue-run-dev | Start the Vue dev server with platform assets injected |
magentrix vue-run-build | Build a linked Vue project and stage it for publishing |
magentrix iris-app-delete | Safely delete a published IRIS App with automatic backup |
magentrix iris-app-recover | Restore a deleted IRIS App from its automatic backup |
magentrix config | Manages the CLI settings |
magentrix create | Creates a new Active Class, Active Trigger, or Active Page file |
magentrix status | Check the sync status |
magentrix update | Update to the latest version of the CLI tool |
magentrix --version | Displays the currently installed version of the CLI tool |
Installation
Install globally (recommended):
npm install -g @magentrix-corp/magentrix-cli
Or install locally in your project:
npm install @magentrix-corp/magentrix-cli
With a local installation, prefix all commands with npx:
npx magentrix <command>
Verify installation:
magentrix --version
Update to the latest version:
npm update -g @magentrix-corp/magentrix-cli@latest
or
magentrix update
💡 Note: Your configuration and local files are preserved during updates. You do not need to run magentrix setup again after updating unless the release notes indicate breaking changes.
First-Time Setup
Step 1 — Configure Credentials
Run the setup wizard from your Magentrix workspace directory:
magentrix setup
You will be prompted for your API Key and instance URL. For CI/CD automation, supply credentials directly as flags:
magentrix setup --api-key YOUR_API_KEY --instance-url https://yourcompany.magentrix.com
The CLI stores credentials per-folder. To manage multiple Magentrix instances, run magentrix setup in separate workspace directories.
Step 2 — Pull Files
Download your existing server files into the workspace:
magentrix pull
This creates the following directory structure under src/:
src/
├── Classes/ # Utility classes (*.ac files)
├── Controllers/ # Controllers (*.ctrl files)
├── Triggers/ # Trigger files (*.trigger files)
├── Pages/ # ASPX pages (*.aspx files)
├── Templates/ # Templates (*.aspx files)
├── Contents/
│ └── Assets/ # Static assets (images, CSS, JS, etc.)
└── iris-apps/ # IRIS App deployments
└── <app-slug>/ # Each app in its own folder
Vue Project Configuration
Every IRIS App Vue project requires two configuration files.
src/config.ts — App Metadata
export const config = {
appSlug: "my-app",
appName: "My Application",
appDescription: "",
appIconId: ""
}
| Field | Required | Accepted Aliases | Description |
|---|
appSlug | Yes | slug, app_slug | App identifier — used as the folder name on the server and in the navigation URL. |
appName | Yes | app_name, name | Display name shown in the portal navigation menu. |
appDescription | No | app_description | App description. |
appIconId | No | app_icon_id | App icon ID. |
The CLI searches for the config file in these locations in order: src/config.ts, config.ts, src/iris-config.ts, iris-config.ts.
⚠️
Warning: Changing
appSlug creates a
new app on the server. The old app is not automatically deleted. See
Changing an App Slug below for the correct workflow.
.env.development — Environment Variables
VITE_SITE_URL = https://yourinstance.magentrix.com
VITE_REFRESH_TOKEN = your-api-key
VITE_ASSETS = '[]'
VITE_ASSETS is automatically populated by magentrix vue-run-dev with portal CSS, font paths, and theme styles. Do not set this value manually.
Command Reference
magentrix setup
Configures CLI credentials for the current workspace directory. Stores the API key and instance URL locally. Run this once per workspace directory.
magentrix setup
# Non-interactive (CI/CD)
magentrix setup --api-key YOUR_API_KEY --instance-url https://yourcompany.magentrix.com
magentrix pull
Downloads all files from the Magentrix instance into the local src/ directory. Always run pull before making changes, especially when working in a team.
magentrix pull
magentrix publish
Pushes local file changes to the Magentrix server. Detects changes using content hash tracking — unchanged files are skipped. Used to deploy changes to controllers (.ctrl), utility classes (.ac), triggers, and staged IRIS App bundles to your Magentrix portal.
magentrix publish
⚠️ Warning: Always run magentrix pull before magentrix publish to avoid conflicts, especially in a team environment.
After publishing changes (controllers, utility classes), hard refresh the browser to clear cached responses:
- Windows / Linux:
Ctrl+Shift+R - macOS:
Cmd+Shift+R
magentrix autopublish
Watches the workspace for file changes and publishes automatically whenever a change is detected. Used together with magentrix vue-run-build for a real-time deployment workflow.
# Terminal 1 — start autopublish watcher
magentrix autopublish
# Terminal 2 — build and stage after making changes
magentrix vue-run-build
# Autopublish detects staged changes and uploads automatically
magentrix iris-app-link
Manages the link between a Vue.js project and the CLI. Linked projects are stored globally and persist across workspaces.
magentrix iris-app-link
| Flag | Description |
|---|
--cleanup | Removes invalid (non-existent) linked projects |
--list | Shows all linked projects |
--path <dir> | Specifies the Vue project path directly, skipping the interactive menu |
--unlink | Removes a linked project |
Without flags, opens an interactive menu with options to link a Vue project, view all linked projects, unlink a project, and clean up invalid projects.
magentrix vue-run-dev
Starts the Vue development server with portal assets (CSS, fonts, theme variables) automatically injected from your Magentrix instance. This is the only correct way to start the dev server — running npm run dev directly bypasses asset injection and leaves all --mag-* CSS variables undefined.
magentrix vue-run-dev
| Flag | Description |
|---|
--no-inject | Skips asset injection and runs the dev server normally. Use only when debugging injection itself. |
--path <dir> | Specifies the Vue project path directly |
This command uses VITE_REFRESH_TOKEN from .env.development for authentication. It can be run from the Vue project directory without CLI credentials configured for the workspace.
Process on each run:
- Fetches portal stylesheet URLs from the Magentrix instance using
.env.development credentials - Writes the URLs into
VITE_ASSETS in .env.development - Runs
npm run dev
⚠️ Warning: Always use magentrix vue-run-dev — never npm run dev directly. Without asset injection, all --mag-* CSS variables are undefined and the app renders without any portal theming.
magentrix vue-run-build
Builds a linked Vue project and copies the output bundle into src/iris-apps/<app-slug>/ in the Magentrix workspace, ready for publishing.
magentrix vue-run-build
| Flag | Description |
|---|
--path <dir> | Specifies the Vue project path directly |
--skip-build | Uses the existing dist/ folder without rebuilding. Useful when you have already built manually. |
--workspace <dir> | Specifies the Magentrix workspace path when running from a Vue project directory |
This command works from two locations:
- From the Magentrix workspace — prompts for which linked Vue project to build and stages the output into the current workspace
- From the Vue project directory — prompts for which Magentrix workspace to stage into
Build process:
- Select from linked projects or enter path manually
- Run
npm run build in the Vue project - Validate the build output
- Copy to
src/iris-apps/<app-slug>/ — excludes index.html and favicon.ico - Check workspace sync status and prompt to pull if out of sync
- Prompt to publish to Magentrix
magentrix iris-app-delete
Safely deletes a published IRIS App. Automatically creates a recovery backup before deletion.
magentrix iris-app-delete
Process:
- Select the app from the list of published apps
- Review the destructive action warning
- Confirm by typing the exact app slug
- Optionally unlink the associated Vue project
- Create a recovery backup in
.magentrix/iris-backups/ - Delete from the server and local files
- Update the cache
⚠️ Warning: Never manually delete folders from src/iris-apps/. Manual deletion bypasses the backup, leaves an orphaned app on the server, corrupts the local cache, and does not unlink the Vue project. Always use magentrix iris-app-delete.
magentrix iris-app-recover
Restores a deleted IRIS App from its automatic backup.
magentrix iris-app-recover
| Flag | Description |
|---|
--list | Shows all available recovery backups |
Process:
- Select a backup to restore (sorted by deletion time, most recent first)
- Check if the linked Vue project path still exists
- Restore files to
src/iris-apps/<slug>/ - Re-link the Vue project if the path exists
- Show warnings for any edge cases
- Optionally delete the backup after recovery
- Run
magentrix publish to sync the restored app back to the server
💡 Note: After recovery, you must run magentrix publish to sync the restored app back to the Magentrix server. Recovery only restores the local files — it does not automatically re-publish.
Workflows
First-Time Project Setup
# 1. Create the Vue project from the template
npm create @magentrix-corp/iris-app-template@latest
cd <my-app>
npm install
# 2. Link the Vue project to the CLI (one-time)
magentrix iris-app-link
# 3. Start the dev server
magentrix vue-run-dev
Daily Development
cd ~/my-vue-app
magentrix vue-run-dev # Start dev server with portal assets injected
# Make changes and test locally
# Ctrl+C to stop
Deploying an IRIS App
Option A — from the Vue project directory:
cd ~/my-vue-app
magentrix vue-run-build
# Prompted: "Do you want to publish to Magentrix now?" → Yes
Option B — from the Magentrix workspace:
cd ~/magentrix-workspace
magentrix vue-run-build --path ~/my-vue-app
# Prompted: "Do you want to publish to Magentrix now?" → Yes
Deploying Files (Controllers, Utility Classes)
cd ~/magentrix-workspace
magentrix pull # Always pull first
# Make changes to .ctrl or .ac files
magentrix publish # Push changes to server
# Hard refresh browser: Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (macOS)
Real-Time Deployment with Autopublish
# Terminal 1 — start watcher
magentrix autopublish
# Terminal 2 — build and stage; autopublish picks up the change
magentrix vue-run-build
Changing an App Slug
Changing appSlug in config.ts creates a brand new app on the server — it does not rename the existing one. Follow this workflow to rename correctly:
# 1. Delete the old app (creates a backup automatically)
cd ~/magentrix-workspace
magentrix iris-app-delete # Select the old app and confirm
# 2. Update appSlug in your Vue project's src/config.ts
# 3. Re-link the project with the new slug
magentrix iris-app-link
# 4. Build and publish under the new slug
magentrix vue-run-build # Stages to: src/iris-apps/new-slug/
If you change the slug without following this workflow, both the old and new apps will exist on the server. Use magentrix iris-app-delete to remove the orphaned old app.
Troubleshooting
| Error | Cause & Resolution |
|---|
| Authentication failed | API key or instance URL is incorrect. Run magentrix setup again. |
| Publishing IRIS Apps from an out-of-sync workspace is not allowed | Run magentrix pull from the workspace, then re-run vue-run-build. |
| No Magentrix workspaces found | When running from a Vue project, the CLI needs a registered workspace. Navigate to the workspace and run any command, or use --workspace <path> to specify the path directly. |
| Missing required field in config.ts: slug (appSlug) | Add an appSlug or slug field to config.ts. |
| Missing required field in config.ts: appName | Add an appName field to config.ts. |
| VITE_SITE_URL not set in .env.development | Create a .env.development file with VITE_SITE_URL = https://yourinstance.magentrix.com. |
| No config.ts found | The CLI searches: src/config.ts, config.ts, src/iris-config.ts, iris-config.ts. Ensure one of these paths exists. |
| Changes not detected after vue-run-build | The CLI uses content hash tracking. If you rebuild without changes, publish reports "All files are in sync." This is expected behaviour. |
| Duplicate apps after changing slug | The old app is orphaned on the server. Run magentrix iris-app-delete and select the old app. See Changing an App Slug. |
| Permission error when deleting IRIS App folder | The app has already been deleted from the server and cache. Delete the local folder manually: Linux or macOS: rm -rf src/iris-apps/<app-slug>
Windows: rmdir /s /q src\iris-apps\<app-slug>
|
What to Read Next