trefoil-cli 0.7.0__tar.gz → 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {trefoil_cli-0.7.0 → trefoil_cli-0.9.0}/PKG-INFO +1 -1
- {trefoil_cli-0.7.0 → trefoil_cli-0.9.0}/package.py +23 -2
- {trefoil_cli-0.7.0 → trefoil_cli-0.9.0}/pyproject.toml +1 -1
- {trefoil_cli-0.7.0 → trefoil_cli-0.9.0}/trefoil_cli.egg-info/PKG-INFO +1 -1
- {trefoil_cli-0.7.0 → trefoil_cli-0.9.0}/setup.cfg +0 -0
- {trefoil_cli-0.7.0 → trefoil_cli-0.9.0}/trefoil_cli.egg-info/SOURCES.txt +0 -0
- {trefoil_cli-0.7.0 → trefoil_cli-0.9.0}/trefoil_cli.egg-info/dependency_links.txt +0 -0
- {trefoil_cli-0.7.0 → trefoil_cli-0.9.0}/trefoil_cli.egg-info/entry_points.txt +0 -0
- {trefoil_cli-0.7.0 → trefoil_cli-0.9.0}/trefoil_cli.egg-info/requires.txt +0 -0
- {trefoil_cli-0.7.0 → trefoil_cli-0.9.0}/trefoil_cli.egg-info/top_level.txt +0 -0
|
@@ -27,6 +27,8 @@ Usage: trefoil <domain> <command> [args]
|
|
|
27
27
|
trefoil sessions status|logs|result --agent=NAME ID
|
|
28
28
|
trefoil sessions rerun --agent=NAME ID [-d]
|
|
29
29
|
trefoil sessions artifacts --agent=NAME ID [-o DIR]
|
|
30
|
+
trefoil secrets list
|
|
31
|
+
trefoil secrets set --name=NAME
|
|
30
32
|
trefoil jobs list [--agent=NAME] [--status=STATUS]
|
|
31
33
|
trefoil jobs status ID [-f] [--logs]
|
|
32
34
|
"""
|
|
@@ -51,7 +53,7 @@ import yaml
|
|
|
51
53
|
|
|
52
54
|
DEFAULT_SERVER = "http://localhost:8080"
|
|
53
55
|
EXAMPLES_API = "https://api.github.com/repos/alto-se/trefoil/contents/examples"
|
|
54
|
-
|
|
56
|
+
ENGINE_REPO = "ghcr.io/alto-se/trefoil-api"
|
|
55
57
|
|
|
56
58
|
|
|
57
59
|
class Ref:
|
|
@@ -533,6 +535,16 @@ def cmd_secrets_set(args):
|
|
|
533
535
|
print(f"stored secret {args.name} on {args.server}", file=sys.stderr)
|
|
534
536
|
|
|
535
537
|
|
|
538
|
+
def cmd_secrets_list(args):
|
|
539
|
+
secrets = api_request(args.server, "GET", "/secrets")
|
|
540
|
+
rows = [
|
|
541
|
+
(s["name"], "yes" if s["required"] else "no",
|
|
542
|
+
s["source"] or ("missing" if s["required"] else "not set"), ", ".join(s["agents"]))
|
|
543
|
+
for s in secrets
|
|
544
|
+
]
|
|
545
|
+
print_table(("NAME", "REQUIRED", "SOURCE", "USED BY"), rows, empty="no secrets")
|
|
546
|
+
|
|
547
|
+
|
|
536
548
|
def cmd_params_list(args):
|
|
537
549
|
params = api_request(args.server, "GET", "/params")
|
|
538
550
|
rows = [
|
|
@@ -710,6 +722,12 @@ def cli_version():
|
|
|
710
722
|
return "unknown"
|
|
711
723
|
|
|
712
724
|
|
|
725
|
+
def engine_image():
|
|
726
|
+
"""The API image released with this CLI (same version), or :latest when unknown."""
|
|
727
|
+
version = cli_version()
|
|
728
|
+
return f"{ENGINE_REPO}:{'latest' if version == 'unknown' else version}"
|
|
729
|
+
|
|
730
|
+
|
|
713
731
|
def main():
|
|
714
732
|
parser = argparse.ArgumentParser(prog="trefoil", description="trefoil <domain> <command> [args]")
|
|
715
733
|
parser.add_argument("--version", action="version", version=f"%(prog)s {cli_version()}")
|
|
@@ -749,7 +767,7 @@ def main():
|
|
|
749
767
|
engine_start.add_argument("--aws-region", metavar="REGION",
|
|
750
768
|
help="AWS region for bedrock (default: $AWS_REGION or the profile's region)")
|
|
751
769
|
engine_start.add_argument("--port", type=int, default=8080, help="host port to publish (default: 8080)")
|
|
752
|
-
engine_start.add_argument("--image", default=
|
|
770
|
+
engine_start.add_argument("--image", default=engine_image(), help=f"API image (default: {engine_image()})")
|
|
753
771
|
engine_start.add_argument("--name", default="trefoil-api", help="container name (default: trefoil-api)")
|
|
754
772
|
engine_start.add_argument("--volume", default="trefoil-data",
|
|
755
773
|
help="docker volume (or host path) for the data dir (default: trefoil-data)")
|
|
@@ -817,6 +835,9 @@ def main():
|
|
|
817
835
|
help="print the new session id and return instead of following the run")
|
|
818
836
|
|
|
819
837
|
secrets = domain("secrets", "provide secrets that agents' modules require")
|
|
838
|
+
secrets_list = secrets.add_parser("list", parents=[server],
|
|
839
|
+
help="list the secrets agents need and whether they're set (never values)")
|
|
840
|
+
secrets_list.set_defaults(func=cmd_secrets_list)
|
|
820
841
|
secrets_set = secrets.add_parser("set", parents=[server],
|
|
821
842
|
help="store a secret on the server (value from a prompt or stdin)")
|
|
822
843
|
secrets_set.add_argument("--name", required=True, metavar="NAME", help="secret name, e.g. github_token")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|