cli

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2022 License: MIT

README

Temporal CLI

Go Reference ci

⚠️ Temporal CLI's API is still a subject for changes. ⚠️

The Temporal CLI is a command-line interface for running Temporal Server and interacting with Workflows, Activities, Namespaces, and other parts of Temporal.

Getting Started

Download and Start Temporal Server Locally

Download and extract the latest release from GitHub releases.

Start Temporal server:

temporal server start-dev

At this point you should have a server running on localhost:7233 and a web interface at http://localhost:8233.

Run individual commands to interact with the local Temporal server.

temporal namespace list
temporal workflow list

Configuration

Use the help flag to see all available options:

temporal server start-dev -h
Namespace Registration

Namespaces are pre-registered at startup so they're available to use right away.

By default, the "default" namespace is registered. To customize the pre-registered namespaces, start the server with:

temporal server start-dev --namespace foo --namespace bar

Registering namespaces the old-fashioned way via temporal namespace register foo works too!

Persistence Modes
In-memory

By default temporal server start-dev run in an in-memory mode.

File on Disk

To persist the state to a file use --db-filename:

temporal server start-dev --db-filename my_test.db
Temporal UI

By default the Temporal UI is started with Temporal CLI. The UI can be disabled via a runtime flag:

temporal server start-dev --headless

To build without static UI assets, use the headless build tag when running go build.

Dynamic Config

Some advanced uses require Temporal dynamic configuration values which are usually set via a dynamic configuration file inside the Temporal configuration file. Alternatively, dynamic configuration values can be set via --dynamic-config-value KEY=JSON_VALUE.

For example, to disable search attribute cache to make created search attributes available for use right away:

temporal server start-dev --dynamic-config-value system.forceSearchAttributesCacheRefreshOnRead=true

Development

To compile the source run:

go build -o dist/temporal ./cmd/temporal

To run all tests:

go test ./...

Known Issues

  • When consuming Temporal as a library in go mod, you may want to replace grpc-gateway with a fork to address URL escaping issue in UI. See https://github.com/temporalio/temporalite/pull/118

  • When running the executables from the Releases page in macOS you will want to allowlist temporal binary in Security & Privacy settings:

image (1)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL