Skip to main content
truss chains [OPTIONS] COMMAND [ARGS]...
CommandDescription
initInitialize a Chain project
pushDeploy a Chain
watchLive reload development

init

Initialize a Chain project.
truss chains init [OPTIONS] [DIRECTORY]
  • DIRECTORY (optional): Path to a new or empty directory for the Chain. Defaults to the current directory if omitted.
Options:
  • --log [humanfriendly | INFO | DEBUG]: Set log verbosity.
  • --help: Show this message and exit.
Example: To create a new Chain project in a directory called my-chain, use the following:
truss chains init my-chain

push

Deploy a Chain.
truss chains push [OPTIONS] SOURCE [ENTRYPOINT]
  • SOURCE: Path to a Python file that contains the entrypoint chainlet.
  • ENTRYPOINT (optional): Class name of the entrypoint chainlet. If omitted, the chainlet tagged with @chains.mark_entrypoint is used.
Options:
  • --name (TEXT): Custom name for the Chain (defaults to entrypoint name).
  • --publish / --no-publish: Create chainlets as a published deployment.
  • --promote / --no-promote: Promote newly deployed chainlets into production.
  • --environment (TEXT): Deploy chainlets into a particular environment.
  • --wait / --no-wait: Wait until all chainlets are ready (or deployment failed).
  • --watch / --no-watch: Watch the Chains source code and apply live patches. Using this option waits for the Chain to be deployed (the --wait flag is applied) before starting to watch for changes. This option requires the deployment to be a development deployment.
  • --experimental-chainlet-names (TEXT): Run watch, but only apply patches to specified chainlets. The option is a comma-separated list of chainlet (display) names. This option can give faster dev loops, but also lead to inconsistent deployments. Use with caution and refer to docs.
  • --dryrun: Produce only generated files, but don’t deploy anything.
  • --remote (TEXT): Name of the remote in .trussrc to push to.
  • --log [humanfriendly|I|INFO|D|DEBUG]: Customize logging.
  • --help: Show this message and exit.
Example: To deploy a Chain as a development deployment, use the following:
truss chains push my_chain.py
To deploy and promote to production, use the following:
truss chains push my_chain.py --publish --promote

watch

Live reload development.
truss chains watch [OPTIONS] SOURCE [ENTRYPOINT]
  • SOURCE: Path to a Python file containing the entrypoint chainlet.
  • ENTRYPOINT (optional): Class name of the entrypoint chainlet. If omitted, the chainlet tagged with @chains.mark_entrypoint is used.
Options:
  • --name (TEXT): Name of the Chain to be deployed. If not given, the entrypoint name is used.
  • --remote (TEXT): Name of the remote in .trussrc to push to.
  • --experimental-chainlet-names (TEXT): Run watch, but only apply patches to specified chainlets. The option is a comma-separated list of chainlet (display) names. This option can give faster dev loops, but also lead to inconsistent deployments. Use with caution and refer to docs.
  • --log [humanfriendly|W|WARNING|I|INFO|D|DEBUG]: Customize logging.
  • --help: Show this message and exit.
Example: To watch a Chain for live reload during development, use the following:
truss chains watch my_chain.py