sreq service

Manage service configurations.

Synopsis

sreq service <command> [flags]

Subcommands

CommandDescription
sreq service listList all configured services
sreq service add <name>Add a new service
sreq service remove <name>Remove a service

sreq service list

List all configured services.

sreq service list

Output:

Configured services:

  auth-service
    consul_key: auth
    aws_prefix: auth-svc

  billing-service
    consul_key: billing
    aws_prefix: billing

sreq service add

Add a new service configuration.

Simple Mode

Use path templates defined in config.yaml:

sreq service add auth-service --consul-key auth --aws-prefix auth-svc
FlagDescription
--consul-keyKey prefix for Consul paths
--aws-prefixPrefix for AWS Secrets Manager paths

This creates:

services:
  auth-service:
    consul_key: auth
    aws_prefix: auth-svc

With path templates like services/{service}/{env}/base_url, sreq will look for:

  • Consul: services/auth/dev/base_url
  • AWS: auth-svc/dev/credentials#password

Advanced Mode

Specify explicit paths for each credential:

sreq service add invoice-api \
  --path base_url=consul:billing/invoice/url \
  --path username=consul:billing/invoice/user \
  --path password=aws:billing-secrets/invoice#pass
FlagDescription
--pathExplicit path mapping as key=provider:path (repeatable)

This creates:

services:
  invoice-api:
    paths:
      base_url: "consul:billing/invoice/url"
      username: "consul:billing/invoice/user"
      password: "aws:billing-secrets/invoice#pass"

Path Format

For advanced mode, paths use the format:

provider:path[#json_key]
PartDescriptionExample
providerProvider nameconsul, aws
pathPath in the providerservices/auth/url
#json_keyOptional JSON key extraction#password

Examples:

consul:services/auth/base_url           # Consul KV value
aws:auth/dev/creds                      # AWS secret (full value)
aws:auth/dev/creds#password             # AWS secret JSON key

sreq service remove

Remove a service configuration.

sreq service remove auth-service

Output:

Removed service: auth-service

Configuration Location

Services are stored in ~/.sreq/config.yaml under the services key:

services:
  auth-service:
    consul_key: auth
    aws_prefix: auth-svc

  billing-service:
    consul_key: billing
    aws_prefix: billing

Alternatively, services can be defined in a separate ~/.sreq/services.yaml file.

See Also

  • run — Make requests to services
  • Configuration — Full configuration reference