Skip to main content

Getting Started with Swif CLI

Overview

Swif CLI is a command-line tool that lets IT admins and engineers manage devices, check compliance, see the results of commands and scripts, and retrieve agent installer information, all from the terminal. It supports multiple environments, structured output for automation, and secure browser-based authentication.

Get it from npm, or in the Swif portal, at MCP > Swif CLI.

Requirements

  • Package installers (PKG, MSI, ZIP, EXE, tar.gz, binary): no Node.js or npm needed.

    • macOS: Apple silicon (arm64) or Intel (x64)

    • Windows: x64 or ARM64

    • Linux: x64 or ARM64, on a glibc-based distribution, such as Ubuntu, Debian, or RHEL

  • npm installation: Node.js 24 or later (LTS recommended), and npm

  • A Swif account with team access. You need Team Admin access to see the installer downloads on the Swif CLI page.

Installation

Swif CLI comes as standalone packages for macOS, Windows, and Linux, so you don't need Node.js or npm. This makes it easy to deploy on machines that aren't set up for developers. npm is still available as an option.

To get the latest download links and commands for your device, go to Swif portal > MCP > Swif CLI. Pick your operating system tab (macOS, Windows, or Linux) and your processor type (arm64 or x64). Every file name, download link, and command on the page changes to match. Each command has a copy button.

Note: The examples below use version 1.0.8. For newer versions, use the links in the Swif portal, or run swif update.

Choose the right package

Platform

Check with

Result → Package

macOS

uname -m

arm64 → Apple silicon (arm64) · x86_64 → Intel (x64)

Linux

uname -m

aarch64 or arm64 → arm64 · x86_64 → x64

Windows

Settings > System > About

x64 or ARM64

Available packages

Platform

Architecture

Type

File (v1.0.8)

Windows

x64 / ARM64

MSI installer

Windows

x64 / ARM64

Portable ZIP

Windows

x64 / ARM64

Standalone EXE

macOS

arm64 / x64

PKG installer

Linux

x64 / ARM64

tar.gz

Linux

x64 / ARM64

Standalone binary

Install on macOS

You can install with the graphical installer, in Terminal, with npm, or silently through MDM. Swif CLI installs to /usr/local/bin/swif.

Graphical install

  1. Download the PKG that matches your Mac's processor.

  2. Double-click the file.

  3. Follow the macOS Installer prompts.

  4. Enter your administrator password when asked.

Terminal install (Apple silicon shown; for Intel Macs, replace arm64 with x64)

curl -fLO https://cdn.swifteam.com/st-cli/1.0.8/macos/swif-cli-1.0.8-darwin-arm64.pkg
sudo installer -pkg swif-cli-1.0.8-darwin-arm64.pkg -target /
swif --version

Silent install (MDM)

To deploy to managed Macs through your MDM, run:

/usr/sbin/installer -pkg /path/to/swif-cli.pkg -target /

Verify package integrity (optional)

For Intel Macs, replace arm64 with x64.

curl -fLO https://cdn.swifteam.com/st-cli/1.0.8/macos/SHA256SUMS
grep "swif-cli-1.0.8-darwin-arm64.pkg" SHA256SUMS | shasum -a 256 -c -
pkgutil --check-signature swif-cli-1.0.8-darwin-arm64.pkg
spctl --assess --type install -vv swif-cli-1.0.8-darwin-arm64.pkg

Uninstall

sudo rm -f /usr/local/bin/swif

Install on Windows

You can install with the MSI installer, the portable ZIP, the standalone EXE, npm, or silently through MDM. The MSI installs to C:\Program Files\Swif\swif.exe.

MSI installer

  1. Download the MSI that matches your processor (x64 or ARM64).

  2. Run the installer, and follow the prompts.

Portable ZIP / Standalone EXE

Download the ZIP, and extract it, or the EXE. Run swif.exe directly, or add its folder to your system PATH, so you can run swif from any terminal.

Silent install (MDM)

msiexec.exe /i "swif-cli-1.0.8-windows-x64.msi" /qn /norestart

For ARM64 devices:

msiexec.exe /i "swif-cli-1.0.8-windows-arm64.msi" /qn /norestart

