Coder Social home page Coder Social logo

samarabbas / cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from temporalio/cli

0.0 0.0 0.0 51.5 MB

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

Home Page: https://docs.temporal.io/cli

License: MIT License

Shell 10.32% Go 89.40% Makefile 0.23% Dockerfile 0.05%

cli's Introduction

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

See CONTRIBUTING.md

⚠️ 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-archived#118

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

image (1)

cli's People

Contributors

feedmeapples avatar dependabot[bot] avatar jlegrone avatar robholland avatar alexshtin avatar josh-berry avatar dnr avatar djsanti avatar samanbarghi avatar lorensr avatar sebneira avatar jbreiding avatar rodrigozhou avatar cretz avatar yycptt avatar bergundy avatar yux0 avatar sushisource avatar jackdawm avatar meiliang86 avatar stephanos avatar stevekinney avatar grantfuhr avatar pdoerner avatar laertispappas avatar k24dizzle avatar mightyshazam avatar laniehei avatar plaisted avatar nagl-temporal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.