cli

command
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Semaphore Command Line

What is Semaphore Command Line?

The Semaphore Command Line is a CLI tool to interact with Semaphore in your terminal.
For now it supports the following commands:

  • evaluate to evaluate feature flags directly in your terminal
  • lint to validate a configuration file format.
  • generate manifest to create an OpenFeature flag manifest.
  • publish to publish flag files and flag-set documents to S3 behind a manifest (publish verify checks the bucket).
  • config validate and config print --effective to check the version 2 bootstrap file of the relay.

See publish and config.

How to build the cli

make build-cli   # from the repository root; binary: out/bin/semaphore-cli

The examples below call the binary semaphore-cli; use out/bin/semaphore-cli.

How to use the command line

semaphore-cli is a command line tool.

How to evaluate a flag

The evaluate command allows you to evaluate a feature flag or inspect the configuration of your retriever using --check-mode

semaphore-cli evaluate [OPTIONS]
Key Flags
Flag Shorthand Description Default
--kind k Kind of configuration source. Determines where to read your flags from file
--config c Path to the local flag configuration file (⚠️ deprecated, use --path instead) ""
--format f Format of your input file (YAML, JSON or TOML) yaml
--flag Name of the flag to evaluate ""
--timeout Timeout in seconds to access your configuration file 0
--ctx Evaluation context as a json string {}
--check-mode Check only mode - when set, the command will not perform any
evaluation and returns the configuration of spanned retriever
false

Supported values for --kind are:

  • file
  • http
  • github
  • gitlab
  • s3
  • googleStorage
  • configmap (kubernetes)
  • mongodb
  • bitbucket
  • azureBlobStorage
  • postgresql

Caution: The redis retriever is not supported by this command.

Retriever specific flags

The aforementioned --kind parameter is used to determine the retriever to use. The semantic meaning of other flags depends on that one, for example --path parameter is used to specify local file when --kind being file but when --kind being github it is used to specify the path to the remote file.

File
Flag Description Default
--path Path to the local flag configuration file ""
HTTP
Flag Description Default
--url URL of the remote flag configuration file ""
--method HTTP method to access your configuration file on HTTP GET
--body Http body to access your configuration file on HTTP ""
--header Header to add to the request. Supported formats are k:v and k=v ""
GitHub
Flag Description Default
--repository-slug Name of the repository ""
--branch Git branch name ""
--auth-token Authentication token to access your configuration file ""
--github-token Authentication token to access your configuration file on GitHub
(⚠️ deprecated, use --auth-token instead)
""
--path Path to the remote flag configuration file inside github repository ""
GitLab
Flag Description Default
--base-url Base URL of your configuration file on Gitlab ""
--repository-slug Name of the repository ""
--branch Git branch name ""
--path Path to the remote flag configuration file inside gitlab repository ""
BitBucket
Flag Description Default
--base-url Base URL of your configuration file on BitBucket ""
--repository-slug Name of the repository ""
--branch Git branch name ""
--path Path to the remote flag configuration file inside bitbucket repository ""
S3
Flag Description Default
--bucket Name of the bucket ""
--item Item of the bucket ""
Google Storage
Flag Description Default
--bucket Name of the bucket ""
--object Object of the bucket ""
ConfigMap (Kubernetes)
Flag Description Default
--namespace Namespace of the ConfigMap "default"
--config-map Name of the ConfigMap ""
--key Key of the ConfigMap ""
MongoDB
Flag Description Default
--uri URI of your configuration file ""
--database Database name of your configuration file on mongodb ""
--collection Collection of your configuration file on mongodb ""
Azure Blob Storage
Flag Description Default
--account-name Name of the storage account ""
--account-key Key of the storage account ""
--container Name of the container ""
--object Name of the object blob ""
PostgreSQL
Flag Description Default
--uri URI of your configuration file ""
--table Table of your configuration file ""
--column Column mapping to add. Supported format is c1:c2 ""

As mentioned above the --config flag is deprecated and we encourage you to use the --path flag instead. For example the following command:

semaphore-cli evaluate --config="<location_of_your_flag_configuration_file>" --flag="<name_of_your_flag_to_evaluate>" --ctx='<evaluation_ctx_as_json_string>'

may be replaced by:

semaphore-cli evaluate --kind="file" --path="<location_of_your_flag_configuration_file>" --flag="<name_of_your_flag_to_evaluate>" --ctx='<evaluation_ctx_as_json_string>'

How to lint a configuration file

semaphore-cli lint <location_of_your_flag_configuration_file> --format="<yaml or json or toml>"

License

View license information for the software contained in this image.

How can I contribute?

This project is open for contribution, see the contributor's guide for some helpful tips.

Documentation

Overview

Package main is the entry point of the semaphore command line tool.

Directories

Path Synopsis
Package cliapp wires and runs the semaphore-cli command line.
Package cliapp wires and runs the semaphore-cli command line.
Package config implements "semaphore-cli config validate" and "semaphore-cli config print --effective": thin commands over the strict loader of the version 2 bootstrap file (cmd/relayproxy/bootstrap).
Package config implements "semaphore-cli config validate" and "semaphore-cli config print --effective": thin commands over the strict loader of the version 2 bootstrap file (cmd/relayproxy/bootstrap).
Package evaluate implements the command that evaluates a feature flag for a given context.
Package evaluate implements the command that evaluates a feature flag for a given context.
retrieverconf
Package retrieverconf defines the configuration of the retrievers and their serializable options.
Package retrieverconf defines the configuration of the retrievers and their serializable options.
retrieverconf/init
Package init creates the retrievers from their configuration.
Package init creates the retrievers from their configuration.
Package generate implements the command group that generates Semaphore related files.
Package generate implements the command group that generates Semaphore related files.
manifest
Package manifest implements the command that generates a flag manifest from a configuration file.
Package manifest implements the command that generates a flag manifest from a configuration file.
manifest/model
Package model defines the flag manifest document structure written by the manifest command.
Package model defines the flag manifest document structure written by the manifest command.
Package helper provides the flag type resolution and output helpers shared by the command line commands.
Package helper provides the flag type resolution and output helpers shared by the command line commands.
Package linter implements the command that lints a Semaphore flag configuration file.
Package linter implements the command that lints a Semaphore flag configuration file.
Package publish implements "semaphore-cli publish": it reads a directory of flag files and flag-set documents, builds the manifest and publishes both to S3 with controlplane/s3publish, and "semaphore-cli publish verify", which checks what the bucket holds.
Package publish implements "semaphore-cli publish": it reads a directory of flag files and flag-set documents, builds the manifest and publishes both to S3 with controlplane/s3publish, and "semaphore-cli publish verify", which checks what the bucket holds.
Package segment is the semaphore-cli segment command group: import, add, remove and stat for the members of a dynamic segment in a Valkey or Redis store.
Package segment is the semaphore-cli segment command group: import, add, remove and stat for the members of a dynamic segment in a Valkey or Redis store.

Jump to

Keyboard shortcuts

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