Automation toolkit for IBM mainframe 3270 terminal systems. Enables scripted workflows via JSON config, concurrent load testing, REST API mode, and a web dashboard.
Version: 1.8.6
Language: Go 1.21+ (toolchain 1.23.1)
go3270Connect.go # Main entry point (~3,800 lines) — CLI, API, dashboard, workflow runner
connect3270/emulator.go # Core TN3270 protocol implementation (x3270/s3270 wrapper)
charmui.go # Terminal UI rendering (lipgloss/pterm)
templates/dashboard.gohtml # Web dashboard UI
sampleapps/ # Embedded sample 3270 apps for testing
binaries/ # Pre-compiled x3270 binaries (linux/ and windows/)
docs/ # MkDocs source (published to 3270.io)
dist/ # Build output — committed to repo by CI
# Build binaries (outputs to dist/)
./build.sh
# Run with a workflow
./dist/3270Connect -config workflow.json
# Concurrent load test (10 workers, 60s)
./dist/3270Connect -config workflow.json -concurrent 10 -runtime 60
# API server mode
./dist/3270Connect -api -api-port 8080
# Run embedded sample app for testing
./dist/3270Connect -runApp 1 -runApp-port 3270
# Tests
go test -v ./...| Flag | Description |
|---|---|
-config |
Workflow JSON file (default: workflow.json) |
-injectionConfig |
Dynamic field injection JSON |
-token |
RSA token substitution |
-concurrent |
Number of parallel workflows (default: 1) |
-runtime |
Max run duration in seconds |
-api / -api-port |
REST API mode |
-dashboard / -dashboardPort |
Web dashboard |
-headless |
No terminal UI (for CI/CD) |
-verbose |
Verbose logging |
-workflowTimeout |
Per-workflow hard timeout (seconds) |
{
"Host": "mainframe.host",
"Port": 3270,
"EveryStepDelay": { "Min": 0.1, "Max": 0.3 },
"WaitForField": true,
"Steps": [
{ "Action": "Connect" },
{ "Action": "FillString", "Column": 20, "Row": 10, "Value": "{{username}}" },
{ "Action": "PressEnter" },
{ "Action": "CheckValue", "Column": 1, "Row": 24, "Value": "READY" },
{ "Action": "AsciiScreenGrab", "FilePath": "screen.txt" },
{ "Action": "Disconnect" }
]
}POST /api/execute— Execute a workflowGET /dashboard— Web dashboardGET /dashboard/data— Live metrics JSONPOST /start-process/POST /kill— Process lifecyclePOST /test-connection— Connectivity test
GitHub Actions (.github/workflows/go.yml):
- Builds Windows + Linux binaries on every push to
main - Runs
go test - Auto-commits built binaries to
dist/ - Deploys MkDocs docs to GitHub Pages
The embedded x3270 binaries are built separately:
make linux # Build s3270/x3270if for Linux
make windows # Cross-compile for Windows
make all # Both platformsPre-built binaries are checked into binaries/.
docker build -f Dockerfile -t 3270connect . # Linux
docker build -f Dockerfile.windows -t 3270connect . # WindowsKey Go modules:
github.com/gin-gonic/gin— REST APIgithub.com/racingmars/go3270— TN3270 protocolgithub.com/charmbracelet/lipgloss— Terminal stylinggithub.com/pterm/pterm— Terminal UIgithub.com/jchv/go-webview2— Windows WebView2 UIgithub.com/shirou/gopsutil— System metrics