You can create a global config file at ~/.config/shell-ask/config.json
, or a local config file at ./shell-ask.json
in a folder where you want to run Shell Ask.
In fact this file is generated by the gen-config-md
command defined in the shell-ask.json for this project.
- Type:
string
- Description: Specifies the default AI model to be used.
- Type:
string
- Description: The API key for accessing OpenAI services.
- Default:
process.env.OPENAI_API_KEY
- Type:
string
- Description: The URL for the OpenAI API.
- Default:
process.env.OPENAI_API_URL
- Type:
string
- Description: The API key for accessing Gemini services.
- Default:
process.env.GEMINI_API_KEY
- Type:
string
- Description: The URL for the Gemini (Google Gen AI) API.
- Default:
process.env.GEMINI_API_URL
- Type:
string
- Description: The API key for accessing Anthropic services.
- Default:
process.env.ANTHROPIC_API_KEY
- Type:
string
- Description: The API key for accessing Groq services.
- Default:
process.env.GROQ_API_KEY
- Type:
AICommand[]
- Description: A list of AI commands that can be executed. Each command is defined by the
AICommand
type.
The AICommand
type defines the structure of an AI command that can be executed. Below are the properties of the AICommand
type.
- Type:
string
- Description: The CLI command to be executed.
- Type:
string
- Description: An example to show in CLI help.
- Type:
string
- Description: A description of the command to be shown in CLI help.
- Type:
Record<string, AICommandVariable>
- Description: A record of variables that the command can use. Each variable is defined by the
AICommandVariable
type.
- Type:
string
- Description: The prompt to send to the AI model.
- Type:
boolean
- Description: Indicates whether the command requires piping output from another program to Shell Ask.
The AICommandVariable
type defines the structure of a variable that can be used in an AI command. Below are the possible types of AICommandVariable
.
- Type:
string
- Description: A shell command to run, the output of which will be used as the variable value.
- Type:
{ type: "input"; message: string }
- Description: Gets text input from the user.
type
: Must be"input"
.message
: The message to show to the user.
- Type:
{ type: "select"; message: string; choices: { value: string; title: string }[] }
- Description: Gets a choice from the user.
type
: Must be"select"
.message
: The message to show to the user.choices
: An array of choice objects, each containing:value
: The value of the choice.title
: The title of the choice to be displayed to the user.