Answers.Body: <p>We cannot query on it as it is not supported by the protocol. However we can do something about it. I tried to maintain the <a href="https://github.com/fsmosca/UCIChessEngineProtocol" rel="nofollow noreferrer">uci protocol</a> and added an <a href="https://github.com/fsmosca/UCIChessEngineProtocol/issues" rel="nofollow noreferrer">issue</a> with the following proposal.</p>
  <h3>Proposal 1</h3>
  <p>Support the command <code>optionvalues</code>. This command is sent to the engine.
  Some examples on engine reply format.</p>
  <pre><code>option name Threads value 2
  option name Ponder value true
  option name EvalFile value mynn.nnue
  </code></pre>
  <p>Feel free to post, comment or add your proposal in that repo.</p>
  <p>I will inform the engine programmers community about this issue as well, so that they can support this on their engine.</p>
  <p>By the way this is the usage of <code>uci</code> command.</p>
  <pre><code>* uci
      Tells the engine to use the uci (universal chess interface),
      this will be sent once as a first command after program boot
      to tell the engine to switch to uci mode.
      After receiving the uci command the engine must identify itself with the &quot;id&quot; command
      and send the &quot;option&quot; commands to tell the GUI which engine settings the engine supports if
      any. After that the engine should send &quot;uciok&quot; to acknowledge the uci mode. If no uciok is sent
      within a certain time period, the engine task will be killed by the GUI.
  </code></pre>
  <p>What is your use case why you query the current engine option values? From a gui's perspective, it can store option values that it sent to the engine.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-16T16:46:07.980Z
Answers.Text: The proposal to add an "optionvalues" command is great! I wonder why this is not already implemented, yet! My use case is: I work with defferent engines and want to save the current option values for later use, to reapply them again.
Answers.UserDisplayName: Frank Kremer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-16T19:49:59.307Z
Answers.Text: This is not implemented, because you know already what you have inputted to the engine. As an example if I am designing a ui (user interface) if the user sends uci command to the engine, the ui can save this and then sends this to the engine. The engine will reply to the ui and the ui will show this info to the user. When the user asks again the value of option, the ui can just look up the value in the saved values.
Answers.UserDisplayName: ferdy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-18T20:04:02.310Z
Answers.Text: I agree that when an UI sent several setoption commands to the engine, the UI knows what it sent. But, as I understand, whenever I quit the engine and restart it later, the setoptions has to reapply, right? So, I'd like to query the current value of an option.
Answers.UserDisplayName: Frank Kremer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-18T20:22:27.040Z
Answers.Text: After quit and restart, the engine is set to use its default value. We would know the default value through the `uci` command. Example: `option name Threads type spin default 1 min 1 max 512` The default is 1. It is also the current value.
Answers.UserDisplayName: ferdy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-15T01:52:14.340Z
Answers.LastActivityDate: 2022-09-15T09:08:36.750Z
Answers.LastEditDate: 2022-09-15T09:08:36.750Z
Answers.UserDisplayName: ferdy
Body: <p>I've got a (simple) question regarding the UCI options and their current values:</p>
  <ul>
  <li><p>I start my engine (e. g. Stockfish).</p>
  </li>
  <li><p>The console opens and I enter &quot;uci&quot; and press [Enter]. As a result, I get a list of options which the engine supports, with their min and max value, their type and their default setting.
  For example:
  option name Ponder type check default false</p>
  </li>
  <li><p>Let's say I change the following option:
  setoption name ponder value true</p>
  </li>
  <li><p>As I don't get an error, I expect that this option has been switched to true. But, when I now enter &quot;uci&quot; once more, I get the following output:
  option name Ponder type check default false</p>
  </li>
  </ul>
  <p>As you can see, it is exactly the same output that I already got when starting the engine and entered &quot;uci&quot; the very first time. I expect to see this:
  option name Ponder type check default false current value true</p>
  <p>or something similar. Note: &quot;current value true&quot; was added by me, just to show what I expect.</p>
  <p>Regardless which option I change, I never can query the current value. Why?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-09-13T02:47:05.970Z
