|
Download packages/sdk/README.md from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 745 Bytes
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/sdk/README.md
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/sdk/README.md
-
curl -L -o README.md https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/sdk/README.md
745 Bytes
@google/gemini-cli-sdk
The Gemini CLI SDK provides a programmatic interface to interact with Gemini models and tools.
Installation
npm install @google/gemini-cli-sdk
Usage
import { GeminiCliAgent } from '@google/gemini-cli-sdk';
async function main() {
const agent = new GeminiCliAgent({
instructions: 'You are a helpful assistant.',
});
const controller = new AbortController();
const signal = controller.signal;
// Stream responses from the agent
const stream = agent.sendStream('Why is the sky blue?', signal);
for await (const chunk of stream) {
if (chunk.type === 'content') {
process.stdout.write(chunk.value.text || '');
}
}
}
main().catch(console.error);