• Stars
    star
    223
  • Rank 172,057 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created over 1 year ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Command-line interface for running Temporal Server and interacting with Workflows, Activities, Namespaces, and other parts of Temporal

Temporal CLI

Go Reference ci

⚠️ Temporal CLI's API is still subject to change. ⚠️

Use the CLI to run a Temporal Server and interact with it.

πŸ“¦ Install

You can install the CLI using one of the below methods.

cURL

curl -sSf https://temporal.download/cli.sh | sh

Homebrew

brew install temporal

Manual

  1. Download the version for your OS and architecture:
  2. Extract the downloaded archive.
  3. Add the temporal binary to your PATH. (temporal.exe for Windows)

You can also download older versions from GitHub releases.

πŸš€ Use

Start the Server

temporal server start-dev

This:

  • Starts the Server on localhost:7233
  • Runs the Web UI at http://localhost:8233
  • Creates a default Namespace

You can create other namespaces, have the Server persist data to a file so you don't lose your Workflows between sessions, and make other customizations via command-line options. For a full list of options, run:

temporal server start-dev --help

Interact with the Server

You can also run commands to interact with the Server in a separate terminal:

temporal workflow list
temporal operator namespace list

For a full list of commands, see the CLI docs or run temporal help.

βš™οΈ Configure

Use the help flag to see a full list of CLI options:

temporal -h
temporal server start-dev -h

Configure the environment with env commands:

temporal env set [environment options]

Namespace registration

Namespaces are pre-registered at startup so they're available to use right away. To customize the pre-registered namespaces, start the server with:

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

You can also register Namespaces with the following command:

temporal operator namespace create foo

Persistence modes

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

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

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

Enable or disable 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 configuration

Advanced configuration of the Temporal CLI requires the use of a dynamic configuration file. This file is created outside of the Temporal CLI; it is usually located with the service's config files.

Dynamic configuration values can also be set via --dynamic-config-value KEY=JSON_VALUE. For example, to disable the search attribute cache, run:

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

This setting makes created search attributes immediately available for use.

Environment variables

See the CLI docs for a list of env vars.

⌨️ Auto-completion

The Temporal CLI has the capability to auto-complete commands.

Running temporal completion SHELL will output completion setup code for the given shell.

zsh auto-completion

Add the following code snippet to your ~/.zshrc file:

source <(temporal completion zsh)

If you're running auto-completion from the terminal, run the command below:

echo 'source <(temporal completion zsh)' >> ~/.zshrc

After editing the file, run:

source ~/.zshrc.

Bash auto-completion

Bash auto-completion relies on bash-completion.

Install the software with the steps provided here, or use your preferred package manager on your operating system.

macOS installation

Install bash-completion through Homebrew: brew install bash-completion@2

Follow the instruction printed in the "Caveats" section, which will say to add one of the following lines to your ~/.bashrc file:

[[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]] && . "/opt/homebrew/etc/profile.d/bash_completion.sh"

or:

[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"

Verify that bash-completion is installed by running type _init_completion. It should say _init_completion is a function and print the function.

Enable completion for Temporal by adding the following code to your bash file:

source <(temporal completion bash)

In an existing terminal, you can do that by running:

echo 'source <(temporal completion bash)' >> ~/.bashrc
source ~/.bashrc

Now test by typing temporal, space, and then tab twice. You should see:

$ temporal
activity    completion  h           operator    server      workflow
batch       env         help        schedule    task-queue

Linux installation

Use any of the following package managers to install bash-completion: apt install bash-completion pacman -S bash-completion yum install bash-completion

Verify that bash-completion is installed by running type _init_completion.

To install the software on Alpine Linux, run:

apk update
apk add bash-completion
source /etc/profile.d/bash_completion.sh

Finally, enable completion for Temporal by adding the following code to your bash file:

echo 'source <(temporal completion bash)' >> ~/.bashrc
source ~/.bashrc

πŸ”§ Development

Compile and run CLI

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

Compile docs

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

Run 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 temporalio/temporalite#118

  • When running the executables from the Releases page in macOS you will need to click "Allow Anyway" in Security & Privacy settings:

image (1)

More Repositories

1

temporal

Temporal service
Go
9,490
star
2

temporalite

An experimental distribution of Temporal that runs as a single process
Go
606
star
3

sdk-typescript

Temporal TypeScript SDK
TypeScript
471
star
4

sdk-go

Temporal Go SDK
Go
437
star
5

samples-go

Temporal Go SDK samples
Go
404
star
6

sdk-python

Temporal Python SDK
Python
368
star
7

sdk-dotnet

Temporal .NET SDK
C#
311
star
8

samples-typescript

TypeScript
264
star
9

helm-charts

Temporal Helm charts
Mustache
258
star
10

sdk-php

Temporal PHP SDK
PHP
246
star
11

docker-compose

Temporal docker-compose files
Shell
243
star
12

sdk-core

Core Temporal SDK that can be used as a base for language specific Temporal SDKs
Rust
226
star
13

sdk-java

Temporal Java SDK
Java
190
star
14

ui

Temporal UI
TypeScript
149
star
15

samples-java

Temporal Java SDK samples
Java
138
star
16

maru

Benchmarks for Temporal workflows
Go
115
star
17

awesome-temporal

A curated list of awesome Temporal libraries and resources.
111
star
18

samples-python

Samples for working with the Temporal Python SDK
Python
85
star
19

samples-php

Temporal PHP SDK samples
PHP
77
star
20

documentation

Temporal documentation
Go
74
star
21

api

Temporal gRPC API and proto files
Makefile
72
star
22

dashboards

Temporal Dashboards
71
star
23

web

Temporal Web UI v1
JavaScript
70
star
24

experiment-dotnet

Temporal SDK for .NET
C#
65
star
25

sdk-ruby

Temporal Ruby SDK
Ruby
62
star
26

proposals

Temporal proposals
61
star
27

ui-server

Golang Server for https://github.com/temporalio/ui
Go
59
star
28

snipsync

JavaScript
59
star
29

background-checks

Sample application using Temporal
Go
54
star
30

temporal-ecommerce

Go
53
star
31

samples-dotnet

Samples for working with the Temporal .NET SDK
C#
43
star
32

tctl

Temporal CLI
Go
42
star
33

money-transfer-project-template-go

Go
42
star
34

temporal-polyglot

PHP
32
star
35

samples-server

Go
32
star
36

tcld

The temporal cloud cli.
Go
27
star
37

temporal-render-simple

temporal-render-simple
Shell
25
star
38

api-go

Temporal gRPC API and proto files compiled for Go
Go
24
star
39

docker-builds

Temporal service Docker images build
Shell
22
star
40

roadrunner-temporal

Temporal PHP-SDK Host Process plugin for Roadrunner
Go
21
star
41

temporaldotio

Website for temporal.io. Built with Next.js + Preact + Tailwind, hosted on Vercel
JavaScript
20
star
42

spring-boot-demo

Sample application demonstrating Temporal JavaSDK Spring Boot integration
Java
20
star
43

edu-101-go-code

Code used in exercises and demonstrations for the "Temporal 101 with Go" course
CSS
20
star
44

temporal-pendulum

Demo showing off Temporal Polyglot features (Java, Go, TypeScript, PHP)
Java
16
star
45

vscode-debugger-extension

Visual Studio Code debugger plugin
TypeScript
16
star
46

ringpop-go

Go
16
star
47

subscription-workflow-project-template-go

Go
13
star
48

benchmark-workers

Pre-written workflows and activities useful for benchmarking Temporal
Go
12
star
49

temporal-aws-sdk-go

Temporal activities and workflow stubs that wrap AWS Go SDK
Go
12
star
50

features

Behavior and history compatibility testing for Temporal SDKs
Go
11
star
51

subscription-workflow-project-template-php

Subscription Workflow Project Template for PHP
PHP
11
star
52

graphql

GraphQL API for Temporal Server
HTML
11
star
53

subscription-workflow-project-template-typescript

This project template illustrates the design pattern for subscription style business logic.
TypeScript
11
star
54

money-transfer-project-template-java

Java
10
star
55

sagas-temporal-trip-booking

Java
10
star
56

sdk-scala

Scala SDK for Temporal
9
star
57

github-repo-notion-sync

Sync an organization's GitHub repo list to a Notion DB
TypeScript
9
star
58

benchmark-matrix

Automated benchmarks for Temporal
TypeScript
7
star
59

api-cloud

Temporal cloud gRPC API and proto files
Makefile
7
star
60

hello-world-project-template-go

Go
7
star
61

temporal-compensating-transactions

A four implementations of the Compensating Transaction pattern in Temporal in go, python, java and typescript
Java
6
star
62

xk6-temporal

k6 Extension for testing/benchmarking Temporal
Go
6
star
63

hello-world-project-template-java

Java
6
star
64

omes

A load generator for Temporal
C#
6
star
65

subscription-workflow-project-template-java

Subscription workflow project template for Java
Java
5
star
66

edu-101-java-code

Code Exercises for Temporal 101 in java
CSS
4
star
67

edu-102-go-code

Code used in exercises and demonstrations for the "Temporal 102 with Go" course
Go
4
star
68

temporal-aws-sdk-generator

AWS SDK Bindings Generator
Go
4
star
69

docusaurus-plugin-snipsync

Snipsync plugin for docusaurus - insert snippets into markdown files
TypeScript
4
star
70

documentation-samples-python

Python
4
star
71

terraform-provider-temporalcloud

Terraform provider for Temporal Cloud
Go
4
star
72

edu-101-typescript-code

Code used in exercises and demonstrations for the Temporal 101 (TypeScript) course
CSS
3
star
73

temporal-animations

A toolkit for creating animations explaining Temporal
Python
3
star
74

documentation-samples-go

Go
3
star
75

homebrew-brew

The official Homebrew tap for temporalio
Ruby
3
star
76

graphql-proxy

GraphQL API for Temporal Server
Java
3
star
77

team

The Temporal team
3
star
78

email-subscription-project-python

Python
3
star
79

temporal-development-patterns-whitepapers

Temporal Development Patterns Whitepapers
Java
2
star
80

idea-settings

2
star
81

cloud-samples-go

Temporal Cloud Samples - Go
Go
2
star
82

demo-go

Go
2
star
83

worker-versioning-replay-demo

TypeScript
2
star
84

setup-temporal

TypeScript
2
star
85

ringpop-common

JavaScript
2
star
86

cheatsheets

Cheatsheets for the Temporal CLI
2
star
87

sdk-php-interceptors-opentelemetry

Opentelemetry interceptors package for PHP SDK
PHP
2
star
88

temporal-vscode

temporal-vscode
1
star
89

replay-demo-2023

Replay Demo 2023: Workflow Update, Schedules and Worker Versioning
Go
1
star
90

test-docs-integration

Ryland test
1
star
91

documentation-images

1
star
92

edu-102-python-code

Code used in exercises and demonstrations for the "Temporal 102 with Python" course
Python
1
star
93

tctl-kit

Tools for CLI to help with configuration, pagination, printing of objects, formatting, coloring etc
Go
1
star
94

screencast-history

Temporal Screencast Setup and Code
Go
1
star
95

screencast-encryption-with-go-sdk

Resources to accompany the Encryption in Temporal Go SDK Screencast
Go
1
star
96

email-subscription-project-go

The project files for the Subscription Workflow in Go tutorial.
Go
1
star
97

temporal-demo-infra

Svelte
1
star
98

temporal-cafe

Go
1
star
99

edu-101-python-code

Code Exercises for Temporal 101 in Python
CSS
1
star
100

xk6-temporalite

k6 extension allowing a Temporalite server to be started and instrumented with k6
Go
1
star