CLI and MCP
Every subcommand, the exit codes, the output artifacts and the read-only MCP service.
Every subcommand
| Command | Typical use | Arguments and behaviour |
|---|---|---|
run | fleetkite run --config playbook.yml [options] | --config (defaults to config.yml; - reads stdin, up to 16 MiB), --base-dir, --format text|json, --limit, --tags, --skip-tags, -e / --extra-vars (repeatable; accepts k=v, JSON or @file), --var-file (repeatable; loads a YAML or JSON mapping), --concurrency, --timeout (default 30s), --task-timeout (defaults to --timeout), --log (a file or stdout; in JSON mode the console log goes to stderr), --level, --check (dry run), --diff (show file change diffs), --strict, --json-summary ("-" is the same as --format json), --history (append a JSONL history entry), --report-html (write a standalone HTML report) |
validate | fleetkite validate --config playbook.yml [--strict] [--inline] | Validates offline, without opening an SSH connection; --inline validates only the given text (no local directories or inventory are resolved); --strict turns unknown plugin arguments from warnings into errors; --format json is supported |
inspect | fleetkite inspect --config playbook.yml [--limit ...] [--tags ...] | Parses offline: the hosts each play matches (with their effective port and user), the order of the steps, the dry-run behaviour markers (supported / skipped) and static warnings |
plugins | fleetkite plugins <action> [args] | list / show NAME / verify SRC / install SRC / keygen --out KEY [--pub-out PUB] / sign SRC --key KEY [--output OUT.zip] / lock ID [--project DIR] / trust ID [--roots F | --scopes F] [--yes] / revoke ID. Accepts --version, --sha256 and --format json |
schema | fleetkite schema [--format json|text] | Returns machine-readable metadata (schema_version: 1): every command and subcommand, the defaults of all execution options, the exit code semantics and the complete set of task fields |
diagnose | fleetkite diagnose --input summary.json [--format json|text] | Reads a run JSON summary or the last record of a --history JSONL file and classifies the failure (ssh_host_key, ssh_auth, ssh_connection, check_mode_dependency, assertion, permission, missing_path, timeout, task_failed, no_targets and others), with a suggested fix |
templates | fleetkite templates list | show NAME | render NAME --host IP --user USER | Prints the built-in read-only draft templates offline (facts and file-stat, no credentials); file-stat needs --path; --port defaults to 22 |
mcp | fleetkite mcp | Serves the read-only MCP tool set over standard input and output (stdio, 4 MiB per line) |
convert | fleetkite convert playbook.yml | Parses a local playbook and prints it as canonical JSON (note: the output may contain the resolved plaintext connection settings) |
vault | FLEETKITE_VAULT_PASS=... fleetkite vault encrypt|decrypt VALUE|- | Reads the passphrase from the environment and encrypts or decrypts a $FLEETKITEVAULT$... value with PBKDF2-HMAC-SHA256 + AES-256-GCM |
version | fleetkite version [--format text|json] | Prints the build version and the Git revision |
help | fleetkite help [command] | The global help, or the help of one command |
Path conflict detection
--config, --var-file, --json-summary, --history, --report-html and --log are checked against each other for path conflicts (including the real path after symlinks are resolved): two outputs or an input and an output may never write to the same physical path.
Exit codes and artifacts
The CLI keeps a stable exit code contract across all commands (fleetkite schema prints it):
| Exit code | Meaning | Usual cause |
|---|---|---|
0 | Success | The validation passed, or every target host finished |
1 | Execution failed | A host was unreachable, or a task failed without being ignored or caught |
2 | Invalid usage or input | A bad argument, invalid YAML or structure, or a failed config / plugin lock check |
3 | No matching targets | After play.hosts and --limit filtering, no host needs to run |
4 | Artifact write failed | The tasks succeeded but --json-summary, --history or --report-html could not be written or encoded |
130 | Cancelled | A SIGINT / SIGTERM (Ctrl+C) interrupted the run |
The structured report
The report written by --format json and --json-summary (schema_version: 2):
- Top-level status:
status(success/failed/stopped/no_targets),check_mode,total_servers,success_servers,failed_servers,unreachable_servers,stopped_servers; - Counters:
statistics(total_plays,total_tasks,start_time,end_time,duration_ms) andtasks(ok,changed,failed,skipped,compensation_ok,compensation_failed,compensation_skipped); - Per-host detail:
servers[]holdsip/port/user/status/unreachable/plays[]/errors[].
Common artifact combinations
# dry run, then write a structured summary
fleetkite run --config playbook.yml --check --diff --json-summary summary.json
# append a JSONL history entry for diagnose to read
fleetkite run --config playbook.yml --format json --history history.jsonl
# produce a standalone HTML report
fleetkite run --config playbook.yml --report-html report.html
# attribute the failure
fleetkite diagnose --input summary.jsonThe read-only AI / MCP service
Running fleetkite mcp registers FleetKite as a standard stdio MCP tool backend. It exposes 7 strictly read-only (ReadOnlyHint: true) offline tools and never opens an SSH connection or changes a remote host on its own. This is the recommended way to lower the cost of learning the syntax: let an AI assistant look up the real plugin parameters, write a playbook and validate it offline, and only then hand it to the desktop app or the CLI for a dry run.
list_plugins— every built-in plugin, the three include directives and the installed external plugins, with their--checksupport;describe_plugin— a plugin's full argument schema, defaults, descriptions, manifest permissions and example YAML;describe_cli— the CLI's commands, options, exit codes and the structure of the common task fields;validate_playbook— offline static syntax and argument validation of the given text (the equivalent ofvalidate --inline);diagnose_execution— takes the summary object fromrun --format jsonand returns the root-cause classification and the actions to take;list_templates— the built-in read-only draft templates and the arguments they accept;prepare_template— generates a YAML draft offline from the given arguments, for a human to review.
Registering it with an MCP client
(Claude Desktop, Cursor, Claude Code and any other stdio MCP client)
{
"mcpServers": {
"fleetkite": {
"command": "/absolute/path/to/fleetkite",
"args": ["mcp"]
}
}
}Prompts that work well
- Writing a playbook: "Call the FleetKite MCP tools
list_pluginsanddescribe_pluginto check the arguments, then write me a playbook that installs Nginx on Ubuntu and Rocky hosts, renders the site configuration and reloads the service. Validate it offline withvalidate_playbookuntil it reports no errors." - Attributing a failure: "Pass this
fleetkite run --format jsonoutput todiagnose_executionand tell me what went wrong and how to fix it."
The desktop app and the Go SDK
- The desktop client (macOS / Linux / Windows) is built on Wails v2 and React, and provides the asset library and group tree, encrypted SSH credentials, the visual playbook, multi-file task and four-directory role editors, the live execution audit, non-blocking SFTP and ZMODEM channels, and the multi-tab, split-pane SSH terminal. See the desktop workbench.
- The Go SDK and the team web console: an integrator can import the
sdk/module into their own Go service to drive the executor, or runfleetkite-webto give a team read-only review and controlled execution.
Next steps
- Security practices — how SSH security, transfer protection and the Vault are used
- Built-in plugins — every
typeyou can write in a playbook