Verify the installation (PowerShell)

& "C:\Program Files\Swif\swif.exe" --version

Install on Linux

You can install with the tar.gz package, the standalone binary, npm, or silently through a script. The Linux packages are built for glibc-based distributions, such as Ubuntu, Debian, and RHEL. Swif CLI installs to /usr/local/bin/swif.

tar.gz / Silent install (x64 shown; for ARM64, replace x64 with arm64)

curl -fLO https://cdn.swifteam.com/st-cli/1.0.8/linux/swif-cli-1.0.8-linux-x64.tar.gz
tar -xzf swif-cli-1.0.8-linux-x64.tar.gz
sudo install -m 0755 swif /usr/local/bin/swif
swif --version

Standalone binary

curl -fLO https://cdn.swifteam.com/st-cli/1.0.8/linux/swif-1.0.8-linux-x64
sudo install -m 0755 swif-1.0.8-linux-x64 /usr/local/bin/swif
swif --version

Verify package integrity (optional)

curl -fLO https://cdn.swifteam.com/st-cli/1.0.8/linux/SHA256SUMS
grep "swif-cli-1.0.8-linux-x64.tar.gz" SHA256SUMS | sha256sum -c -

Each binary and archive also has a matching .asc GPG signature, for signature checks. For example, SHA256SUMS.asc.

Install with npm (all platforms)

If Node.js is already installed, you can use npm:

npm install -g @swif-ai/cli
swif --version


Updating Swif CLI

Starting with version 1.0.7, Swif CLI can update itself. You can update by hand with swif update, and Swif CLI also checks for new versions on its own, in the background.

Check for updates

swif update --check

  • If you have the latest version, you see: Swif CLI is up to date (1.0.8)

  • If a newer version is out, you see, for example: Update available: 1.0.7 → 1.0.8. Run swif update to install it.

Checking doesn't download or install anything.

For scripts and automation, add --json:

swif update --check --json

This prints only valid JSON, with the version details, status, and download URL. It has no colors, progress bars, or banners.

Install an update

swif update

Platform

What to expect

macOS

Enter your administrator password when asked. Swif CLI replaces the binary at /usr/local/bin/swif.

Windows

Approve the User Account Control (UAC) prompt. The installer runs, and replaces the files in C:\Program Files\Swif\.

Linux

Swif CLI installs to /usr/local/bin, so swif update asks for your sudo password to replace the binary. In scripts, or other non-interactive shells, run sudo swif update. If you installed Swif CLI to a folder you can write to without admin rights, such as ~/.local/bin, it may have already updated itself in the background. If so, you see ✔ Update installed.

To confirm the update, run:

swif --version

If you run swif update when you already have the latest version, it tells you you're up to date, and makes no changes.

To see all update options, run swif update --help.

Automatic updates

Swif CLI checks for new versions in the background, so your commands don't slow down. What happens next depends on how you installed it:

  • npm installs: the update installs silently. The next command you run shows a green ✔ Update installed.

  • Package installs (PKG, MSI, and Linux installs in /usr/local/bin): after a command finishes, a yellow notice appears, such as ⬆ Update available 1.0.7 → 1.0.8 · Run swif update. It appears at most once every 24 hours. Linux installs in a folder you can write to without admin rights, such as ~/.local/bin, update silently, and the next command you run shows a green ✔ Update installed.

To keep scripts and pipelines from breaking, the update notice never appears when:

  • a command uses --json

  • output is piped, for example, swif whoami | cat

  • Swif CLI is running in CI

Turn off automatic updates

Change these settings in ~/.swif/config.toml:

Setting

Effect

auto_update = false

Stops automatic installs. You still see the update notice.

update_check = false

Stops all update checks and notices.

To turn off all checks and notices without editing the file, for example, on CI runners, set this environment variable:

SWIF_NO_UPDATE_CHECK=1

Check your installation with swif doctor

swif doctor

This shows a table with:

  • CLI version: the version you have installed

  • Install method: npm, standalone, pkg, or msi

  • Latest version: the newest version available

  • Auto-update: enabled or disabled


Authentication

