diff --git a/command_line_assistant/commands/history.py b/command_line_assistant/commands/history.py index b1340c1..f9b04ab 100644 --- a/command_line_assistant/commands/history.py +++ b/command_line_assistant/commands/history.py @@ -170,12 +170,12 @@ def register_subcommand(parser: SubParsersAction): """ history_parser = parser.add_parser( "history", - help="Manage conversation history", + help="Manage user conversation history", ) history_parser.add_argument( "--clear", action="store_true", - help="Clear the history.", + help="Clear the entire history.", ) history_parser.add_argument( "--first", @@ -188,7 +188,7 @@ def register_subcommand(parser: SubParsersAction): help="Get the last conversation from history.", ) history_parser.add_argument( - "--filter", help="Search for a specific string of text in the history." + "--filter", help="Search for a specific keyword of text in the history." ) history_parser.set_defaults(func=_command_factory) diff --git a/command_line_assistant/commands/query.py b/command_line_assistant/commands/query.py index 44ea9d8..86557ac 100644 --- a/command_line_assistant/commands/query.py +++ b/command_line_assistant/commands/query.py @@ -45,18 +45,18 @@ def __init__( self, query_string: Optional[str] = None, stdin: Optional[str] = None, - input: Optional[TextIOWrapper] = None, + attachment: Optional[TextIOWrapper] = None, ) -> None: """Constructor of the class. Args: query_string (Optional[str], optional): The query provided by the user. stdin (Optional[str], optional): The user redirect input from stdin - input (Optional[TextIOWrapper], optional): The file input from the user + attachment (Optional[TextIOWrapper], optional): The file attachment from the user """ self._query = query_string.strip() if query_string else None self._stdin = stdin.strip() if stdin else None - self._input = input + self._attachment = attachment self._spinner_renderer: SpinnerRenderer = create_spinner_renderer( message="Requesting knowledge from AI", @@ -100,8 +100,8 @@ def _get_input_source(self) -> str: str: The query string from the selected input source(s) """ file_content = None - if self._input: - file_content = self._input.read().strip() + if self._attachment: + file_content = self._attachment.read().strip() if is_content_in_binary_format(file_content): raise ValueError("File appears to be binary") @@ -182,18 +182,18 @@ def register_subcommand(parser: SubParsersAction) -> None: """ query_parser = parser.add_parser( "query", - help="Ask a question and get an answer from LLM.", + help="Command to ask a question to the LLM.", ) # Positional argument, required only if no optional arguments are provided query_parser.add_argument( - "query_string", nargs="?", help="Query string to be processed." + "query_string", nargs="?", help="The question that will be sent to the LLM" ) query_parser.add_argument( - "-i", - "--input", + "-a", + "--attachment", nargs="?", type=argparse.FileType("r"), - help="Read file from user system.", + help="File attachment to be read and sent alongside the query", ) query_parser.set_defaults(func=_command_factory) @@ -208,7 +208,11 @@ def _command_factory(args: Namespace) -> QueryCommand: Returns: QueryCommand: Return an instance of class """ - options = {"query_string": args.query_string, "stdin": None, "input": args.input} + options = { + "query_string": args.query_string, + "stdin": None, + "attachment": args.attachment, + } # We may not always have the stdin argument in the namespace. if "stdin" in args: diff --git a/command_line_assistant/utils/cli.py b/command_line_assistant/utils/cli.py index 394e928..9719417 100644 --- a/command_line_assistant/utils/cli.py +++ b/command_line_assistant/utils/cli.py @@ -93,18 +93,16 @@ def create_argument_parser() -> tuple[ArgumentParser, SubParsersAction]: """Create the argument parser for command line assistant.""" parser = ArgumentParser( prog="c", - description="A script with multiple optional arguments and a required positional argument if no optional arguments are provided.", + description="The Command Line Assistant powered by RHEL Lightspeed is a optional generative AI assistant available within the RHEL command line interface.", ) parser.add_argument( "--version", action="version", version=VERSION, default=SUPPRESS, - help="Show command line assistant version and exit.", - ) - commands_parser = parser.add_subparsers( - dest="command", help="command line assistant helpers" + help="Show program version", ) + commands_parser = parser.add_subparsers(dest="command") return parser, commands_parser diff --git a/data/release/man/c.1 b/data/release/man/c.1 index 13668cb..f280f9f 100644 --- a/data/release/man/c.1 +++ b/data/release/man/c.1 @@ -27,11 +27,12 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "C" "1" "Jan 09, 2025" "0.1.0" "Command Line Assistant" +.TH "C" "1" "Jan 15, 2025" "0.1.0" "Command Line Assistant" .SH NAME c \- Command Line Assistant Client +.SH SYNOPSIS .sp -A script with multiple optional arguments and a required positional argument if no optional arguments are provided. +The Command Line Assistant powered by RHEL Lightspeed is a optional generative AI assistant available within the RHEL command line interface. .INDENT 0.0 .INDENT 3.5 .sp @@ -40,39 +41,39 @@ c [\-h] [\-\-version] {query,history} ... .EE .UNINDENT .UNINDENT -.SH C OPTIONS +.SS c options .INDENT 0.0 .IP \(bu 2 \fI\%\-h\fP, \fI\%\-\-help\fP \- show this help message and exit .IP \(bu 2 -\fI\%\-\-version\fP \- Show command line assistant version and exit. +\fI\%\-\-version\fP \- Show program version .UNINDENT -.SH C QUERY +.SS c query .sp -Ask a question and get an answer from LLM. +Command to ask a question to the LLM. .INDENT 0.0 .INDENT 3.5 .sp .EX -c query [\-h] [\-i [INPUT]] [query_string] +c query [\-h] [\-a [ATTACHMENT]] [query_string] .EE .UNINDENT .UNINDENT .SS c query positional arguments .INDENT 0.0 .IP \(bu 2 -\fI\%query_string\fP \- Query string to be processed. (default: \fBNone\fP) +\fI\%query_string\fP \- The question that will be sent to the LLM (default: \fBNone\fP) .UNINDENT .SS c query options .INDENT 0.0 .IP \(bu 2 \fI\%\-h\fP, \fI\%\-\-help\fP \- show this help message and exit .IP \(bu 2 -\fI\%\-i\fP \fBINPUT\fP, \fI\%\-\-input\fP \fBINPUT\fP \- Read file from user system. (default: \fBNone\fP) +\fI\%\-a\fP \fBATTACHMENT\fP, \fI\%\-\-attachment\fP \fBATTACHMENT\fP \- File attachment to be read and sent alongside the query (default: \fBNone\fP) .UNINDENT -.SH C HISTORY +.SS c history .sp -Manage conversation history +Manage user conversation history .INDENT 0.0 .INDENT 3.5 .sp @@ -86,37 +87,241 @@ c history [\-h] [\-\-clear] [\-\-first] [\-\-last] [\-\-filter FILTER] .IP \(bu 2 \fI\%\-h\fP, \fI\%\-\-help\fP \- show this help message and exit .IP \(bu 2 -\fI\%\-\-clear\fP \- Clear the history. +\fI\%\-\-clear\fP \- Clear the entire history. .IP \(bu 2 \fI\%\-\-first\fP \- Get the first conversation from history. .IP \(bu 2 \fI\%\-\-last\fP \- Get the last conversation from history. .IP \(bu 2 -\fI\%\-\-filter\fP \fBFILTER\fP \- Search for a specific string of text in the history. (default: \fBNone\fP) +\fI\%\-\-filter\fP \fBFILTER\fP \- Search for a specific keyword of text in the history. (default: \fBNone\fP) .UNINDENT +.SH DESCRIPTION +.sp +The Command Line Assistant powered by RHEL Lightspeed is a optional generative +AI assistant available within the RHEL command line interface. The Command Line +Assistant can help with several tasks such as: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +1. answering RHEL related questions +2. assisting with troubleshooting +3. assisting with deciphering log entries +3. and many other tasks. +.EE +.UNINDENT +.UNINDENT +.sp +The Command Line Assistant provides a natural language interface, and can +incorporate information from resources such as the RHEL documentation. +.SH EXAMPLES +.sp +Example 1. Asking a simple question +.INDENT 0.0 +.INDENT 3.5 +Asking questions with \fBc\fP is relatively simple. One can start using the +program by simply doing: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +$ c \(dqWhat is RHEL?\(dq +.EE +.UNINDENT +.UNINDENT +.sp +Alternatively, you can strictly specify that you want a query with: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +$ c query \(dqWhat is RHEL?\(dq +.EE +.UNINDENT +.UNINDENT +.sp +In case \fBquery\fP is not placed, the program will assume that anything that +comes after is a potential query. That includes the options for \fBquery\fP +as well. +.UNINDENT +.UNINDENT +.sp +Example 2. Redirecting output to \fBc\fP +.INDENT 0.0 +.INDENT 3.5 +If you have any program in your system that is erroring out, or a log file +that contain something that you want to understand, you can redirect that +output to \fBc\fP and ask the tool to give you an answer on how to solve it: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +$ cat log_with_error.log | c +.EE +.UNINDENT +.UNINDENT +.sp +If you want to redirect directly from a commmand, that is also possible +with: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +$ my\-command | c +.EE +.UNINDENT +.UNINDENT +.sp +Sometimes, only providing the error output may not be enough. For that, you +can combine your redirect output with a question like this: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +$ $ cat log_with_error.log | c \(dqhow do I solve this?\(dq +.EE +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.sp +Example 3. Attaching a file with your question +.INDENT 0.0 +.INDENT 3.5 +Alternatively to redirecting the output, you can attach a file to \fBc\fP with +the following: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +$ c \-\-attachment log_with_error.log +.EE +.UNINDENT +.UNINDENT +.sp +Or, with it\(aqs short version: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +$ c \-a log_with_error.log +.EE +.UNINDENT +.UNINDENT +.sp +You can also combine the attachemtn with a question: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +$ c \-a log_with_error.log \(dqhow do I solve this?\(dq +.EE +.UNINDENT +.UNINDENT +.sp +And lastly, you can use redirect output as well: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +echo \(dqhow do I solve this?\(dq | c \-a log_with_error.log +.EE +.UNINDENT +.UNINDENT +.sp +However, if you specify a redirect output and a query at the same you have +an attachment, only the attachment plus the query will be used. The +redirect output will be ignored: .INDENT 0.0 -.TP -.B Asking a question: -$ c query \(dqHow do I check disk space?\(dq +.INDENT 3.5 .sp -$ c \(dqHow do I check disk space?\(dq +.EX +# The redirection here will be ignored as the query has precedence over redirection in this scenario. +echo \(dqhow do I solve this?\(dq | c \-a log_with_error.log \(dqplease?\(dq +.EE +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT .sp -$ echo \(dqAsking through pipe redirection!\(dq | c +Example 4. History management +.INDENT 0.0 +.INDENT 3.5 +With Command Line Assistant, you can also check your conversation history. +To do so, one can issue the following command to retrieve all user +history:: Check all history entries: +.INDENT 0.0 +.INDENT 3.5 .sp -$ c \-\-file log.txt \(dqWhat is the error here?\(dq -.TP -.B Check all history entries: +.EX $ c history -.TP -.B Check the first entry: +.EE +.UNINDENT +.UNINDENT +.sp +If you don\(aqt want all history, you can filter either for the first, or last +result with: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX $ c history \-\-first -.TP -.B Check the last entry: $ c history \-\-last -.TP -.B Clear all the history entries: +.EE +.UNINDENT +.UNINDENT +.sp +In the case that a more granular filtering is needed, you can filter with +keywords your history, like this: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +# This will retrieve all questions/responses that contain the work \(dqselinux\(dq +$ c history \-\-filter \(dqselinux\(dq +.EE +.UNINDENT +.UNINDENT +.sp +And lastly, to start a clean history, you can clear all of it with: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX $ c history \-\-clear +.EE +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.SH NOTES +.sp +In the above examples, we mention that one particular use case where redirected +output will be ignored. That happens because we have a set of rules defined in +order to maintain a correct order of querying. The rules can be seen here: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +1. Positional query only \-> use positional query +2. Stdin query only \-> use stdin query +3. File query only \-> use file query +4. Stdin + positional query \-> combine as \(dq{positional_query} {stdin}\(dq +5. Stdin + file query \-> combine as \(dq{stdin} {file_query}\(dq +6. Positional + file query \-> combine as \(dq{positional_query} {file_query}\(dq +7. All three sources \-> use only positional and file as \(dq{positional_query} {file_query}\(dq +.EE .UNINDENT +.UNINDENT +.SH REFERENCE +.INDENT 0.0 +.IP 1. 3 +Command Line Assistant source code: \X'tty: link https://github.com/rhel-lightspeed/command-line-assistant'\fI\%https://github.com/rhel\-lightspeed/command\-line\-assistant\fP\X'tty: link' +.UNINDENT +.SH BUGS +.sp +Please send bug reports to our bug tracker, see \X'tty: link https://issues.redhat.com/browse/RSPEED'\fI\%https://issues.redhat.com/browse/RSPEED\fP\X'tty: link' +.SH SEE ALSO .sp \fBclad(8)\fP .SH AUTHOR diff --git a/data/release/man/clad.8 b/data/release/man/clad.8 index c73f223..7cc9166 100644 --- a/data/release/man/clad.8 +++ b/data/release/man/clad.8 @@ -27,24 +27,55 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "CLAD" "8" "Jan 09, 2025" "0.1.0" "Command Line Assistant" +.TH "CLAD" "8" "Jan 15, 2025" "0.1.0" "Command Line Assistant" .SH NAME clad \- Command Line Assistant Daemon .SH SYNOPSIS .sp -\fBclad\fP +In order to run Command Line Assistant Daemon (clad), one need to first enable +the systemd service with the following: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +$ systemctl enable clad +.EE +.UNINDENT +.UNINDENT +.sp +All queries submitted through \fBc\fP will automatically activate the service. +.sp +To check status and logs, run the following: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +$ systemctl status clad +.EE +.UNINDENT +.UNINDENT .SH DESCRIPTION .sp -The Command Line Assistant daemon (clad) provides the backend service for processing queries through D\-Bus. +Command Line Assistant Daemon (clad) is the core of the Command Line Assistant +tooling. It manages the communication with WatsonX API trought an external +backend, user history management and much more. .SH FILES .INDENT 0.0 .TP .B \fI/etc/xdg/command\-line\-assistant/config.toml\fP System configuration file .TP -.B \fI/var/lib/command\-line\-assistant/history.json\fP -History storage file +.B \fI/var/lib/command\-line\-assistant/history.db\fP +SQlite3 history database .UNINDENT +.SH REFERENCE +.INDENT 0.0 +.IP 1. 3 +Command Line Assistant Daemon source code: \X'tty: link https://github.com/rhel-lightspeed/command-line-assistant'\fI\%https://github.com/rhel\-lightspeed/command\-line\-assistant\fP\X'tty: link' +.UNINDENT +.SH BUGS +.sp +Please send bug reports to our bug tracker, see \X'tty: link https://issues.redhat.com/browse/RSPEED'\fI\%https://issues.redhat.com/browse/RSPEED\fP\X'tty: link' .SH SEE ALSO .sp \fBc(1)\fP diff --git a/docs/source/conf.py b/docs/source/conf.py index 703eeaf..3effb2c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -29,7 +29,7 @@ "sphinx.ext.viewcode", # View source code as html "sphinx.ext.todo", # Add todo notes to the docs "sphinx.ext.duration", # Inspect which module is slowing the docs build - "sphinx_argparse_cli", # Auto generate argparse docs for manpage + "sphinx_argparse_cli", # Auto generate argparse docs for manpage, ] intersphinx_mapping = { diff --git a/docs/source/man/clad.8.rst b/docs/source/man/clad.8.rst index 312a056..4ba9f88 100644 --- a/docs/source/man/clad.8.rst +++ b/docs/source/man/clad.8.rst @@ -1,17 +1,29 @@ .. _clad.8: +============================= Command Line Assistant Daemon ============================= Synopsis -------- -**clad** +In order to run Command Line Assistant Daemon (clad), one need to first enable +the systemd service with the following:: + + $ systemctl enable clad + +All queries submitted through ``c`` will automatically activate the service. + +To check status and logs, run the following:: + + $ systemctl status clad Description ----------- -The Command Line Assistant daemon (clad) provides the backend service for processing queries through D-Bus. +Command Line Assistant Daemon (clad) is the core of the Command Line Assistant +tooling. It manages the communication with WatsonX API trought an external +backend, user history management and much more. Files ----- @@ -19,8 +31,18 @@ Files */etc/xdg/command-line-assistant/config.toml* System configuration file -*/var/lib/command-line-assistant/history.json* - History storage file +*/var/lib/command-line-assistant/history.db* + SQlite3 history database + +Reference +--------- + +1. Command Line Assistant Daemon source code: https://github.com/rhel-lightspeed/command-line-assistant + +Bugs +---- + +Please send bug reports to our bug tracker, see https://issues.redhat.com/browse/RSPEED See Also -------- diff --git a/docs/source/man/command-line-assistant.1.rst b/docs/source/man/command-line-assistant.1.rst index f3e70b8..d5fdb4b 100644 --- a/docs/source/man/command-line-assistant.1.rst +++ b/docs/source/man/command-line-assistant.1.rst @@ -1,32 +1,139 @@ +.. _command-line-assistant.1: + +====================== +Command Line Assistant +====================== + .. sphinx_argparse_cli:: :module: command_line_assistant.initialize :func: register_subcommands :prog: c - :title: Command Line Assistant + :title: Synopsis + +Description +----------- + +The Command Line Assistant powered by RHEL Lightspeed is a optional generative +AI assistant available within the RHEL command line interface. The Command Line +Assistant can help with several tasks such as:: + + 1. answering RHEL related questions + 2. assisting with troubleshooting + 3. assisting with deciphering log entries + 3. and many other tasks. + +The Command Line Assistant provides a natural language interface, and can +incorporate information from resources such as the RHEL documentation. Examples -------- -Asking a question: - $ c query "How do I check disk space?" +Example 1. Asking a simple question + + Asking questions with `c` is relatively simple. One can start using the + program by simply doing:: + + $ c "What is RHEL?" + + Alternatively, you can strictly specify that you want a query with:: + + $ c query "What is RHEL?" + + In case `query` is not placed, the program will assume that anything that + comes after is a potential query. That includes the options for `query` + as well. + +Example 2. Redirecting output to `c` + + If you have any program in your system that is erroring out, or a log file + that contain something that you want to understand, you can redirect that + output to `c` and ask the tool to give you an answer on how to solve it:: + + $ cat log_with_error.log | c + + If you want to redirect directly from a commmand, that is also possible + with:: + + $ my-command | c + + Sometimes, only providing the error output may not be enough. For that, you + can combine your redirect output with a question like this:: + + $ $ cat log_with_error.log | c "how do I solve this?" + +Example 3. Attaching a file with your question + + Alternatively to redirecting the output, you can attach a file to `c` with + the following:: + + $ c --attachment log_with_error.log + + Or, with it's short version:: + + $ c -a log_with_error.log + + You can also combine the attachemtn with a question:: + + $ c -a log_with_error.log "how do I solve this?" + + And lastly, you can use redirect output as well:: + + echo "how do I solve this?" | c -a log_with_error.log + + However, if you specify a redirect output and a query at the same you have + an attachment, only the attachment plus the query will be used. The + redirect output will be ignored:: + + # The redirection here will be ignored as the query has precedence over redirection in this scenario. + echo "how do I solve this?" | c -a log_with_error.log "please?" + +Example 4. History management + + With Command Line Assistant, you can also check your conversation history. + To do so, one can issue the following command to retrieve all user + history:: Check all history entries:: + + $ c history + + If you don't want all history, you can filter either for the first, or last + result with:: + + $ c history --first + $ c history --last + + In the case that a more granular filtering is needed, you can filter with + keywords your history, like this:: + + # This will retrieve all questions/responses that contain the work "selinux" + $ c history --filter "selinux" + + And lastly, to start a clean history, you can clear all of it with:: - $ c "How do I check disk space?" + $ c history --clear - $ echo "Asking through pipe redirection!" | c +Notes +----- - $ c --file log.txt "What is the error here?" +In the above examples, we mention that one particular use case where redirected +output will be ignored. That happens because we have a set of rules defined in +order to maintain a correct order of querying. The rules can be seen here:: -Check all history entries: - $ c history + 1. Positional query only -> use positional query + 2. Stdin query only -> use stdin query + 3. File query only -> use file query + 4. Stdin + positional query -> combine as "{positional_query} {stdin}" + 5. Stdin + file query -> combine as "{stdin} {file_query}" + 6. Positional + file query -> combine as "{positional_query} {file_query}" + 7. All three sources -> use only positional and file as "{positional_query} {file_query}" -Check the first entry: - $ c history --first +Reference +--------- +1. Command Line Assistant source code: https://github.com/rhel-lightspeed/command-line-assistant -Check the last entry: - $ c history --last +Bugs +---- -Clear all the history entries: - $ c history --clear +Please send bug reports to our bug tracker, see https://issues.redhat.com/browse/RSPEED See Also -------- diff --git a/tests/commands/test_query.py b/tests/commands/test_query.py index 556ebf0..a35bce1 100644 --- a/tests/commands/test_query.py +++ b/tests/commands/test_query.py @@ -125,7 +125,7 @@ def test_register_subcommand(): @pytest.mark.parametrize( - ("query_string", "stdin", "input"), + ("query_string", "stdin", "attachment"), ( ( "test query", @@ -141,9 +141,9 @@ def test_register_subcommand(): ("test query", "test stdin", mock.Mock()), ), ) -def test_command_factory(query_string, stdin, input): +def test_command_factory(query_string, stdin, attachment): """Test _command_factory function""" - options = {"query_string": query_string, "stdin": stdin, "input": input} + options = {"query_string": query_string, "stdin": stdin, "attachment": attachment} args = Namespace(**options) command = _command_factory(args) @@ -153,7 +153,7 @@ def test_command_factory(query_string, stdin, input): @pytest.mark.parametrize( - ("query_string", "stdin", "input", "expected"), + ("query_string", "stdin", "attachment", "expected"), ( ("test query", None, None, "test query"), (None, "stdin", None, "stdin"), @@ -165,9 +165,9 @@ def test_command_factory(query_string, stdin, input): ("test query", "test stdin", StringIO("file query"), "test query file query"), ), ) -def test_get_input_source(query_string, stdin, input, expected): +def test_get_input_source(query_string, stdin, attachment, expected): """Test _command_factory function""" - options = {"query_string": query_string, "stdin": stdin, "input": input} + options = {"query_string": query_string, "stdin": stdin, "attachment": attachment} command = QueryCommand(**options) output = command._get_input_source() @@ -184,14 +184,18 @@ def test_get_input_source(query_string, stdin, input, expected): ), ) def test_get_input_source_binary_file(input_file): - options = {"query_string": None, "stdin": None, "input": StringIO(input_file)} + options = {"query_string": None, "stdin": None, "attachment": StringIO(input_file)} command = QueryCommand(**options) with pytest.raises(ValueError, match="File appears to be binary"): command._get_input_source() def test_get_inout_source_all_values_warning_message(capsys): - options = {"query_string": "query", "stdin": "stdin", "input": StringIO("file")} + options = { + "query_string": "query", + "stdin": "stdin", + "attachment": StringIO("file"), + } command = QueryCommand(**options) output = command._get_input_source()