Skip to main content

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 the sampler.
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 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. The examples below launch it through npx, so Node.js and npm must be installed and npx must be available on PATH.

Claude Desktop

Add the twf entry to the existing mcpServers object in the Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "twf": {
      "command": "npx",
      "args": ["-y", "@temporal-architect/twf", "mcp"]
    }
  }
}

Restart Claude Desktop after saving the file.

Cursor

Create .cursor/mcp.json in a project to enable twf for that project, or use ~/.cursor/mcp.json to enable it globally. Both locations use the same Cursor MCP configuration shape:

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

Continue

Create .continue/mcpServers/twf.yaml at the top level of the workspace. Continue's standalone MCP blocks require the name, version, and schema metadata fields:

name: TWF MCP server
version: 0.0.1
schema: v1
mcpServers:
  - name: twf
    command: npx
    args:
      - "-y"
      - "@temporal-architect/twf"
      - "mcp"

The tools (twf_check, twf_parse, twf_symbols, twf_graph, twf_graph_chunks, twf_fmt, twf_spec_list, twf_spec_get) are thin wrappers over the same parser pipeline as the CLI, so their JSON is identical. twf_fmt returns the text twf fmt would write and writes nothing. 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.

Metadata

Release files for twf-cli 0.16.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for twf-cli 0.16.0
File Actions
twf_cli-0.16.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for twf_cli-0.16.0-py3-none-win_amd64.whl
twf_cli-0.16.0-py3-none-manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for twf_cli-0.16.0-py3-none-manylinux2014_x86_64.whl
twf_cli-0.16.0-py3-none-manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for twf_cli-0.16.0-py3-none-manylinux2014_aarch64.whl
twf_cli-0.16.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for twf_cli-0.16.0-py3-none-macosx_11_0_arm64.whl
twf_cli-0.16.0-py3-none-macosx_10_15_x86_64.whl Python 3 none macOS 10.15+ x86-64 Details for twf_cli-0.16.0-py3-none-macosx_10_15_x86_64.whl

Total release size: 41.9 MB

Release files / twf_cli-0.16.0-py3-none-win_amd64.whl

Download URL twf_cli-0.16.0-py3-none-win_amd64.whl
Size 8.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
dd782ca7ad9bcc570aa16ccc4ced9c77b3929716fc6da0a330cd7b8bab6fc790
BLAKE2b-256 checksum
How to use checksums
15866785a65becfc6fdcb6bf1938c3a6e82919669e8f9d3fa553aaa9d6e45bca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.1

Release files / twf_cli-0.16.0-py3-none-manylinux2014_x86_64.whl

Download URL twf_cli-0.16.0-py3-none-manylinux2014_x86_64.whl
Size 8.5 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
4dcc9c7e9a5ba252e2cda8930f9718e16d0072fe96ee1c209a865008a30344bd
BLAKE2b-256 checksum
How to use checksums
fffb127f83d94cd58f9d7cc9ab9dda70982f01ad70137c6dfd6d3b29b873a544
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.1

Release files / twf_cli-0.16.0-py3-none-manylinux2014_aarch64.whl

Download URL twf_cli-0.16.0-py3-none-manylinux2014_aarch64.whl
Size 7.8 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
ee6918569dc8d1ab17942c7c8a77f5f9d1a9bc4dad91b10f472178420a22ba75
BLAKE2b-256 checksum
How to use checksums
1f108a2dc8e3dc09f9c2586050ca83877b4a8ab2d665ac7a4a5f414fc9969cea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.1

Release files / twf_cli-0.16.0-py3-none-macosx_11_0_arm64.whl

Download URL twf_cli-0.16.0-py3-none-macosx_11_0_arm64.whl
Size 8.2 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bef8d15ec1189e16e430dbd1682e2a283d6d3f9a1394f8791ed6393c150428f0
BLAKE2b-256 checksum
How to use checksums
f891b5e5816566f0b433ce30a959e96a141a0800e5fb1b912d506ff51c530e61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.1

Release files / twf_cli-0.16.0-py3-none-macosx_10_15_x86_64.whl

Download URL twf_cli-0.16.0-py3-none-macosx_10_15_x86_64.whl
Size 8.8 MB
Tags Python 3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
c3122b4cf926588bb8d3ab5312c4d09a497a10bd40c11c2b5fdd5e2d6b083a23
BLAKE2b-256 checksum
How to use checksums
ca3315b7d75d2158969322f6d2e8579f8a847d29f9e41207ba36c18ee3feda3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.1

Security for twf-cli 0.16.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page