Magic Suite CLI
magicsuite is the command-line interface to Magic Suite. It reads and writes Magic Suite data through the Magic Suite API, manages files, switches tenants and talks to Merlin, from a terminal, a script or an AI assistant.
Full documentation: https://docs.magicsuite.net/AdvancedTopics/Cli
Installation
The CLI is a .NET global tool and needs the .NET 10 SDK or later. Check with dotnet --list-sdks, and download the SDK from https://dotnet.microsoft.com/download/dotnet/10.0 if you need it.
# Install
dotnet tool install -g MagicSuite.Cli
# Upgrade
dotnet tool update -g MagicSuite.Cli
# Uninstall
dotnet tool uninstall -g MagicSuite.Cli
Close the terminal and open a new one after installing the .NET SDK or the tool. A terminal that was already open does not see the new magicsuite command, and magicsuite will be reported as not recognised until you reopen it (on Windows, a new Command Prompt, PowerShell or Windows Terminal window).
Check that it is installed:
magicsuite --version
magicsuite --help
If installation fails with Package MagicSuite.Cli is not compatible with net9.0, install the .NET 10 SDK first.
Signing in
The CLI signs in with an API token, not your password. Create one in Magic Suite on the My API Tokens page, /myapitokens in any Magic Suite app (for example https://www.magicsuite.net/myapitokens). You get a token name and a token key; the key is shown once, so copy it then.
A profile holds one environment's API URL and token. The production API URL is https://api.magicsuite.net.
# Create a profile with its API URL and token in one step
magicsuite config profiles add production --api-url https://api.magicsuite.net --token-name my-token-name --token-key my-token-key
# Make it the profile commands use by default
magicsuite config profiles set-active production
# Check the credentials work (this calls the API)
magicsuite auth status
Or let the wizard ask for each value:
magicsuite config init
The wizard asks, in order:
- Profile name: a label of your own, such as
production,alpha3orlocal. It is stored only on your machine and is what you give to--profile; it does not have to match anything in Magic Suite. - API URL: the address of the Magic Suite API. The production API is
https://api.magicsuite.net; other environments follow the patternhttps://api.<environment>.magicsuite.net, for examplehttps://api.test2.magicsuite.net. Ask your administrator if you are not sure which one you need. - API token name and 4. API token key: the two values from the My API Tokens page described above. The key is hidden as you type. Either can be left empty and set later with
magicsuite auth token. - Default tenant (optional): a tenant code, ID or GUID. If you skip it, commands use the tenant your account is currently in, which
magicsuite tenant currentshows. - Set as active profile?: the active profile is the one commands use when you do not give
--profile. Answer yes for the environment you use most. - Default output format:
tableorjson, used when you do not give--format.
The wizard does not test the credentials; run magicsuite auth status afterwards.
You can also set or replace the token on an existing profile:
magicsuite auth token --name my-token-name --key my-token-key --profile production
Signing in with your Microsoft account
If your Magic Suite administrator has set up browser sign-in for the CLI, you can sign in with your Microsoft account (multi-factor authentication included) instead of an API token. You need the application (client) ID they give you:
magicsuite auth login --client-id 00000000-0000-0000-0000-000000000000 --profile production
Your browser opens to the Microsoft sign-in page; when you finish, the CLI stores a Magic Suite session in the profile. magicsuite auth status shows whether a profile uses an API token or a browser session. The client ID is remembered in the profile (or set MAGICSUITE_AZURE_CLIENT_ID).
A profile that also has an API token keeps using the token. A browser session expires: when it does, the CLI says so and tells you to run magicsuite auth login again. If sign-in fails or you close the browser, the profile is left exactly as it was. magicsuite auth logout removes the session as well as the token.
Choosing the environment every time
--profile works on every command, before or after the subcommand. Name the profile explicitly in scripts and when handing the CLI to an AI assistant, so a command never runs against whichever profile happens to be active:
magicsuite api get reportschedules --profile production
Credentials from the environment
For CI/CD, credentials can come from environment variables instead of a profile:
export MAGICSUITE_API_URL="https://api.magicsuite.net"
export MAGICSUITE_TOKEN_NAME="automation-token"
export MAGICSUITE_TOKEN_KEY="your-token-key"
magicsuite api get tenants
Precedence is: options on the command line (--api-url, --token-name, --token-key), then environment variables, then the profile.
A profile' token is only ever sent to that profile's own API URL. If you give --api-url for a different environment, you must also give --token-name and --token-key (or the matching environment variables); the CLI refuses rather than send another environment's token. Every command prints Using profile <name> (<API URL>) on the error stream so you can see which environment it is about to use; --quiet hides it.
Commands
Every command has built-in help, which is always the most up-to-date reference:
magicsuite --help
magicsuite api --help
magicsuite api get --help
The command groups are config, auth, api, tenant, file, watch, feedback, merlin and macro.
Data goes to the standard output; status messages, hints and errors go to the standard error. So magicsuite api get tenants --format json > tenants.json captures only the JSON, and a failed command leaves the file empty rather than full of usage text.
config: profiles and settings
# List profiles, and see which one is active
magicsuite config profiles list
# Add a profile (or overwrite one)
magicsuite config profiles add test --api-url https://api.test.magicsuite.net
# Switch the active profile
magicsuite config profiles set-active test
# Remove a profile
magicsuite config profiles remove test
# Show, read and change settings
magicsuite config list
magicsuite config get default-format
magicsuite config set default-format json
# Change a profile's API URL or default tenant
magicsuite config set api-url https://api.test.magicsuite.net --profile test
magicsuite config set default-tenant ACME --profile production
config get reads default-format (table or json), verbose-logging and active-profile. config set changes default-format and verbose-logging, and a profile's api-url and default-tenant; name the profile with --profile, or the active profile is changed. config profiles list shows each profile's API URL, and config profiles set-active changes the active profile.
Copy all your profiles to a file, and restore them, with:
magicsuite config export my-profiles.json
magicsuite config import my-profiles.json
The file holds your token keys in plain text, so keep it somewhere safe. import replaces the whole store (after backing it up); export will not overwrite an existing file unless you add --force.
auth: credentials
# Store a token on the active profile
magicsuite auth token --name my-token-name --key my-token-key
# Show who you are signed in as, and test the connection
magicsuite auth status
# Remove the stored token from a profile
magicsuite auth logout --profile test
api: read and change data
The api commands work on any Magic Suite entity type: magicsuite api --help lists them all. Entity type names are singular or plural (tenant or tenants).
# List entities (100 by default)
magicsuite api get reportschedules
# Choose the fields, the order and the page
magicsuite api get reportschedules --select Id,Name,IsEnabled --orderby "-Id" --take 20 --skip 20
# Name contains "Logic"
magicsuite api get connections --filter Logic
# JSON output, for scripts and AI assistants
magicsuite api get connections --select Id,Name --format json
# Write the output to a file
magicsuite api get reportschedules --format json --output schedules.json
# One entity by ID, with a related entity expanded
magicsuite api get-by-id reportschedule 123 --expand Tenant
--filter takes either text, which matches on name, or Property:value, which matches that property exactly (--filter Id:42, --filter IsSuspended:true). For report macro results, --filter ReportJobId:944 lists the results of one report job. A filter the entity cannot apply is refused with an explanation, never silently ignored.
# Exact match on a property
magicsuite api get reportmacroresultaggregation --filter ReportJobId:944 --take 20 --orderby "-Id"
magicsuite api --help ends with a link to the Swagger page of your environment, which documents every entity.
Create and change entities with --set Property=Value, repeated once per property. There is no JSON body option: every value is a --set.
# Create
magicsuite api create reportschedule --set Name="Daily Report" --set IsEnabled=true
# Change some properties (PATCH, so everything else is left alone)
magicsuite api patch reportschedule 123 --set Name="Weekly Report" --set IsEnabled=false
# Delete, with a confirmation prompt
magicsuite api delete reportschedule 123
# Delete without the prompt, for scripts
magicsuite api delete reportschedule 123 --confirm
Tenants and people cannot be deleted from the CLI; use Admin in Magic Suite.
Start a schedule, re-run a batch job or run a DataMagic sync, the way the Run button in the web app does:
# Run a report schedule now, and wait for it to finish
magicsuite api execute reportschedule 123 --wait --timeout-seconds 600 --profile production
# Pass batch variables to the run
magicsuite api execute reportschedule 123 --variable Region=EMEA --variable Year=2026
# Run a batch job's schedule again, with the batch job's own variables
magicsuite api execute reportbatchjob 456 --wait --format json
# Run a DataMagic sync
magicsuite api execute datamagicsync 7 --wait
Without --wait the command starts the run and returns. With it, the exit code is 0 when the run succeeds (or only warns), 1 when it fails and 2 when --timeout-seconds passes first.
A whole configuration graph (for example an AlertMagic integration and everything under it) can be exported to a JSON document and imported again, which is how configuration is kept as code:
magicsuite api export eventmanager 42 --output integration.jsonc
magicsuite api import eventmanager 42 --file integration.jsonc
Imports resolve connections by ID, then by name, and --take/--skip need --orderby.
What an AlertMagic export looks like
api export eventmanager writes one JSON document per version: the connection settings, then the Constants, Calculations and IncidentSpecs (each with its mappings and actions) that make up the integration. This is an abridged example. The expressions and the payload field names in them (alert.severity, alert.name) are illustrative: yours depend on the alert source.
{
"AlertManagementSystemConfig": { "Type": "NoAction", "Username": "N/A" },
"IncidentManagementSystemConfig": { "Type": "NoAction", "Username": "N/A" },
"Version": "2026-10-01T09:00:00",
"AccountIdentifier": "Example integration",
"Constants": [
{ "Key": "highSeverity", "Value": "4", "Comment": "Severity at or above which an incident is raised" }
],
"Calculations": [
{ "Key": "isHigh", "Expression": "[alert.severity] >= {{highSeverity}}", "Comment": "True for alerts that need an incident", "IsCached": true }
],
"IncidentSpecs": [
{
"Name": "Raise incidents for high severity",
"Condition": "{{isHigh}}",
"CreateCondition": "true",
"StopProcessingIfConditionMet": false,
"Mappings": [
{ "Field": "Summary", "Expression": "'Alert: ' + [alert.name]", "Condition": "true", "Comment": "" }
],
"Actions": [
{ "Name": "Create the incident", "Condition": "true", "Action": "true", "ExecutionTrigger": "OnCreated" }
]
}
],
"Name": "Version 4"
}
Constants are substituted into expressions as {{key}}, and so are calculations, which are evaluated once per notification. A test can pin the clock with SimulatedTime, which is exported and imported with the rest of the test.
What a ConnectMagic export looks like
api export sync writes a configuration document: the state data sets, and for each connected system its datasets and the mappings between the system's fields and the state. The connection is found by connectionId, or by connectionName when you import into another environment. This is an abridged example.
{
"configuration": {
"name": "Devices to ServiceNow",
"description": "Keeps ServiceNow configuration items in step with monitored devices",
"version": "v1",
"stateDataSets": [ "Devices" ],
"connectedSystems": [
{
"name": "Monitoring",
"description": "The monitoring system",
"connectionName": "My monitoring connection",
"isEnabled": true,
"loopPeriodicitySeconds": 300,
"datasets": [
{
"name": "Devices",
"description": "Every monitored device",
"stateDataSetName": "Devices",
"isEnabled": true,
"queryConfig": { "type": "Query", "query": "devices", "idField": "id" },
"mappings": [
{ "name": "Name", "direction": "In", "systemExpression": "displayName", "stateExpression": "name" }
]
}
]
}
]
}
}
direction is In (system to state), Out (state to system) or Join.
Meraki DataMagic data (read-only)
The Meraki data DataMagic collects for your tenant can be read with api get, api get-by-id and api aggregate. It cannot be changed: create, patch and delete are refused before anything is sent. Your user, or the user behind your API token, needs the DataMagic read permission on one of its roles (tenant administrators have it).
| Entity set | What it holds |
|---|---|
DataMagicMerakiOrganizations |
Meraki organizations DataMagic collects from |
DataMagicMerakiNetworks |
Networks, with organization, group and tags |
DataMagicMerakiDevices |
Devices, with status, model, firmware and network |
DataMagicMerakiDeviceHistories |
Changes to each device's status and other properties |
DataMagicMerakiNetworkClients |
Clients seen on each network |
DataMagicMerakiNetworkClientHistories |
Client connection history (needs a date range on PeriodStart) |
DataMagicMerakiNetworkEvents |
Network events (needs a date range on OccurredAt) |
DataMagicMerakiNetworkEventTypes |
The event types Meraki reports |
DataMagicMerakiWirelessHealth |
Wireless health measurements (needs a date range on MeasuredAt) |
DataMagicMerakiWirelessFailedConnections |
Failed wireless connections (needs a date range on OccurredAt) |
DataMagicMerakiSensorData |
MT sensor readings (needs a date range on MeasuredAt) |
DataMagicMerakiAccessPointSsids |
SSIDs broadcast by each access point |
DataMagicMerakiApplianceVlans |
VLANs on security appliances |
DataMagicMerakiConfigTemplates |
Configuration templates |
DataMagicMerakiConfigurationChanges |
The Meraki configuration change log |
DataMagicMerakiFloorPlans |
Floor plans |
DataMagicMerakiPorts |
Switch ports and their status |
DataMagicMerakiVpnPeers |
Site-to-site VPN peers and reachability |
DataMagicMerakiWanInterfaceUsage |
WAN uplink usage |
DataMagicMerakiMacVendors |
MAC address vendors and priorities |
DataMagicMerakiSubscriptions |
Meraki subscriptions |
DataMagicMerakiSubscriptionEntitlements |
Entitlements within each subscription |
DataMagicMerakiCotermLicenses |
Co-termination licenses |
DataMagicMerakiOrganizationLicenses |
Per-device licenses, with state and expiry dates |
DataMagicMerakiEoxes |
Cisco end-of-sale and end-of-support dates per device model |
DataMagicMerakiSensorDataAggregations |
Hourly sensor roll-ups (needs a date range on MeasuredAtHour) |
DataMagicMerakiWebHookEvents |
Meraki alerts received by webhook |
For these sets --filter is an OData $filter, so any property can be compared, and --select and --orderby are applied by the server. Sets marked as needing a date range must be given --from and --to, at most 31 days apart; they become a filter on that set's date column. A response holds at most 1,000 rows and the CLI follows the server's next links, so --take 0 reads everything that matches.
# Offline devices, with the columns you want
magicsuite api get DataMagicMerakiDevices --filter "Status eq 'offline'" --select Name,Serial,NetworkName,Status
# Networks whose name contains "Branch", as JSON
magicsuite api get DataMagicMerakiNetworks --filter "contains(Name,'Branch')" --take 0 --format json
# One day of network events for one network, newest first
magicsuite api get DataMagicMerakiNetworkEvents --from 2026-10-01 --to 2026-10-02 --filter "NetworkName eq 'Branch 12'" --orderby "-OccurredAt" --take 500
# A device by its id (DataMagic ids are GUIDs)
magicsuite api get-by-id DataMagicMerakiDevices 5b0f0c1e-6a43-4c39-9d0e-0b1f2c3d4e5f
# Hourly network event counts per network for a week
magicsuite api aggregate network-events --from 2026-10-01 --to 2026-10-08 --group-by TimeSeriesByNetwork
# Hourly client counts for networks starting "Branch"
magicsuite api aggregate client-history --from 2026-10-01 --to 2026-10-02 --network-starts-with Branch --format json
Credentials DataMagic holds, such as an organization's Meraki API key and SNMP community, are never returned.
tenant: which tenant you are working in
# Show the current tenant
magicsuite tenant current
# Switch tenant by code, ID or GUID (Super Admin only)
magicsuite tenant select ACME
# List every tenant (Super Admin only)
magicsuite tenant list --format json
Super Admins can also scope a single api get with --tenant ACME, or see every tenant with --include-all-tenants.
api-token: regenerate an API token's key
# Regenerate token 42's key into ./keys/<token name>.txt
magicsuite api-token regenerate 42 --output-folder ./keys
# A Super Admin can regenerate a token in any tenant
magicsuite api-token regenerate 42 --output-folder ./keys --include-all-tenants
The old key stops working at once. The new key is written only to the file, which contains the key and nothing else, with no trailing newline; it is never shown on the console. The folder must already exist, an existing file is never overwritten, and the token the CLI is signed in with is refused. Find token IDs with magicsuite api get ApiTokens.
file: the Magic Suite file store
# List a folder (the root if no path is given)
magicsuite file list /Library
# Upload, replacing any existing file
magicsuite file upload report.rmscript /Library/Reports/report.rmscript --force
# Download
magicsuite file download /Library/Reports/report.rmscript ./report.rmscript
# Search by name, optionally under one folder
magicsuite file search budget --path /Library
# Create, rename or move, and copy
magicsuite file create-folder /Library/Archive
magicsuite file rename /Library/old.rmscript /Library/Archive/old.rmscript
magicsuite file copy /Library/Reports /Library/Archive/Reports
# Delete, with a prompt unless --confirm is given
magicsuite file delete /Library/Archive/old.rmscript --confirm
watch: live events
Watch what Magic Suite is doing as it happens, for example report jobs being updated as they run:
magicsuite watch --subject ReportJob --type Update --timeout-seconds 300
macro: what each ReportMagic macro does
# Find macros by words in their name, purpose or summary
magicsuite macro list --search replace
# Everything about one macro: purpose, usage, every parameter and the examples
magicsuite macro show SearchAndReplace
# The same as JSON, for scripts and AI assistants
magicsuite macro show SearchAndReplace --format json --quiet
macro show lists each parameter with whether it is optional or mandatory, its type, default and allowed values, then the examples with their expected output.
feedback: tell us something
magicsuite feedback --summary "Export is slow" --description "Exporting 500 schedules took ten minutes" --rating 3
merlin: talk to the Magic Suite AI assistant
# An interactive conversation
magicsuite merlin chat --profile production
# One question, answered and then exit
magicsuite merlin chat --prompt "How many report schedules do I have?"
# Several turns in one conversation
magicsuite merlin chat --prompt "What is ReportMagic?" --prompt "Which macros draw graphs?"
# Prompts from a file (one per line; blank lines and # comments ignored), transcript saved
magicsuite merlin chat --script questions.txt --transcript conversation.md
While chatting, /new starts a fresh session, /history shows what will be sent, /save <file> saves the transcript, /raw shows the raw requests and responses, and /exit leaves.
The CLI uses the same Merlin endpoint as the chat panel in the browser, with one difference: the browser also sends the page you are looking at, and the CLI has no page. Questions such as "what am I looking at?" therefore behave differently here.
Using the CLI in Visual Studio Code
The CLI works well in the integrated terminal (Ctrl+`), and the Magic Suite extension adds RMScript highlighting, diagnostics and a Run RMScript command.
Terminal. Open the integrated terminal in your project folder. If you work in several environments, name the profile on every command rather than relying on the active one.
magicsuite api get tenants --profile production
Tasks. Put the commands you repeat in .vscode/tasks.json, so they run from Terminal > Run Task and can be shared with your team:
{
"version": "2.0.0",
"tasks": [
{
"label": "Magic Suite: check sign-in",
"type": "shell",
"command": "magicsuite auth status --profile production",
"problemMatcher": []
},
{
"label": "Magic Suite: export tenants",
"type": "shell",
"command": "magicsuite api get tenants --format json --quiet --output tenants.json --profile production",
"problemMatcher": []
}
]
}
Output. --output <file> writes a result to a file in the workspace, where VS Code can search and format it; --format json --quiet gives clean JSON for scripts. Errors and status messages go to the error stream, so they never end up inside the file.
Environments and credentials. Give a task its environment with --profile, or set MAGICSUITE_API_URL, MAGICSUITE_TOKEN_NAME and MAGICSUITE_TOKEN_KEY in terminal.integrated.env.* in your user settings (not in a file you commit).
Problems. --verbose shows more detail when a command fails. magicsuite <command> --help shows every option, and a failed command exits non-zero, so a task shows as failed.
Options that work on every command
| Option | Purpose |
|---|---|
--profile <name> |
The profile (environment) to use |
--format <format> |
Output format: table (the default) or json |
--output <file> |
Write the output to a file instead of the console |
--quiet |
Suppress status messages, leaving only the data |
--verbose |
Show detailed diagnostic output |
--tenant <tenant> |
Tenant code or ID to work in, overriding the profile's default tenant |
--api-url, --token-name, --token-key |
Credentials for this command only, overriding the profile |
Using the CLI from an AI assistant
The CLI is a good way to let an AI assistant work with Magic Suite for you. Tell it to:
- always pass
--profile <name>, so it cannot run against the wrong environment; - use
--format json --quiet, so it reads data rather than console decoration; - use
--selectto ask only for the fields it needs; - run
magicsuite <command> --helpwhen unsure, rather than guessing options.
The API token decides what the assistant can see and change: give it a token for an account with only the access it needs.
Configuration file
Profiles are stored in cli-config.json in the user's application data folder:
- Windows:
%APPDATA%\Panoramic Data\MagicSuite\cli-config.json - Linux and macOS:
~/.config/Panoramic Data/MagicSuite/cli-config.json
The file holds your token keys, so treat it like a password. Set MAGICSUITE_CLI_CONFIG_DIR to a folder to keep cli-config.json and its backups there instead, for example to give a CI job its own set of profiles.
Every write first copies the previous file to a backups folder beside it (the 20 most recent are kept), and a write that would leave the store with no profiles at all is refused. If a profile store is ever damaged or lost, restore one of the copies in backups, or use config import with a file you made earlier with config export.
Getting help
magicsuite --help, and--helpon any command- Documentation: https://docs.magicsuite.net/AdvancedTopics/Cli
- Report a problem:
magicsuite feedback, or contact Panoramic Data support
Copyright Panoramic Data Limited. Licensed under the MIT licence.