Skip to content

Latest commit

 

History

History
119 lines (75 loc) · 3.36 KB

config.md

File metadata and controls

119 lines (75 loc) · 3.36 KB

Config

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.

Example

In fact this file is generated by the gen-config-md command defined in the shell-ask.json for this project.

Properties

default_model (optional)

  • Type: string
  • Description: Specifies the default AI model to be used.

openai_api_key (optional)

  • Type: string
  • Description: The API key for accessing OpenAI services.
  • Default: process.env.OPENAI_API_KEY

openai_api_url (optional)

  • Type: string
  • Description: The URL for the OpenAI API.
  • Default: process.env.OPENAI_API_URL

gemini_api_key (optional)

  • Type: string
  • Description: The API key for accessing Gemini services.
  • Default: process.env.GEMINI_API_KEY

gemini_api_url (optional)

  • Type: string
  • Description: The URL for the Gemini (Google Gen AI) API.
  • Default: process.env.GEMINI_API_URL

anthropic_api_key (optional)

  • Type: string
  • Description: The API key for accessing Anthropic services.
  • Default: process.env.ANTHROPIC_API_KEY

groq_api_key (optional)

  • Type: string
  • Description: The API key for accessing Groq services.
  • Default: process.env.GROQ_API_KEY

commands (optional)

  • Type: AICommand[]
  • Description: A list of AI commands that can be executed. Each command is defined by the AICommand type.

AICommand Type

The AICommand type defines the structure of an AI command that can be executed. Below are the properties of the AICommand type.

Properties

command

  • Type: string
  • Description: The CLI command to be executed.

example (optional)

  • Type: string
  • Description: An example to show in CLI help.

description (optional)

  • Type: string
  • Description: A description of the command to be shown in CLI help.

variables (optional)

  • Type: Record<string, AICommandVariable>
  • Description: A record of variables that the command can use. Each variable is defined by the AICommandVariable type.

prompt

  • Type: string
  • Description: The prompt to send to the AI model.

require_stdin (optional)

  • Type: boolean
  • Description: Indicates whether the command requires piping output from another program to Shell Ask.

AICommandVariable Type

The AICommandVariable type defines the structure of a variable that can be used in an AI command. Below are the possible types of AICommandVariable.

Types

Shell Command

  • Type: string
  • Description: A shell command to run, the output of which will be used as the variable value.

Input

  • Type: { type: "input"; message: string }
  • Description: Gets text input from the user.
    • type: Must be "input".
    • message: The message to show to the user.

Select

  • 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.