⚠️ Temporal CLI's API is still subject to change.⚠️
Use the CLI to run a Temporal Server and interact with it.
You can install the CLI using one of the below methods.
curl -sSf https://temporal.download/cli.sh | sh
brew install temporal
- Download the version for your OS and architecture:
- Linux amd64
- Linux arm64
- macOS amd64
- macOS arm64 (Apple silicon)
- Windows amd64
- Windows arm64
- Extract the downloaded archive.
- Add the
temporal
binary to your PATH. (temporal.exe
for Windows)
You can also download older versions from GitHub releases.
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
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
.
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]
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
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
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
.
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.
See the CLI docs for a list of env vars.
The Temporal CLI has the capability to auto-complete commands.
Running temporal completion SHELL
will output completion setup code for the given shell.
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 relies on bash-completion
.
Install the software with the steps provided here, or use your preferred package manager on your operating system.
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
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
See CONTRIBUTING.md
-
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-archived#118
-
When running the executables from the Releases page in macOS you will need to click "Allow Anyway" in
Security & Privacy
settings: