X-cmd와 함께하는 Mistral AI 커맨드라인 클라이언트

X-cmd와 함께하는 Mistral AI 커맨드라인 클라이언트 (The Mistral AI Command Line Client with x-cmd)

mistral 모듈은 x-cmd 팀이 Mistral AI API로 만든 커맨드라인 클라이언트 도구예요. POSIX sh와 awk로 작성됐고, curl로 API 요청을 보내요. x-cmd는 Windows, Linux, macOS와 호환되어 설치가 쉽고 간단해요.

출처: 문서

본문

시작하기 (Getting started)

x-cmd 설치

eval "$(curl https://get.x-cmd.com)"
# or
eval "$(wget -O- https://get.x-cmd.com)"

더 많은 설치 방법과 설명은 공식 문서를 참고하세요.

x mistral 구성하기

Mistral AI API 키 얻기: https://console.mistral.ai/api-keys/

x mistral init
# or
x mistral --cfg apikey=<Mistral AI API Key>
x mistral --cfg model=<Mistral Model>

Mistral AI 사용하기

x mistral은 Mistral AI에 메시지나 파일을 보낼 수 있게 해줘요. 사용자 편의를 위해 x-cmd는 @mistral 명령을 x mistral의 alias로 제공해요.

x mistral chat request "hello"
@mistral "hello"
@mistral --file <file_path> "Translate to French"

x mistral은 명령 결과를 분석하는 데도 도움이 되며, 인터랙티브 모드에서 대화를 열 수 있어요.

x jina r "https://www.x-cmd.com/start/guide" | @mistral

x jina r: Jina.ai를 사용해 웹 페이지 내용을 추출해요.

커맨드라인 옵션 (Command Line Options)

x mistral과 @mistral 두 명령을 제공하는데, x mistral은 모델 구성·다운로드 관리에 초점을 두고 @mistral은 모델 애플리케이션에 중점을 둬요. 옵션은 다음과 같아요.

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 content

더 알아보기 (Learn more)