Please enable JavaScript to view this site.

Purpose:A command-line interface to ChatGPT

 

Format:AI [/= /F:n.n /I /L /M="model" /Max=n /P=n.n /Role=role /Tn.n /Top_n=n.n /V] ["query"]

 

/F(requency penalty)/P(resence penalty)
/I(interactive mode)/Role
/L(ist models)/T(emperature)
/M(odel)/Top_p (token probability)
/Max (tokens)/V(erbose output)

 

See also: OPTION.

 

Usage:

 

AI is a command-line interface to the ChatGPT large language models (LLMs), or any others that support the OpenAI APIs. It offers generation of TCC commands, code snippets, and documentation (as well as queries on other topics).

 

query is the natural language query. If you do not provide a query, AI will switch to interactive mode (see /I) and prompt you for input.

 

If you haven't set your OpenAI API key, AI will prompt you for the key before starting the conversation. The key is saved in the OpenAIKey directive in the [4NT] section in TCMD.INI. It can also be set from the OPTIONS dialog on the AI page. If you don't have an API key, you will need to create an account on OpenAPI or another provider that has access to the OpenAI APIs. Please refer to the OpenAI API pricing for more information.

 

The default URL to call for your queries is "https://api.openai.com/v1", but you can use any provider that supports the OpenAI APIs. It can be set in the OPTIONS dialog on the AI page.

 

You can view and modify the default roles in the OPTION / AI dialog page.

 

Be sure to review the suggested command line before executing it!

 

The AI command is not supported in TCC-RT.

 

Examples:

 

[D:\TakeCommand36] ai /i "display all files between 20 and 100 bytes"

To display all files between 20 and 100 bytes in size using TCC, you can use the `DIR` command with the `/[s]` option to

specify a size range. Here's the command:

 

DIR /S /[s20,100] *

 

This command will recursively search through directories (`/S`) and list files whose sizes are between 20 and 100 bytes.

The `*` wildcard is used to include all files. Adjust the path if you want to target a specific directory instead of the

current one.

 

[D:\TakeCommand36] ai /role=describe "display all files between 20 and 25 days old"

The `TCC.EXE` shell command to display files between 20 and 25 days old is: `DIR /[d-25,-20]`.

 

- `DIR`: Lists directory contents.

- `/[d-25,-20]`: Filters files based on their age, showing only those modified between 25 and 20 days ago.

- `d`: Represents the date filter.

- `-25` and `-20`: Specify the range of days from the current date.

 

This command effectively lists files modified within the specified date range.

 

D:\TakeCommand36] ai /role=shell "display all files between 20 and 25 days old"

dir /a:-d /s /t:w /[d-25,-20]

 

Options:

 

/=Display the AI command dialog to help you set the command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog.

 

/FThe Frequency penalty controls the frequency of certain words in the model's responses. A higher penalty value will decrease the likelihood of word repetitions, while a lower value will allow the model to use the same words more frequently. The default value is 0.3.

 

/IInteractive mode. AI will prompt you ("AI> ") for input. After the response is displayed, AI displays another prompt "[R]un, [E]dit, [C]ontinue, [Q]uit: ".

 

R - Runs the command returned by ChatGPT. (This is probably only useful if you're using /Role=SHELL.)

E - Copies the response to the command line for editing.

C (or Enter) - Display the AI> prompt again and get another query.

Q - Exits AI interactive mode.

 

/LList the available models in a JSON list. The model name is in the "id" field.

 

/MThe ChatGPT model to use. The default value is "gpt-4o". Other options include "gpt-3.5-turbo" and "gpt-4-turbo". You can set a different default model in the OPTIONS dialog on the AI page.

 

/MaxThe maximum number of tokens (default 2048).

 

/NHow many chat completion choices to generate for each query. The default value is 1.

 

/PThe Presence penalty controls how much the model prefers to use words and phrases that are already present in the context. A higher value will increase the chances of using new words and phrases, while a lower value will allow the model to repeat words and phrases already mentioned. The default value is 0.3.

 

/RoleSets the role description. This can be one of the predefined roles:

 

DEFAULT - A programmer / system administrator using Take Command and TCC.

SHELL - Only TCC commands and examples.

DESCRIBE - Descriptions of TCC commands.

CODE - Output code with no descriptions.

 

"role" - A quoted string that describes a custom role. For example:

/Role="You are a programmer and system administrator. You manage Windows operating systems with JP Software Take Command and TCC shell."

 

/TThe “temperature” setting helps control the randomness of the ChatGPT responses.  The valid range is 0.0 to 1.0; the default value is 0.2. A higher temperature value (closer to 1) makes responses more random, while a lower value (closer to 0) makes responses more predictable and conservative.

 

/Top_pTop_p is the probability with which the model selects the next token when generating text. A value of 1.0 means the model will consider all possible tokens for the next word, whereas a value close to 0 will make the model choose only the most likely tokens.

 

/VVerbose output - TCC will display everything returned from the OpenAI query. This can be useful when debugging or optimizing prompts.