articles /

Create 🤖 Core ML models with Apple’s Create ML framework, directly from the terminal.

· 2 min read · Marcus Schappi

createml-cli is a native macOS command-line tool for training Core ML models with Apple’s Create ML framework—directly from the terminal.

Repository: https://github.com/schappim/createml-cli

What is createml-cli?

createml-cli is a Swift-based CLI that wraps Create ML and Core ML to produce .mlmodel files without Xcode or Python. It exposes a single createml command with focused subcommands for image, text, sound, and tabular training.

Every command can emit structured JSON with --json. In human mode, it prints progress updates and a clear training summary.

Core Capabilities

Image Classification

  • Train from labeled image directories

  • Transfer learning with ScenePrint v2 and a logistic regressor

  • Optional validation set and configurable max iterations

  • Built-in augmentation (crop, rotation, blur, exposure, noise, flip) with --no-augmentation

  • Set model name, author, and description metadata

Text Classification

  • Train from CSV or JSON with configurable text/label columns

  • Choose maxent or transfer learning (dynamic embedding)

  • Outputs class labels and accuracy metrics

Sound Classification

  • Train from labeled audio directories

  • Control analysis overlap factor (0.0–1.0)

  • Optional validation data with accuracy metrics

Tabular Classification and Regression

  • Train from CSV or JSON with a target column

  • Classifier or regressor via --type

  • Algorithms: auto, random forest, boosted tree, decision tree, linear, logistic

  • Optional max depth and max iterations for tree models

Everyday Automation Examples

Train an Image Classifier

createml image training_data/ -o PetClassifier.mlmodel \
  --name "PetClassifier" \
  --iterations 50 \
  --validation validation_data/ \
  --author "Your Name" \
  --description "Pet classifier model"

Train a Text Classifier (Transfer Learning)

createml text sentiment.csv -o SentimentClassifier.mlmodel \
  --text-column "review" \
  --label-column "sentiment" \
  --algorithm transfer \
  --json

Train a Sound Classifier

createml sound sounds/ -o SoundClassifier.mlmodel \
  --overlap 0.25 \
  --validation validation_sounds/

Train a Tabular Regressor

createml tabular housing.csv -o PricePredictor.mlmodel \
  -t price \
  --type regressor \
  --algorithm boostedtree \
  --max-depth 10 \
  --max-iterations 100

JSON Output Example

{
  "modelPath": "/path/to/Model.mlmodel",
  "trainingAccuracy": 95.4,
  "validationAccuracy": 92.1,
  "trainingDurationSeconds": 2.15,
  "classLabels": ["negative", "neutral", "positive"]
}

Why This Matters for Automation

createml-cli is local, deterministic, and JSON-friendly, which makes it ideal for scripts, CI jobs, and agent-driven workflows. You can train models, capture metrics, and move straight into Core ML inference without leaving the terminal.

keep reading

  1. The real work

    Software is now generated, but the real work (and value) lies in diagnosing specifications, managing complexity, and bridging the gap between human intent and machine behavior.

  2. We have (Software) Replicators

    In Star Trek: The Next Generation, replicators are a quiet but transformative force. You state your request, and it materialises on a glowing pad. That simple interface rewrites the rules of society. Scarcity fades. Food, clothing, spare parts, even Captain Picard’s iconic “Te...

  3. Inspect, Benchmark, and Run Core ML Models from the Command Line

    coreml is a native macOS command-line tool for working with Apple Core ML models. Inspect, run inference, benchmark, and compile models directly from the terminal. Repository: https://github.com/schappim/coreml-cli What is coreml-cli? coreml-cli is a Swift-based CLI that wraps...

newsletter

New articles by email. No spam.

← all articles