exemplar-cli 0.1.5__tar.gz → 0.1.7__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.1
2
2
  Name: exemplar-cli
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: Exemplar terminal CLI for skills, prompts, gateway catalog, and memory
5
5
  License: LicenseRef-Proprietary
6
6
  Author: Exemplar Dev LLC
@@ -10,7 +10,7 @@ Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
- Requires-Dist: exemplar-core (>=0.1.4,<0.2)
13
+ Requires-Dist: exemplar-core (>=0.1.6,<0.2)
14
14
  Description-Content-Type: text/markdown
15
15
 
16
16
  # exemplar-cli
@@ -6,7 +6,6 @@ import argparse
6
6
  import sys
7
7
 
8
8
  from exemplar_cli.doctor import main as doctor_main
9
- from exemplar_cli.gateway import main as gateway_main
10
9
  from exemplar_cli.memory import main as memory_main
11
10
  from exemplar_cli.prompts import main as prompts_main
12
11
  from exemplar_cli.skills import main as skills_main
@@ -15,7 +14,6 @@ _EPILOG = """
15
14
  Commands:
16
15
  skills Manage org agent skills (pull to Cursor/Claude, push from disk)
17
16
  prompts Manage versioned prompt templates (create, run, publish)
18
- gateway List AI gateway providers and live models
19
17
  memory Manage long-term agent memory (add, search, recall)
20
18
  doctor Verify install, PATH, and EXEMPLAR_API_KEY
21
19
 
@@ -23,7 +21,6 @@ Examples:
23
21
  exemplar doctor
24
22
  exemplar skills pull refund-policy
25
23
  exemplar prompts list
26
- exemplar gateway providers
27
24
  exemplar memory add "User prefers bullets" --user-id u1
28
25
 
29
26
  Run `exemplar <command> --help` for full subcommand reference.
@@ -43,7 +40,7 @@ def _build_root_parser() -> argparse.ArgumentParser:
43
40
  parser.add_argument(
44
41
  "command",
45
42
  nargs="?",
46
- choices=["skills", "memory", "prompts", "gateway", "doctor"],
43
+ choices=["skills", "memory", "prompts", "doctor"],
47
44
  help="Command group to run",
48
45
  )
49
46
  parser.add_argument("args", nargs=argparse.REMAINDER, help=argparse.SUPPRESS)
@@ -52,15 +49,13 @@ def _build_root_parser() -> argparse.ArgumentParser:
52
49
 
53
50
  def main(argv: list[str] | None = None) -> int:
54
51
  raw = list(argv if argv is not None else sys.argv[1:])
55
- if raw and raw[0] in ("skills", "memory", "prompts", "gateway", "doctor"):
52
+ if raw and raw[0] in ("skills", "memory", "prompts", "doctor"):
56
53
  if raw[0] == "skills":
57
54
  return skills_main(raw[1:])
58
55
  if raw[0] == "memory":
59
56
  return memory_main(raw[1:])
60
57
  if raw[0] == "prompts":
61
58
  return prompts_main(raw[1:])
62
- if raw[0] == "gateway":
63
- return gateway_main(raw[1:])
64
59
  if raw[0] == "doctor":
65
60
  return doctor_main(raw[1:])
66
61
 
@@ -29,8 +29,11 @@ def _cmd_list(args: argparse.Namespace) -> int:
29
29
  return 0
30
30
 
31
31
 
32
+ _PROMPT_REF_HELP = "Prompt ID (prompt_…) or unique name"
33
+
34
+
32
35
  def _cmd_get(args: argparse.Namespace) -> int:
33
- record = prompts_from_env().get(args.prompt_id)
36
+ record = prompts_from_env().get(args.prompt_ref)
34
37
  if args.json:
35
38
  print(json.dumps(_record_dict(record), indent=2))
36
39
  return 0
@@ -77,7 +80,7 @@ def _cmd_run(args: argparse.Namespace) -> int:
77
80
  return 1
78
81
  key, value = pair.split("=", 1)
79
82
  variables[key.strip()] = value
80
- result = prompts_from_env().run(args.prompt_id, variables=variables, model=args.model)
83
+ result = prompts_from_env().run(args.prompt_ref, variables=variables, model=args.model)
81
84
  if args.json:
82
85
  print(json.dumps(result, indent=2))
83
86
  else:
@@ -90,7 +93,7 @@ def _cmd_publish(args: argparse.Namespace) -> int:
90
93
  if args.user:
91
94
  messages.append({"role": "user", "content": args.user})
92
95
  record = prompts_from_env().publish_version(
93
- args.prompt_id,
96
+ args.prompt_ref,
94
97
  messages=messages,
95
98
  change_notes=args.notes,
96
99
  )
@@ -102,8 +105,8 @@ def _cmd_publish(args: argparse.Namespace) -> int:
102
105
 
103
106
 
104
107
  def _cmd_delete(args: argparse.Namespace) -> int:
105
- prompts_from_env().delete(args.prompt_id)
106
- print(f"Deleted {args.prompt_id}")
108
+ prompts_from_env().delete(args.prompt_ref)
109
+ print(f"Deleted {args.prompt_ref}")
107
110
  return 0
108
111
 
109
112
 
@@ -120,8 +123,8 @@ def build_parser() -> argparse.ArgumentParser:
120
123
  " exemplar prompts list\n"
121
124
  " exemplar prompts create support-summary --title \"Support\" \\\n"
122
125
  " --system \"Be concise.\" --user \"Topic: {{topic}}.\" --variables topic\n"
123
- " exemplar prompts run prompt_abc --var topic=returns\n"
124
- " exemplar prompts publish prompt_abc --system \"Be concise.\" --notes \"v2\"\n"
126
+ " exemplar prompts run incident-summary --var topic=returns\n"
127
+ " exemplar prompts publish incident-summary --system \"Be concise.\" --notes \"v2\"\n"
125
128
  ),
126
129
  )
127
130
  sub = parser.add_subparsers(dest="command", required=True, metavar="COMMAND")
@@ -138,10 +141,10 @@ def build_parser() -> argparse.ArgumentParser:
138
141
 
139
142
  get_p = sub.add_parser(
140
143
  "get",
141
- help="Show prompt messages by ID",
144
+ help="Show prompt messages by ID or name",
142
145
  description="Fetch a prompt and print its message templates (or full record with --json).",
143
146
  )
144
- get_p.add_argument("prompt_id", metavar="ID", help="Prompt ID (prompt_...)")
147
+ get_p.add_argument("prompt_ref", metavar="ID_OR_NAME", help=_PROMPT_REF_HELP)
145
148
  get_p.add_argument("--json", action="store_true", help="Output full prompt record as JSON")
146
149
  get_p.set_defaults(func=_cmd_get)
147
150
 
@@ -186,7 +189,7 @@ def build_parser() -> argparse.ArgumentParser:
186
189
  help="Execute a prompt with template variables",
187
190
  description="Run a prompt through the Exemplar platform and print the model response.",
188
191
  )
189
- run_p.add_argument("prompt_id", metavar="ID", help="Prompt ID (prompt_...)")
192
+ run_p.add_argument("prompt_ref", metavar="ID_OR_NAME", help=_PROMPT_REF_HELP)
190
193
  run_p.add_argument(
191
194
  "--var",
192
195
  action="append",
@@ -202,7 +205,7 @@ def build_parser() -> argparse.ArgumentParser:
202
205
  help="Publish a new version of an existing prompt",
203
206
  description="Add a new immutable version with updated messages and change notes.",
204
207
  )
205
- publish_p.add_argument("prompt_id", metavar="ID", help="Prompt ID (prompt_...)")
208
+ publish_p.add_argument("prompt_ref", metavar="ID_OR_NAME", help=_PROMPT_REF_HELP)
206
209
  publish_p.add_argument("--system", required=True, help="System message for the new version")
207
210
  publish_p.add_argument("--user", help="User message template for the new version")
208
211
  publish_p.add_argument(
@@ -216,9 +219,9 @@ def build_parser() -> argparse.ArgumentParser:
216
219
  delete_p = sub.add_parser(
217
220
  "delete",
218
221
  help="Delete a prompt from the registry",
219
- description="Permanently remove a prompt template by ID.",
222
+ description="Permanently remove a prompt template by ID or unique name.",
220
223
  )
221
- delete_p.add_argument("prompt_id", metavar="ID", help="Prompt ID (prompt_...)")
224
+ delete_p.add_argument("prompt_ref", metavar="ID_OR_NAME", help=_PROMPT_REF_HELP)
222
225
  delete_p.set_defaults(func=_cmd_delete)
223
226
 
224
227
  return parser
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "exemplar-cli"
3
- version = "0.1.5"
3
+ version = "0.1.7"
4
4
  description = "Exemplar terminal CLI for skills, prompts, gateway catalog, and memory"
5
5
  authors = ["Exemplar Dev LLC"]
6
6
  license = "LicenseRef-Proprietary"
@@ -9,7 +9,7 @@ packages = [{ include = "exemplar_cli" }]
9
9
 
10
10
  [tool.poetry.dependencies]
11
11
  python = ">=3.10,<4.0"
12
- exemplar-core = ">=0.1.4,<0.2"
12
+ exemplar-core = ">=0.1.6,<0.2"
13
13
 
14
14
  [tool.poetry.scripts]
15
15
  exemplar = "exemplar_cli.main:main"
@@ -1,111 +0,0 @@
1
- """CLI: exemplar gateway — list AI gateway providers and live models."""
2
-
3
- from __future__ import annotations
4
-
5
- import argparse
6
- import json
7
- import sys
8
-
9
- from exemplar_core import gateway_from_env
10
-
11
-
12
- def _cmd_providers(args: argparse.Namespace) -> int:
13
- providers = gateway_from_env().list_providers(llm_only=not args.all_providers)
14
- if args.json:
15
- print(
16
- json.dumps(
17
- [
18
- {
19
- "provider_key": p.provider_key,
20
- "display_name": p.display_name,
21
- "categories": p.categories,
22
- }
23
- for p in providers
24
- ],
25
- indent=2,
26
- )
27
- )
28
- return 0
29
- for item in providers:
30
- cats = ",".join(item.categories) or "-"
31
- print(f"{item.provider_key}\t{item.display_name}\t{cats}")
32
- return 0
33
-
34
-
35
- def _cmd_models(args: argparse.Namespace) -> int:
36
- result = gateway_from_env().list_models(args.provider)
37
- if args.json:
38
- print(
39
- json.dumps(
40
- {
41
- "provider_key": result.provider_key,
42
- "source": result.source,
43
- "error": result.error,
44
- "models": [
45
- {
46
- "gateway_model_id": m.gateway_model_id,
47
- "name": m.name,
48
- }
49
- for m in result.models
50
- ],
51
- },
52
- indent=2,
53
- )
54
- )
55
- return 0
56
- if result.error:
57
- print(f"unavailable: {result.error}", file=sys.stderr)
58
- return 1
59
- for model in result.models:
60
- print(f"{model.gateway_model_id}\t{model.name}")
61
- return 0
62
-
63
-
64
- def main(argv: list[str] | None = None) -> int:
65
- parser = argparse.ArgumentParser(
66
- prog="exemplar gateway",
67
- description=(
68
- "List AI gateway providers and live upstream models from the Exemplar "
69
- "integration-service catalog (/api/gateway)."
70
- ),
71
- epilog=(
72
- "Examples:\n"
73
- " exemplar gateway providers\n"
74
- " exemplar gateway models --provider gemini\n"
75
- ),
76
- formatter_class=argparse.RawDescriptionHelpFormatter,
77
- )
78
- sub = parser.add_subparsers(dest="command", required=True)
79
-
80
- providers_p = sub.add_parser(
81
- "providers",
82
- help="List gateway LLM providers",
83
- description="List providers from integrations/gateway_providers.yaml.",
84
- )
85
- providers_p.add_argument(
86
- "--all-providers",
87
- action="store_true",
88
- help="Include non-LLM providers (default: LLM only)",
89
- )
90
- providers_p.add_argument("--json", action="store_true", help="Output JSON")
91
- providers_p.set_defaults(func=_cmd_providers)
92
-
93
- models_p = sub.add_parser(
94
- "models",
95
- help="List live models for a provider",
96
- description="Proxy live model list from exemplar-ai-gateway for a connected provider.",
97
- )
98
- models_p.add_argument(
99
- "provider",
100
- metavar="PROVIDER",
101
- help="Provider key, e.g. openai or gemini",
102
- )
103
- models_p.add_argument("--json", action="store_true", help="Output JSON")
104
- models_p.set_defaults(func=_cmd_models)
105
-
106
- args = parser.parse_args(argv)
107
- return int(args.func(args))
108
-
109
-
110
- if __name__ == "__main__":
111
- raise SystemExit(main())
File without changes