An open API service indexing awesome lists of open source software.

https://github.com/stalwartlabs/cli

Stalwart Command Line Interface
https://github.com/stalwartlabs/cli

cli mail server

Last synced: about 2 months ago
JSON representation

Stalwart Command Line Interface

Awesome Lists containing this project

README

          






Stalwart CLI



continuous integration
 
License: AGPL v3
 
Documentation



Mastodon
 
Twitter



Discord
 
Reddit

A schema-driven command line tool for administering [Stalwart Mail and Collaboration Server](https://stalw.art) over its JMAP API.

The tool fetches the server's schema on first use and derives every command, validation rule, and rendered view from it. The same binary works against any compatible Stalwart deployment without recompilation.

## Overview

| | |
|---|---|
| `describe` | Inspect objects, fields, enums, filters, and sort options exposed by the server. |
| `get` / `query` | Fetch a single object or list / filter many. |
| `create` / `update` / `delete` | Single-object mutations. |
| `apply` | Apply a JSON plan of bulk creates, updates, and destroys (intended for Ansible, Terraform, NixOS, Pulumi, and CI/CD pipelines). |
| `snapshot` | Export live server state as an `apply`-ready JSON plan. Useful for backups, cross-environment promotion, and round-trip disaster-recovery rehearsals. |

Output is human-friendly by default (sectioned, with color when stdout is a TTY) and switches to compact JSON or NDJSON for machine consumption.

## Install

```sh
# macOS / Linux
curl --proto '=https' --tlsv1.2 -LsSf \
https://github.com/stalwartlabs/cli/releases/latest/download/stalwart-cli-installer.sh | sh

# Homebrew
brew install stalwartlabs/tap/stalwart-cli

# Windows
powershell -ExecutionPolicy Bypass -c "irm https://github.com/stalwartlabs/cli/releases/latest/download/stalwart-cli-installer.ps1 | iex"

# npm
npm install -g @stalwartlabs/cli

# From source
cargo install --path .
```

A signed `.msi` is also published with each release.

## Quick start

```sh
export STALWART_URL=https://mail.example.com
export STALWART_USER=admin
export STALWART_PASSWORD='changeme'

stalwart-cli describe # list every available object
stalwart-cli describe domain # full schema for one object
stalwart-cli query domain # default columns
stalwart-cli get domain # full object
stalwart-cli create domain --field name=example.com --field isEnabled=true
stalwart-cli update domain --field description='Primary'
stalwart-cli delete domain --ids
stalwart-cli apply --file plan.json # bulk apply
stalwart-cli snapshot Tenant Domain \ # export state as an apply plan
--output backup.json
```

## Documentation

Full documentation, including the bulk-apply file format, JSON Schema, and integration guides for Ansible / Terraform / NixOS / Pulumi / CI:

**[stalw.art/docs/management/cli](https://stalw.art/docs/management/cli/overview)**

## License

This project is dual-licensed under the **GNU Affero General Public License v3.0** (AGPL-3.0; as published by the Free Software Foundation) and the **Stalwart Enterprise License v1 (SELv1)**:

- The [GNU Affero General Public License v3.0](./LICENSES/AGPL-3.0-only.txt) is a free software license that ensures your freedom to use, modify, and distribute the software, with the condition that any modified versions of the software must also be distributed under the same license.
- The [Stalwart Enterprise License v1 (SELv1)](./LICENSES/LicenseRef-SEL.txt) is a proprietary license designed for commercial use. It offers additional features and greater flexibility for businesses that do not wish to comply with the AGPL-3.0 license requirements.

Each file in this project contains a license notice at the top, indicating the applicable license(s). The license notice follows the [REUSE guidelines](https://reuse.software/) to ensure clarity and consistency. The full text of each license is available in the [LICENSES](./LICENSES/) directory.

## Copyright

Copyright (C) 2020, Stalwart Labs LLC