Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
49 lines
1.7 KiB
Nix
49 lines
1.7 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
makeWrapper,
|
|
}:
|
|
|
|
buildGoModule (finalAttrs: {
|
|
# "chatgpt-cli" is taken by another package with the same upsteam name.
|
|
# To keep "pname" and "package attribute name" identical, the owners name (kardolus) gets prefixed as identifier.
|
|
pname = "kardolus-chatgpt-cli";
|
|
version = "1.8.10";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "kardolus";
|
|
repo = "chatgpt-cli";
|
|
rev = "v${finalAttrs.version}";
|
|
hash = "sha256-XZ9f+PAY0i7DfzZCxtZFw1jit7o/tjqAEc8uJpqiOAc=";
|
|
};
|
|
|
|
vendorHash = null;
|
|
# The tests of kardolus/chatgpt-cli require an OpenAI API Key to be present in the environment,
|
|
# (e.g. https://github.com/kardolus/chatgpt-cli/blob/v1.8.10/test/contract/contract_test.go#L35)
|
|
# which will not be the case in the pipeline.
|
|
# Therefore, tests must be skipped.
|
|
doCheck = false;
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
postFixup = ''
|
|
wrapProgram $out/bin/chatgpt \
|
|
--run "mkdir -p ~/.chatgpt-cli" \
|
|
--set-default CHATGPT_CLI_HISTORY_DIR ~/.chatgpt-cli
|
|
'';
|
|
|
|
meta = {
|
|
description = "Command-line interface for ChatGPT";
|
|
longDescription = ''
|
|
ChatGPT CLI is a versatile tool for interacting with LLMs through OpenAI, Azure, and other popular providers like Perplexity AI and Llama.
|
|
It supports prompt files, history tracking, and live data injection via MCP (Model Context Protocol),
|
|
making it ideal for both casual users and developers seeking a powerful, customizable GPT experience.
|
|
'';
|
|
homepage = "https://github.com/kardolus/chatgpt-cli";
|
|
platforms = lib.platforms.unix;
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ ralleka ];
|
|
mainProgram = "chatgpt";
|
|
};
|
|
})
|