Skip to main content

Toolchain for designing and validating entire Temporal systems in .twf — CLI, language server, and MCP server.

Project description

twf-cli

Design, visualize, and implement entire Temporal systems — namespaces, workers, workflows, and Nexus — as a validated, visual source of truth.

Write your architecture in .twf and a real parser, language server, and visualizer give you (and your AI agent) compiler-grade feedback on the whole system before you write a line of SDK code — then generate the workers and provision the infra from the same design.

Graph View — the whole system as a force-directed graph of namespaces, workers, and workflows with dependency edges

  • Catch design errors before code. A real parser and language server validate the whole system — undefined activities, broken Nexus routing, misplaced determinism — while it's still a design, not a production incident.
  • See the whole deployment. An interactive graph of namespaces → workers → workflows, plus a tree view that expands calls inline. Architecture you can actually look at.
  • One parseable source of truth. .twf is a file every teammate and every tool reads and validates — not architecture prose buried in a prompt.
  • Design → running system. Generate Temporal Go SDK code and provision control-plane infra from the same .twf — or recover a deployment graph straight from production history with twf graph --history.
activity ReserveFunds(amount: Money) -> (Hold):
    reserve(amount)

activity CaptureFunds(hold: Hold) -> (Receipt):
    capture(hold)

workflow ChargeOrder(order: Order) -> (Receipt):
    signal Cancel():
        close fail("cancelled")

    activity ReserveFunds(order.amount) -> hold
        options:
            start_to_close_timeout: 30s
    activity CaptureFunds(hold) -> receipt
    close complete(receipt)

worker billing:
    workflow ChargeOrder
    activity ReserveFunds
    activity CaptureFunds

namespace payments:
    worker billing
        options:
            task_queue: "billing"

Workflow logic, the worker that hosts it, and the namespace topology — one readable file.

twf-cli is a thin wrapper around the bundled platform binary — same tool, same flags, same output as the standalone twf distribution, installable via pip.

Install

pip install twf-cli
twf --help

The wheel for your platform ships the matching twf binary. Supported platforms (one wheel each): macosx_11_0_arm64, macosx_10_15_x86_64, manylinux2014_x86_64, manylinux2014_aarch64, win_amd64.

The twf CLI

A single Go binary: parser, validator, deployment-graph extractor, and a full LSP server. Every command and flag is discoverable via twf --help and twf <command> --help.

Command Description
twf check <file...> Parse and validate .twf files, reporting errors
twf parse <file...> Output the AST as JSON (partial AST even with errors)
twf symbols <file...> List workflows and activities with their signatures
twf graph <file...> Emit the resolved deployment graph (nodes are deployments, edges are dispatches)
twf graph chunks <file...> Decompose a design into independently-implementable chunks at contract boundaries
twf graph --history <dir> Recover a deployment graph from sampled production histories — no .twf required
twf spec [--list | <slug>] Print the embedded TWF language specification
twf mcp Start the MCP server over stdio (agent entry point)
twf lsp Start the language server over stdio

Common options: --json (structured output) and --lenient (continue past resolve errors). The language server adds real-time diagnostics, completions, hover, go-to-definition, references, rename, code actions, folding, inlay hints, semantic tokens, and signature help.

Use as an MCP server

twf mcp runs a Model Context Protocol server over stdio — the agent entry point. Point any MCP client (Claude Desktop, Cursor, Continue, Windsurf, Zed) at it:

{
  "mcpServers": {
    "twf": {
      "command": "npx",
      "args": ["-y", "@temporal-architect/twf", "mcp"]
    }
  }
}

The tools (twf_check, twf_parse, twf_symbols, twf_graph, twf_graph_chunks, twf_spec_list, twf_spec_get) are thin wrappers over the same parser pipeline as the CLI, so their JSON is identical. The embedded language specification is exposed as resources at twf://spec and twf://spec/<slug>.

Subprocess use from Python

import subprocess, json

result = subprocess.run(
    ["twf", "parse", "workflow.twf"],
    capture_output=True, text=True, check=True,
)
ast = json.loads(result.stdout)

Versioning

Versions track the upstream temporal-architect Git tag, so 0.3.x of this package corresponds to v0.3.x of the toolchain.

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

twf_cli-0.10.1-py3-none-win_amd64.whl (10.0 MB view details)

Uploaded Python 3Windows x86-64

twf_cli-0.10.1-py3-none-manylinux2014_x86_64.whl (9.9 MB view details)

Uploaded Python 3

twf_cli-0.10.1-py3-none-manylinux2014_aarch64.whl (9.1 MB view details)

Uploaded Python 3

twf_cli-0.10.1-py3-none-macosx_11_0_arm64.whl (9.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

twf_cli-0.10.1-py3-none-macosx_10_15_x86_64.whl (10.2 MB view details)

Uploaded Python 3macOS 10.15+ x86-64

File details

Details for the file twf_cli-0.10.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: twf_cli-0.10.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for twf_cli-0.10.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d3f97dae007837fc42393c530e155327ac534bf16a323a3df631c96f7eec0b64
MD5 ca96bfc0a142c89b960f0072160ffac2
BLAKE2b-256 e8149563145170c908e8a60e651bfea0290a9df172ff85476d024a341c231dab

See more details on using hashes here.

File details

Details for the file twf_cli-0.10.1-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for twf_cli-0.10.1-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e52d9d5d26695d0db674372935a9b9b82b4a1b75c7381f6895c167a90f979a62
MD5 74e50a769b186027ff403146d935d6a3
BLAKE2b-256 dd572e17ce9d916611d0b4022ca2bb6a6cbdce37c291aee8e4b3ba8662a401ed

See more details on using hashes here.

File details

Details for the file twf_cli-0.10.1-py3-none-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for twf_cli-0.10.1-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 069aaddcfbbb44ec04ed59680d0c5bde58dc617d88df80d6aa9015d4baa6ea05
MD5 2bb25ad13be3027a713c286594f37f0b
BLAKE2b-256 b1490cce7d8672525e3b34f87e8760ea31f7891d57ceea49837b2b507bfb5a46

See more details on using hashes here.

File details

Details for the file twf_cli-0.10.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for twf_cli-0.10.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ae42d3bd012ba6f5c4d9b94e585abfc51a90a660f9efc804b97a4af96cfd0895
MD5 54cbd85483e9186ac6984a090f744cc0
BLAKE2b-256 7c76e501ae9cf21dc703e4f64ffc5705b1aa6f1028d0cd8906e25bd09bc75f88

See more details on using hashes here.

File details

Details for the file twf_cli-0.10.1-py3-none-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for twf_cli-0.10.1-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 e5a258c2a83e772e4dfc93bf69e7031874bd85f4efc98a8a8d17006f654f6aae
MD5 ffca3adfd343dba3cbf8e1b87f8f005f
BLAKE2b-256 3bc3ab7a1cbff066b6a2b0c042e03e06f27bae892b9109632153496798b8773f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page