Swif CLI uses secure browser-based login. Each session is tied to a profile, matching your Swif environment: us, eu, or dev.

Log in

swif login --profile us

Swif CLI uses browser login by default. In a headless or restricted environment, use device-code login instead:

swif login --device-auth --profile us

For CI, or non-interactive use:

swif --no-input login --device-auth --profile us

Check your session

swif auth status --json
swif whoami --profile us

Log out

swif logout --profile us

Logging out clears your saved session for that profile.


Profiles and Context

Swif CLI supports multiple environment profiles. You can work with us, eu, or dev, and each keeps its own session and team context.

List available contexts

swif context list --profile us

Show active context

swif context show --profile us

Switch context

swif context use <team-id> --profile us


Device Management

List devices

View all devices in your team:

swif device list --profile us

Filter devices with any combination of these flags:

Flag

Description

--owner <email>

Filter by device owner

--os <os>

Filter by operating system

--device-type <type>

Filter by device type

--compliant

Show only compliant devices

--non-compliant

Show only non-compliant devices

--agent-status

Show devices with an active agent

--no-agent

Show devices with no agent installed

--has-serial

Show devices with a serial number

--no-serial

Show devices without a serial number

Example:

swif device list --profile eu --os macOS --compliant

Get device details

swif device get <device-id-or-serial> --profile us

Check device status

swif device status <device-id-or-serial> --profile us

Assign a device

Assign an unassigned device to a team member:

swif device assign <device-id-or-serial> --employee user@company.com --profile us

Reassign a device

Move a device to a different team member:

swif device reassign <device-id-or-serial> --employee newuser@company.com --profile us

Unassign a device

Remove the current owner from a device:

swif device unassign <device-id-or-serial> --profile us

All write commands fail safely. For example, assigning a device that's already assigned, or unassigning a device with no owner, returns a clear error message, without changing anything.


Device Auditing

The device audit command creates report-style results, for fleet oversight:

swif device audit --unassigned --profile us
swif device audit --non-compliant --profile eu
swif device audit --mdm-pending --profile us
swif device audit --no-agent --profile us

You can combine audit flags with --owner, --os, and --device-type, for more targeted results:

swif device audit --non-compliant --os windows --profile us --output json

When no devices match, the CLI shows a clear summary, instead of a blank table.


Employee Management

Manage your team's employee records from the terminal: list, get, create, update, and delete employees.

List employees

swif employee list --profile us

Get employee details

Get an employee by ID or email:

swif employee get <employee-id-or-email> --profile us

Create an employee

Create an employee from a JSON file:

swif employee create --file employee.json --profile us

Example employee.json:

{
"firstName": "CLI",
"lastName": "Test User",
"emails": ["cli-test@example.com"],
"position": "QA",
"department": "Engineering",
"isActive": true
}

Update an employee

Update an employee from a JSON file:

swif employee update <employee-id> --file employee-update.json --profile us

Example employee-update.json:

{
"firstName": "CLI Updated",
"lastName": "Test User Updated",
"emails": ["cli-test-updated@example.com"],
"position": "Senior QA",
"department": "QA"
}

Delete an employee

Remove an employee from your team. Use --confirm to skip the confirmation question:

swif employee delete <employee-id> --confirm --profile us


Command and Script Reports

See the results of commands and scripts you've run on devices from the Swif console, including each run's output. Requires Swif CLI 1.0.8 or later. To update, run swif update.

List runs

swif report list --profile us

Runs are listed newest first, one row per device, from the last 30 days, for your active team. The table shows Command, Device, Status, Started, and Completed. Long values are shortened.

Filter runs with any combination of these flags:

Flag

Description

--status <status>

Filter by status, such as in-queue, received, completed, or error. Run swif report list --help for every status.

--device <serial-number>

Only runs on this device

--search <keyword>

Runs whose command name, or details, match the keyword

--from <YYYY-MM-DD> and --to <YYYY-MM-DD>

Only runs in this date range

--all

Include runs older than 30 days

--team <team-id>

Use this team, instead of your active team

--limit <n> and --offset <n>

Show results a page at a time

--wide

Show full values, the command Type, and the Report ID you need for swif report get

--json or --jsonl