Comments.Text: I haven't read the UCI protocol closely enough to see if it has to respond to option queries. But setoption is not a query right?
Comments.UserDisplayName: qwr
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-09-13T22:27:59.453Z
Comments.Text: Yes, "setoption" is the command to assign a value to an option. This works fine, but I'd like to query the current values of the available options and it seems not to be possible. Weird, isn't it?
Comments.UserDisplayName: Frank Kremer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-09-13T23:30:38.480Z
Comments.Text: The GUI is responsible for keeping track of these values
Comments.UserDisplayName: qwr
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-09-14T15:47:26.927Z
Comments.Text: I agree, but nevertheless, I'd like to query the current value of an option. Let's say you change a couple of options and afterwards you want to see what everything has been changed. Unfortunately, this seems to be impossible, regardless of which chess engine you are using. None of them is capable tho show the current value of an option:(
Comments.UserDisplayName: Frank Kremer
Tags: <stockfish>
Title: How can I query the current value of an UCI option?
ThreadText: # How can I query the current value of an UCI option?
  
  (Asked by: username_0 on 2022-09-12)
  
  I've got a (simple) question regarding the UCI options and their current values:
  
  * I start my engine (e. g. Stockfish).
  * The console opens and I enter "uci" and press [Enter]. As a result, I get a list of options which the engine supports, with their min and max value, their type and their default setting.
    For example:
    option name Ponder type check default false
  * Let's say I change the following option:
    setoption name ponder value true
  * As I don't get an error, I expect that this option has been switched to true. But, when I now enter "uci" once more, I get the following output:
    option name Ponder type check default false
  
  As you can see, it is exactly the same output that I already got when starting the engine and entered "uci" the very first time. I expect to see this:
  option name Ponder type check default false current value true
  
  or something similar. Note: "current value true" was added by me, just to show what I expect.
  
  Regardless which option I change, I never can query the current value. Why?
  
  **Tags:** stockfish
  
  > **Comments:**
  > **username_1**: I haven't read the UCI protocol closely enough to see if it has to respond to option queries. But setoption is not a query right?  
  > **username_0**: Yes, "setoption" is the command to assign a value to an option. This works fine, but I'd like to query the current values of the available options and it seems not to be possible. Weird, isn't it?  
  > **username_1**: The GUI is responsible for keeping track of these values  
  > **username_0**: I agree, but nevertheless, I'd like to query the current value of an option. Let's say you change a couple of options and afterwards you want to see what everything has been changed. Unfortunately, this seems to be impossible, regardless of which chess engine you are using. None of them is capable tho show the current value of an option:(  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-09-15. Score: 3
  
  We cannot query on it as it is not supported by the protocol. However we can do something about it. I tried to maintain the uci protocol and added an issue with the following proposal.
  Proposal 1
  Support the command optionvalues. This command is sent to the engine.
  Some examples on engine reply format.
  option name Threads value 2
  option name Ponder value true
  option name EvalFile value mynn.nnue
  
  Feel free to post, comment or add your proposal in that repo.
  I will inform the engine programmers community about this issue as well, so that they can support this on their engine.
  By the way this is the usage of uci command.
  * uci
      Tells the engine to use the uci (universal chess interface),
      this will be sent once as a first command after program boot
      to tell the engine to switch to uci mode.
      After receiving the uci command the engine must identify itself with the "id" command
      and send the "option" commands to tell the GUI which engine settings the engine supports if
      any. After that the engine should send "uciok" to acknowledge the uci mode. If no uciok is sent
      within a certain time period, the engine task will be killed by the GUI.
  
  What is your use case why you query the current engine option values? From a gui's perspective, it can store option values that it sent to the engine.
  
  > **Comments:**
  > **username_0**: The proposal to add an "optionvalues" command is great! I wonder why this is not already implemented, yet! My use case is: I work with defferent engines and want to save the current option values for later use, to reapply them again.  
  > **username_2**: This is not implemented, because you know already what you have inputted to the engine. As an example if I am designing a ui (user interface) if the user sends uci command to the engine, the ui can save this and then sends this to the engine. The engine will reply to the ui and the ui will show this info to the user. When the user asks again the value of option, the ui can just look up the value in the saved values.  
  > **username_0**: I agree that when an UI sent several setoption commands to the engine, the UI knows what it sent. But, as I understand, whenever I quit the engine and restart it later, the setoptions has to reapply, right? So, I'd like to query the current value of an option.  
  > **username_2**: After quit and restart, the engine is set to use its default value. We would know the default value through the `uci` command. Example: `option name Threads type spin default 1 min 1 max 512` The default is 1. It is also the current value.  
  
  ---
  
  