FlintCLI
FlintCLI is a command-line tool that connects to Minecraft servers to execute Flint tests. It uses /tick freeze and /tick step commands for deterministic, tick-accurate testing.
Features
Section titled “Features”- Server connection - Connects as a bot to any Minecraft server (1.21.5+)
- Deterministic execution - Freezes game time for reproducible results
- Multiple output formats - Pretty, JSON, TAP, JUnit XML
- Interactive mode - Run tests via in-game chat commands
- Test recording - Record tests by playing in-game
- Debugging - Breakpoints and step-through execution
Installation
Section titled “Installation”Prerequisites
Section titled “Prerequisites”- Rust nightly toolchain
- Minecraft server 1.21.5+ (vanilla, Paper, Spigot, etc.)
- Server with
online-mode=falseor bot whitelisted
Building
Section titled “Building”git clone https://github.com/FlintTestMC/FlintCLIcd FlintCLIrustup override set nightlycargo build --releaseThe binary will be at target/release/flintmc.
Server Setup
Section titled “Server Setup”The bot needs operator permissions:
/op flintmc_testbotBasic Commands
Section titled “Basic Commands”Run a single test:
flintmc example_tests/basic_placement.json -s localhost:25565Run all tests in a directory:
flintmc example_tests/ -s localhost:25565Run tests recursively:
flintmc example_tests/ -s localhost:25565 -rFilter by tags:
flintmc -s localhost:25565 -t redstone -t pistonsOutput Formats
Section titled “Output Formats”# Human-readable (default)flintmc tests/ -s localhost:25565
# JSON outputflintmc tests/ -s localhost:25565 --format json
# TAP format (CI/CD compatible)flintmc tests/ -s localhost:25565 --format tap
# JUnit XML (Jenkins/GitHub Actions)flintmc tests/ -s localhost:25565 --format junit > results.xmlVerbose and Debug Modes
Section titled “Verbose and Debug Modes”# Verbose output (per-action details)flintmc tests/ -s localhost:25565 -v
# List tests without runningflintmc tests/ --list
# Dry run (show execution plan)flintmc tests/ --dry-run
# Pause after setup for inspectionflintmc tests/ -s localhost:25565 --break-after-setupCommand-Line Options
Section titled “Command-Line Options”| Flag | Short | Description |
|---|---|---|
--server <SERVER> | -s | Server address (required) |
--recursive | -r | Search directories recursively |
--interactive | -i | Interactive mode |
--verbose | -v | Show detailed output |
--quiet | -q | Suppress progress bar |
--tag <TAG> | -t | Filter by tag (repeatable) |
--action-delay <MS> | -d | Delay between actions (default: 100ms) |
--break-after-setup | Pause after test setup | |
--fail-fast | Stop after first failure | |
--list | List tests and exit | |
--dry-run | Show plan without connecting | |
--format <FORMAT> | Output: pretty, json, tap, junit |
Interactive Mode
Section titled “Interactive Mode”Start interactive mode to control tests via in-game chat:
flintmc -s localhost:25565 -iChat Commands
Section titled “Chat Commands”All commands are prefixed with !:
| Command | Description |
|---|---|
!help | List available commands |
!list | List loaded tests |
!search <pattern> | Search tests by name |
!run <name> | Run a specific test |
!run-all | Run all tests |
!run-tags <tag1,tag2> | Run tests by tags |
!reload | Reload tests from disk |
!record <name> | Start recording a test |
!stop | Exit interactive mode |
Troubleshooting
Section titled “Troubleshooting”“Bot not initialized” Check that the server is running and accessible.
“Bot needs op permissions”
Run /op flintmc_testbot on the server.
Assertion failures
Try increasing the tick delay with -d 200 or verify block names are correct.
Connection timeout Verify firewall settings and whitelist configuration.
Next Steps
Section titled “Next Steps”- Recording Tests - Create tests by playing in-game
- Test Format - Complete test specification reference