Swif CLI is a command-line tool that lets IT admins and engineers manage devices, check compliance, and retrieve agent installer information — all from the terminal. It supports multiple environments, structured output for automation, and secure browser-based authentication.
You can access at:
or Swif portal > MCP > Swif CLI
Installation
Install Swif CLI globally via npm:
npm install -g @swif-ai/cli
Verify the installation:
swif --version
Authentication
Swif CLI uses secure browser-based login. Each session is tied to a profile that corresponds to your Swif environment (us, eu, or dev).
Log in
swif login --profile us
Swif CLI uses browser login by default. If you are 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 — each maintains 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 |
| Filter by device owner |
| Filter by operating system |
| Filter by device type |
| Show only compliant devices |
| Show only non-compliant devices |
| Show devices with an active agent |
| Show devices with no agent installed |
| Show devices with a serial number |
| 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
Transfer 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 include safe failure handling — for example, assigning a device that's already assigned, or unassigning a device with no owner, will return a clear error message without changing any state.
Device Auditing
The device audit command generates 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 audit criteria, the CLI displays a clear summary instead of a blank table.
Employee Management
Manage your team's employee records directly from the terminal. This feature supports listing, retrieving, creating, updating, and deleting employees.
List employees
View all employees in your team:
swif employee list --profile us
Get employee details
Retrieve a specific employee record by ID or email:
swif employee get <employee-id-or-email> --profile us
Create an employee
Create a new employee record using a JSON payload 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 existing employee record using a JSON payload 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 record from your team. Use the --confirm flag to bypass the interactive confirmation:
swif employee delete <employee-id> --confirm --profile us
Agent Installer Lookup
Retrieve the latest Swif agent installer URL for a given OS — useful for scripted deployments and automation pipelines. Starting with CLI version 1.0.6, installer naming has been updated 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
The CLI supports query MDM agent and AgenticSecurity fr precise automation:
MDM OS aliases:
macwindowslinux-x64linux-arm64
Agentic Security OS aliases:
AgenticSecurityMacOSARM64AgenticSecurityWindowsX64AgenticSecurityLinuxX64AgenticSecurityLinuxARM64
The installer URL is resolved from backend metadata (not a static CDN path), so it always points to the current release.
JSON Output Integrity
Run any installer command with the --json flag.
The output is valid JSON containing the url, version, and os (now prefixed with AgenticSecurity).
Output Formats
Most commands support structured output for scripting and automation:
Flag | Format |
| JSON object |
| Newline-delimited JSON |
(default) | Human-readable table |
Example:
swif device list --profile us --output json
swif agent installer latest --os mac --profile eu --json
Non-Interactive Mode
For CI/CD pipelines and automated scripts, use --no-input to suppress all interactive prompts. The CLI will exit with a non-zero code if user input would normally be required.
Troubleshooting
Issue | Resolution |
Login fails to open browser | The CLI tries ports 8765–8769 for the browser callback. If all are in use, it falls back to device-code login automatically. |
"No employee matched" error | The email you provided doesn't exist in the active team context. Verify the email address and current profile. |
Empty device list | Confirm you are logged in to the correct profile and that your team has enrolled devices in that environment. |
Requirements
Node.js 24 or higher (LTS recommended)
npm
A Swif account with team access
