Install chatgpt
cli with Nix:
nix profile install github:andreasfelix/chatgpt
Or, add it to your flake:
chatgpt = {
url = "github:andreasfelix/chatgpt";
inputs.nixpkgs.follows = "nixpkgs";
};
If you pass an argument it will be used as initial prompt:
chatgpt "What is a lepton?"
Output
🤖 chatgpt · A lepton is a type of elementary particle that belongs to the family of fundamental particles in the Standard Model of particle physics. Leptons are the building blocks ...
Usage: chatgpt [OPTIONS] [PROMPT]
Arguments:
[PROMPT] Initial prompt
Options:
-s, --set-openai-api-key Set new openai api key
-d, --delete-config Delete config file
-h, --help Print help
-V, --version Print version