Structured output, for scripts

Examples:

swif report list --profile eu --status error
swif report list --profile us --device C02XL0GHJGH5 --from 2026-11-01 --to 2026-11-15
swif report list --profile us --search "disk cleanup" --wide

If nothing matches, you see No matching reports.

Get one run's details

Find the run's Report ID with swif report list --wide. It looks like <commandId>:<runId>.

swif report get <report-id> --profile us

This shows the command, its type, the device, the status, when it was created, started, and completed, and a Result section, with the script's output and errors.

Terminal color codes in script output are removed, so it's easy to read. To get the output exactly as the device returned it, including those codes, add --json:

swif report get <report-id> --profile us --json


Agent Installer Lookup

Get the latest Swif agent installer URL for an operating system, for scripted deployments and automation. Starting with CLI version 1.0.6, installer names changed from TrustClaw to Agentic Security.

swif agent installer latest --os mac --profile us
swif agent installer latest --os windows --profile eu
swif agent installer latest --os linux-arm64 --profile us
swif agent installer latest --os AgenticSecurityLinuxARM64 --profile us
swif agent installer latest --os AgenticSecurityWindowsX64 --profile us --json

Supported OS values

Installer

Values

MDM agent

mac, windows, linux-x64, linux-arm64

Agentic Security

AgenticSecurityMacOSARM64, AgenticSecurityWindowsX64, AgenticSecurityLinuxX64, AgenticSecurityLinuxARM64

The installer URL comes from Swif's release information, not a fixed download path, so it always points to the current release.

With --json, the output is valid JSON, with the url, version, and os.


Output Formats

Most commands support structured output, for scripting and automation:

Flag

Format

--output json or --json

JSON object

--output jsonl or --jsonl

Newline-delimited JSON

(default)

Human-readable table

Example:

swif device list --profile us --output json
swif agent installer latest --os mac --profile eu --json

swif report get --json keeps a script's output exactly as the device returned it. The table view removes terminal color codes, to make it easier to read.

Non-interactive mode

For CI/CD pipelines and automated scripts, use --no-input to turn off all interactive prompts. The CLI exits with a non-zero code if it would normally need your input.


Troubleshooting

Issue

Resolution

Login fails to open the browser

The CLI tries ports 8765–8769 for the browser callback. If all are in use, it switches to device-code login automatically.

"No employee matched" error

The email doesn't exist in the active team context. Check the email address, and your current profile.

Empty device list

Check that you're logged in to the right profile, and that your team has enrolled devices in that environment.

Installer won't run, or shows "bad CPU type"

You probably downloaded the wrong package for your processor. Run uname -m (macOS or Linux), or check Settings > System > About (Windows), then download the matching package.

swif command not found after the ZIP or EXE install

Add the folder that contains swif.exe to your system PATH, or run it with its full path.

Can't see installer downloads in the portal

The installer list is only available to Team Admins. Ask a Team Admin for access.

Checksum check fails

Download the package again from the Swif portal, and check that the file name in the grep command matches the file you downloaded.

swif --version shows the old version after updating on Windows

Close the terminal, and open a new one. The current session still uses the old version.

The update notice doesn't appear

This is expected when you use --json, pipe output, or run in CI. It also appears at most once every 24 hours. To check right away, run swif update --check.

swif update fails

Approve the administrator password prompt (macOS, or sudo on Linux), or the UAC prompt (Windows). The update needs admin rights to replace the installed file. On Linux, without a terminal, such as in a script, run sudo swif update.

swif report isn't a recognized command

Update to Swif CLI 1.0.8 or later, with swif update. Check with swif --version.

No matching reports.

No runs match your filters. By default, only the last 30 days are shown. Add --all, or a date range with --from and --to. Check --team, or your active context.

swif report list says a status isn't supported

The message lists the supported statuses. Use one of them.

Report not found

Check the Report ID with swif report list --wide. It includes both parts, <commandId>:<runId>.

swif report asks you to log in

Log in with swif login --profile <us|eu|dev>.

A script's output shows odd characters with --json

That's the raw output, including terminal color codes. Use swif report get without --json for a clean view.

Did this answer your question?