trefoil-cli 0.7.0__tar.gz → 0.8.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trefoil-cli
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary: CLI for the trefoil agent server
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: pyyaml>=6
@@ -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
  """
@@ -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 = [
@@ -817,6 +829,9 @@ def main():
817
829
  help="print the new session id and return instead of following the run")
818
830
 
819
831
  secrets = domain("secrets", "provide secrets that agents' modules require")
832
+ secrets_list = secrets.add_parser("list", parents=[server],
833
+ help="list the secrets agents need and whether they're set (never values)")
834
+ secrets_list.set_defaults(func=cmd_secrets_list)
820
835
  secrets_set = secrets.add_parser("set", parents=[server],
821
836
  help="store a secret on the server (value from a prompt or stdin)")
822
837
  secrets_set.add_argument("--name", required=True, metavar="NAME", help="secret name, e.g. github_token")
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "trefoil-cli"
3
- version = "0.7.0"
3
+ version = "0.8.0"
4
4
  description = "CLI for the trefoil agent server"
5
5
  requires-python = ">=3.10"
6
6
  dependencies = ["pyyaml>=6"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trefoil-cli
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary: CLI for the trefoil agent server
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: pyyaml>=6
File without changes