@@ -155,6 +155,36 @@ def test_list_models(capfd: CaptureFixture[str]):
155
155
assert models == set (), models
156
156
157
157
158
+ def test_cli_help (capfd : CaptureFixture [str ]):
159
+ with pytest .raises (SystemExit ):
160
+ cli (['--help' ])
161
+
162
+ assert capfd .readouterr ().out .splitlines () == snapshot (
163
+ [
164
+ IsStr (),
165
+ ' [--version] [PROMPT]' ,
166
+ '' ,
167
+ '' ,
168
+ IsStr (regex = '[A-Za-z0-9_]+.*' ),
169
+ ' prompt AI Prompt, if omitted fall into interactive mode' ,
170
+ '' ,
171
+ IsStr (regex = '[A-Za-z0-9_]+.*' ),
172
+ ' -m, --model TEXT Model to use, in format "<provider>:<model>" e.g.' ,
173
+ ' "openai:gpt-4.1" or "anthropic:claude-sonnet-4-0".' ,
174
+ ' Defaults to "openai:gpt-4.1".' ,
175
+ ' -a, --agent TEXT Custom Agent to use, in format "module:variable",' ,
176
+ ' e.g. "mymodule.submodule:my_agent"' ,
177
+ ' -l, --list-models List all available models and exit' ,
178
+ ' -t, --code-theme TEXT Which colors to use for code, can be "dark", "light"' ,
179
+ ' or any theme from pygments.org/styles/. Defaults to' ,
180
+ ' "dark" which works well on dark terminals.' ,
181
+ ' --no-stream Disable streaming from the model' ,
182
+ ' --version Show version and exit' ,
183
+ ' -h, --help Show this message and exit.' ,
184
+ ]
185
+ )
186
+
187
+
158
188
def test_cli_prompt (capfd : CaptureFixture [str ], env : TestEnv ):
159
189
env .set ('OPENAI_API_KEY' , 'test' )
160
190
with cli_agent .override (model = TestModel (custom_output_text = '# result\n \n ```py\n x = 1\n ```' )):
0 commit comments