or
The mistral module is a command-line client tool built by the x-cmd team using the Mistral AI API. Written in posix shell and awk, it uses curl to send API requests.
Content
The Mistral AI Command Line Client with x-cmd
The mistral module is a command-line client tool built by the x-cmd team using the Mistral AI API. Written in posix shell and awk, it uses curl to send API requests.
Getting started
Installing x-cmd
- x-cmd is compatible with Windows, Linux, and macOS, making installation easy and straightforward
eval "$(curl https://get.x-cmd.com)"
# or
eval "$(wget -O- https://get.x-cmd.com)"
- For more installation methods and instructions, please refer to the official documentation.
Configuring x mistral
Obtaining a Mistral AI API Key: https://console.mistral.ai/api-keys/
x mistral init
# or
x mistral --cfg apikey=<Mistral AI API Key>
x mistral --cfg model=<Mistral Model>
Use Mistral AI
x mistralallows you to send messages or files to Mistral AI. And to make things easier for users, x-cmd also provides the@mistralcommand as an alias for thex mistralcommand.
x mistral chat request "hello"
@mistral "hello"
@mistral --file <file_path> "Translate to French"
x mistralcan help analyze command results and supports opening a dialogue in interactive mode.
x jina r "https://www.x-cmd.com/start/guide" | @mistral
x jina r: Uses Jina.ai to extract content from web pages.
Command Line Options
We offer the x mistral and @mistral commands, where x mistral focuses on model configuration and download management, while @mistral emphasizes model applications. Their command-line options are as follows:
x mistral:
SUBCOMMANDS:
init Initialize the configuration using interactive mode
--cur current session default value management
--cfg Manage config item like apikey, etc
chat chat with mistral
model Model viewing and management
@mistral:
-t,--temperature Control the diversity of model generated results, the range is [0 ~ 1], when the temperat
-e Send the variable value as context to AI
-f,--file Send file content as context to AI
-n,--history Specify the number of history as context
-p Specify to get pipe content
-P,--nopipe Specify not to get pipe content
-c Confirm before sending the request content to AI
--jina Through jina reader, send the webpage content as context to AI
--ddgo Send ddgo search content as context to AI
--tldr Send tldr content as context to AI
--eval Send the execution command results as context to AI
--kv Send key-value pairs as context to AI
--session Specify session value
--minion Specify minion file
--model Specify AI model
--edit Edit the request content in the terminal
--numbered List the data with line numbers and send it
--question Request contentSource and license
- Source
- Mistral Cookbook
- Original
- mistralai/cookbook/third_party/x-cmd
- License
- MIT