@zemerik/gemini-assist 1.1.1-beta ā 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +24 -1
- package/README_RUST.md +2 -0
- package/RELEASE_NOTES.md +69 -64
- package/bin/gemini-assist.js +94 -6
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gemini Assist
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -101,6 +101,7 @@ In interactive mode:
|
|
|
101
101
|
- Type your questions and press Enter
|
|
102
102
|
- Type `exit`, `quit`, `bye`, or `q` to end the session
|
|
103
103
|
- Type `clear` to clear the screen
|
|
104
|
+
- Type `history` or `hist` to see conversation message count
|
|
104
105
|
|
|
105
106
|
### Single Query Mode
|
|
106
107
|
|
|
@@ -110,6 +111,21 @@ Ask a quick question:
|
|
|
110
111
|
gemini-assist "What is the capital of France?"
|
|
111
112
|
```
|
|
112
113
|
|
|
114
|
+
### Stdin Support (Piping)
|
|
115
|
+
|
|
116
|
+
Pipe text directly to Gemini Assist for scripting and automation:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Pipe text
|
|
120
|
+
echo "What is AI?" | gemini-assist
|
|
121
|
+
|
|
122
|
+
# Process file content
|
|
123
|
+
cat document.txt | gemini-assist "Summarize this"
|
|
124
|
+
|
|
125
|
+
# Chain with other commands
|
|
126
|
+
curl -s https://api.example.com/data | gemini-assist "Analyze this JSON"
|
|
127
|
+
```
|
|
128
|
+
|
|
113
129
|
### Command Line Options
|
|
114
130
|
|
|
115
131
|
```bash
|
|
@@ -117,8 +133,9 @@ gemini-assist [options] [query]
|
|
|
117
133
|
|
|
118
134
|
Options:
|
|
119
135
|
-V, --version Show version number
|
|
136
|
+
--version-info Show detailed version information
|
|
120
137
|
-k, --api-key <key> Gemini API key (or set GEMINI_API_KEY env variable)
|
|
121
|
-
-m, --model <model> Gemini model to use (default: gemini-
|
|
138
|
+
-m, --model <model> Gemini model to use (default: gemini-2.5-flash)
|
|
122
139
|
-i, --interactive Start interactive chat mode
|
|
123
140
|
-t, --temperature <value> Temperature for response 0-1 (default: 0.7)
|
|
124
141
|
-h, --help Display help for command
|
|
@@ -135,6 +152,12 @@ gemini-assist -t 0.9 "Write a creative story"
|
|
|
135
152
|
|
|
136
153
|
# Using alias
|
|
137
154
|
gassist "Explain quantum computing"
|
|
155
|
+
|
|
156
|
+
# Pipe text from stdin
|
|
157
|
+
echo "Summarize this text" | gemini-assist
|
|
158
|
+
|
|
159
|
+
# Show detailed version information
|
|
160
|
+
gemini-assist --version-info
|
|
138
161
|
```
|
|
139
162
|
|
|
140
163
|
## Programmatic Usage
|
package/README_RUST.md
CHANGED
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,82 +1,94 @@
|
|
|
1
|
-
# Release Notes - Gemini Assist v1.1.
|
|
1
|
+
# Release Notes - Gemini Assist v1.1.2
|
|
2
2
|
|
|
3
|
-
## š Gemini Assist v1.1.
|
|
3
|
+
## š Gemini Assist v1.1.2
|
|
4
4
|
|
|
5
|
-
**Release Date:**
|
|
6
|
-
**Version:** 1.1.
|
|
7
|
-
**Status:**
|
|
5
|
+
**Release Date:** January 2025
|
|
6
|
+
**Version:** 1.1.2
|
|
7
|
+
**Status:** Stable Release
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
## Overview
|
|
12
12
|
|
|
13
|
-
Gemini Assist v1.1.
|
|
13
|
+
Gemini Assist v1.1.2 introduces powerful new features that enhance usability, scripting capabilities, and developer experience. This release focuses on improving workflow integration and providing better insights into the tool's operation.
|
|
14
14
|
|
|
15
15
|
## ⨠New Features
|
|
16
16
|
|
|
17
|
-
###
|
|
18
|
-
- **
|
|
19
|
-
-
|
|
20
|
-
-
|
|
17
|
+
### š Stdin Support (Piping)
|
|
18
|
+
- **Read prompts from stdin** - Perfect for scripting and automation
|
|
19
|
+
- Pipe text directly to Gemini Assist for processing
|
|
20
|
+
- Example: `echo "Summarize this" | gemini-assist`
|
|
21
21
|
|
|
22
|
-
###
|
|
23
|
-
- **
|
|
24
|
-
-
|
|
25
|
-
-
|
|
22
|
+
### š Enhanced Version Information
|
|
23
|
+
- **Detailed version command** - `--version-info` flag shows comprehensive system information
|
|
24
|
+
- Displays package details, Node.js version, platform, and Rust binding status
|
|
25
|
+
- Helpful for debugging and support requests
|
|
26
26
|
|
|
27
|
-
###
|
|
28
|
-
- **
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
27
|
+
### š Conversation History Command
|
|
28
|
+
- **History tracking in interactive mode** - Type `history` or `hist` to see conversation message count
|
|
29
|
+
- Better awareness of conversation context
|
|
30
|
+
- Useful for understanding conversation length
|
|
31
|
+
|
|
32
|
+
### šÆ Improved CLI Experience
|
|
33
|
+
- Better help messages with new command examples
|
|
34
|
+
- Enhanced error messages for stdin usage
|
|
35
|
+
- More intuitive command flow
|
|
36
|
+
|
|
37
|
+
## š§ Technical Improvements
|
|
38
|
+
|
|
39
|
+
### Code Quality
|
|
40
|
+
- Improved error handling for stdin operations
|
|
41
|
+
- Better async/await patterns
|
|
42
|
+
- Enhanced code documentation
|
|
32
43
|
|
|
33
44
|
### Developer Experience
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
## š§ Technical Details
|
|
39
|
-
|
|
40
|
-
### Dependencies
|
|
41
|
-
- `@google/generative-ai` (^0.21.0) - Official Google Generative AI SDK
|
|
42
|
-
- `commander` (^11.1.0) - Command-line interface framework
|
|
43
|
-
- `chalk` (^4.1.2) - Terminal string styling
|
|
44
|
-
- `dotenv` (^16.4.5) - Environment variable management
|
|
45
|
-
|
|
46
|
-
### Architecture
|
|
47
|
-
- Modular design with separate concerns:
|
|
48
|
-
- `bin/gemini-assist.js` - CLI entry point and command handling
|
|
49
|
-
- `src/gemini.js` - Gemini API client and chat logic
|
|
50
|
-
- `src/utils.js` - Utility functions and helpers
|
|
51
|
-
- `index.js` - Programmatic API export
|
|
52
|
-
|
|
53
|
-
### Supported Platforms
|
|
54
|
-
- macOS
|
|
55
|
-
- Linux
|
|
56
|
-
- Windows (with Node.js)
|
|
45
|
+
- More flexible input methods (args, stdin, interactive)
|
|
46
|
+
- Better separation of concerns
|
|
47
|
+
- Improved code maintainability
|
|
57
48
|
|
|
58
49
|
## š Usage Examples
|
|
59
50
|
|
|
60
|
-
###
|
|
51
|
+
### Stdin Support (New!)
|
|
61
52
|
```bash
|
|
62
|
-
|
|
53
|
+
# Pipe text directly
|
|
54
|
+
echo "What is AI?" | gemini-assist
|
|
55
|
+
|
|
56
|
+
# Process file content
|
|
57
|
+
cat document.txt | gemini-assist "Summarize this"
|
|
58
|
+
|
|
59
|
+
# Chain commands
|
|
60
|
+
curl -s https://api.example.com/data | gemini-assist "Analyze this JSON"
|
|
63
61
|
```
|
|
64
62
|
|
|
65
|
-
###
|
|
63
|
+
### Enhanced Version Info (New!)
|
|
66
64
|
```bash
|
|
67
|
-
|
|
65
|
+
# Show detailed version information
|
|
66
|
+
gemini-assist --version-info
|
|
68
67
|
```
|
|
69
68
|
|
|
70
|
-
###
|
|
69
|
+
### History Command (New!)
|
|
71
70
|
```bash
|
|
72
|
-
|
|
71
|
+
# In interactive mode
|
|
72
|
+
gemini-assist --interactive
|
|
73
|
+
You> history
|
|
74
|
+
š Conversation history: 5 messages
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
## š
|
|
77
|
+
## š Bug Fixes
|
|
78
|
+
|
|
79
|
+
- Fixed stdin detection for better pipe support
|
|
80
|
+
- Improved error messages when no input is provided
|
|
81
|
+
- Better handling of edge cases in interactive mode
|
|
76
82
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
## š Migration from v1.1.1-Beta
|
|
84
|
+
|
|
85
|
+
No breaking changes! This is a drop-in replacement. Simply update:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm install -g @zemerik/gemini-assist@latest
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
All existing functionality remains the same, with new features added.
|
|
80
92
|
|
|
81
93
|
## š® Upcoming Features (Planned)
|
|
82
94
|
|
|
@@ -90,28 +102,21 @@ gemini-assist --model gemini-pro --temperature 0.9 --interactive
|
|
|
90
102
|
## š Installation
|
|
91
103
|
|
|
92
104
|
```bash
|
|
93
|
-
npm install -g gemini-assist
|
|
105
|
+
npm install -g @zemerik/gemini-assist
|
|
94
106
|
```
|
|
95
107
|
|
|
96
108
|
## š Getting Started
|
|
97
109
|
|
|
98
110
|
1. Get your API key from [Google AI Studio](https://makersuite.google.com/app/apikey)
|
|
99
111
|
2. Set environment variable: `export GEMINI_API_KEY=your_key`
|
|
100
|
-
3.
|
|
101
|
-
|
|
102
|
-
## ā ļø Beta Notice
|
|
103
|
-
|
|
104
|
-
This is a beta release. While we've tested the core functionality, you may encounter:
|
|
105
|
-
- Occasional API errors
|
|
106
|
-
- Performance variations
|
|
107
|
-
- Missing features compared to future stable releases
|
|
108
|
-
|
|
109
|
-
We welcome feedback and bug reports to help improve the tool!
|
|
112
|
+
3. Or create a `.env` file: `GEMINI_API_KEY=your_key`
|
|
113
|
+
4. Run: `gemini-assist --interactive`
|
|
110
114
|
|
|
111
115
|
## š Acknowledgments
|
|
112
116
|
|
|
113
117
|
- Google Gemini API team for the powerful AI capabilities
|
|
114
118
|
- Open source community for the excellent npm packages used
|
|
119
|
+
- All contributors and users who provided feedback
|
|
115
120
|
|
|
116
121
|
## š License
|
|
117
122
|
|
|
@@ -119,6 +124,6 @@ MIT License - See LICENSE file for details
|
|
|
119
124
|
|
|
120
125
|
---
|
|
121
126
|
|
|
122
|
-
**Download:** `npm install -g gemini-assist`
|
|
127
|
+
**Download:** `npm install -g @zemerik/gemini-assist`
|
|
123
128
|
**Documentation:** See README.md
|
|
124
129
|
**Issues:** Please report via GitHub Issues
|
package/bin/gemini-assist.js
CHANGED
|
@@ -4,6 +4,7 @@ const { program } = require('commander');
|
|
|
4
4
|
const chalk = require('chalk');
|
|
5
5
|
const readline = require('readline');
|
|
6
6
|
const path = require('path');
|
|
7
|
+
const fs = require('fs');
|
|
7
8
|
require('dotenv').config();
|
|
8
9
|
|
|
9
10
|
const { GeminiClient } = require('../src/gemini');
|
|
@@ -15,15 +16,22 @@ const packageJson = require('../package.json');
|
|
|
15
16
|
program
|
|
16
17
|
.name('gemini-assist')
|
|
17
18
|
.description('AI Assistant CLI powered by Google Gemini API')
|
|
18
|
-
.version(packageJson.version)
|
|
19
|
+
.version(packageJson.version, '-v, --version', 'Display version information')
|
|
19
20
|
.option('-k, --api-key <key>', 'Gemini API key (or set GEMINI_API_KEY env variable)')
|
|
20
21
|
.option('-m, --model <model>', 'Gemini model to use (default: gemini-2.5-flash)')
|
|
21
22
|
.option('-i, --interactive', 'Start interactive chat mode', false)
|
|
22
23
|
.option('-t, --temperature <value>', 'Temperature for response (0-1)', '0.7')
|
|
24
|
+
.option('--version-info', 'Show detailed version information')
|
|
23
25
|
.parse(process.argv);
|
|
24
26
|
|
|
25
27
|
const options = program.opts();
|
|
26
28
|
|
|
29
|
+
// Handle version info command
|
|
30
|
+
if (options.versionInfo) {
|
|
31
|
+
showVersionInfo();
|
|
32
|
+
process.exit(0);
|
|
33
|
+
}
|
|
34
|
+
|
|
27
35
|
async function main() {
|
|
28
36
|
try {
|
|
29
37
|
// Get API key
|
|
@@ -54,14 +62,23 @@ async function main() {
|
|
|
54
62
|
temperature: parseFloat(options.temperature)
|
|
55
63
|
});
|
|
56
64
|
|
|
65
|
+
// Check if stdin has data (for piping)
|
|
66
|
+
const stdinData = await readStdin();
|
|
67
|
+
|
|
57
68
|
// Interactive mode
|
|
58
|
-
if (options.interactive || process.argv.length === 2) {
|
|
69
|
+
if (options.interactive || (process.argv.length === 2 && !stdinData)) {
|
|
59
70
|
await startInteractiveMode(client);
|
|
60
71
|
} else {
|
|
61
|
-
// Single query mode
|
|
62
|
-
|
|
72
|
+
// Single query mode - from args, stdin, or error
|
|
73
|
+
let query = program.args.join(' ');
|
|
74
|
+
|
|
75
|
+
// If no args but stdin has data, use stdin
|
|
76
|
+
if (!query && stdinData) {
|
|
77
|
+
query = stdinData;
|
|
78
|
+
}
|
|
79
|
+
|
|
63
80
|
if (!query) {
|
|
64
|
-
printError('Please provide a query
|
|
81
|
+
printError('Please provide a query, use --interactive mode, or pipe input.');
|
|
65
82
|
program.help();
|
|
66
83
|
process.exit(1);
|
|
67
84
|
}
|
|
@@ -87,7 +104,8 @@ async function startInteractiveMode(client) {
|
|
|
87
104
|
prompt: chalk.cyan('You> ')
|
|
88
105
|
});
|
|
89
106
|
|
|
90
|
-
console.log(chalk.gray('Type your message and press Enter. Type "exit", "quit", or "bye" to end the conversation
|
|
107
|
+
console.log(chalk.gray('Type your message and press Enter. Type "exit", "quit", or "bye" to end the conversation.'));
|
|
108
|
+
console.log(chalk.gray('Commands: "clear" to clear screen, "history" to show conversation history.\n'));
|
|
91
109
|
|
|
92
110
|
rl.prompt();
|
|
93
111
|
|
|
@@ -114,6 +132,18 @@ async function startInteractiveMode(client) {
|
|
|
114
132
|
return;
|
|
115
133
|
}
|
|
116
134
|
|
|
135
|
+
// History command
|
|
136
|
+
if (query.toLowerCase() === 'history' || query.toLowerCase() === 'hist') {
|
|
137
|
+
try {
|
|
138
|
+
const count = await client.getHistoryCount();
|
|
139
|
+
console.log(chalk.blue(`\nš Conversation history: ${count} messages\n`));
|
|
140
|
+
} catch (error) {
|
|
141
|
+
console.log(chalk.blue('\nš Conversation history: Not available\n'));
|
|
142
|
+
}
|
|
143
|
+
rl.prompt();
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
117
147
|
// Show thinking indicator
|
|
118
148
|
process.stdout.write(chalk.gray('Gemini> '));
|
|
119
149
|
|
|
@@ -132,5 +162,63 @@ async function startInteractiveMode(client) {
|
|
|
132
162
|
});
|
|
133
163
|
}
|
|
134
164
|
|
|
165
|
+
// Helper function to read from stdin
|
|
166
|
+
function readStdin() {
|
|
167
|
+
return new Promise((resolve) => {
|
|
168
|
+
if (process.stdin.isTTY) {
|
|
169
|
+
resolve('');
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
let data = '';
|
|
174
|
+
process.stdin.setEncoding('utf8');
|
|
175
|
+
|
|
176
|
+
process.stdin.on('data', (chunk) => {
|
|
177
|
+
data += chunk;
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
process.stdin.on('end', () => {
|
|
181
|
+
resolve(data.trim());
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// Set a timeout to resolve if no data comes
|
|
185
|
+
setTimeout(() => resolve(''), 100);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Helper function to show detailed version info
|
|
190
|
+
function showVersionInfo() {
|
|
191
|
+
const os = require('os');
|
|
192
|
+
let rustInfo = 'Not available (using JS fallback)';
|
|
193
|
+
let nodeVersion = process.version;
|
|
194
|
+
|
|
195
|
+
try {
|
|
196
|
+
const native = require('../index.node');
|
|
197
|
+
const rustVersion = native.rust_version();
|
|
198
|
+
rustInfo = 'Available ā';
|
|
199
|
+
} catch (error) {
|
|
200
|
+
rustInfo = 'Not available (using JS fallback)';
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
console.log(chalk.bold.cyan('āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā'));
|
|
204
|
+
console.log(chalk.bold.cyan('ā ') + chalk.bold.white('Gemini Assist Version Info') + chalk.bold.cyan(' ā'));
|
|
205
|
+
console.log(chalk.bold.cyan('āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā'));
|
|
206
|
+
console.log(chalk.cyan('\nš¦ Package:') + chalk.white(` ${packageJson.name}`));
|
|
207
|
+
console.log(chalk.cyan('š¢ Version:') + chalk.white(` ${packageJson.version}`));
|
|
208
|
+
console.log(chalk.cyan('š Description:') + chalk.white(` ${packageJson.description}`));
|
|
209
|
+
console.log(chalk.cyan('š¤ Author:') + chalk.white(` ${packageJson.author}`));
|
|
210
|
+
console.log(chalk.cyan('š License:') + chalk.white(` ${packageJson.license}`));
|
|
211
|
+
console.log(chalk.cyan('\nš„ļø Environment:'));
|
|
212
|
+
console.log(chalk.cyan(' Node.js:') + chalk.white(` ${nodeVersion}`));
|
|
213
|
+
console.log(chalk.cyan(' Platform:') + chalk.white(` ${os.platform()} ${os.arch()}`));
|
|
214
|
+
console.log(chalk.cyan(' Rust Bindings:') + chalk.white(` ${rustInfo}`));
|
|
215
|
+
console.log(chalk.cyan('\nš Links:'));
|
|
216
|
+
if (packageJson.repository && packageJson.repository.url) {
|
|
217
|
+
console.log(chalk.cyan(' Repository:') + chalk.white(` ${packageJson.repository.url}`));
|
|
218
|
+
}
|
|
219
|
+
console.log(chalk.cyan(' NPM:') + chalk.white(` https://www.npmjs.com/package/${packageJson.name}`));
|
|
220
|
+
console.log('');
|
|
221
|
+
}
|
|
222
|
+
|
|
135
223
|
// Run the CLI
|
|
136
224
|
main();
|