snow-ai 0.4.31 β†’ 0.4.33

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.
Files changed (5) hide show
  1. package/LICENSE +121 -0
  2. package/README.md +308 -0
  3. package/bundle/cli.mjs +20996 -6558
  4. package/package.json +1 -4
  5. package/readme.md +0 -145
package/LICENSE ADDED
@@ -0,0 +1,121 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
package/README.md ADDED
@@ -0,0 +1,308 @@
1
+ # Snow CLI
2
+
3
+ [![Version](https://img.shields.io/npm/v/snow-ai)](https://www.npmjs.com/package/snow-ai)
4
+ [![License](https://img.shields.io/github/license/MayDay-wpf/snow-cli)](https://github.com/MayDay-wpf/snow-cli/blob/main/LICENSE)
5
+
6
+ <div align="center">
7
+ <img src="docs/images/logo.png" alt="Snow AI CLI Logo" width="200"/>
8
+
9
+ # Snow CLI
10
+
11
+ **English** | [δΈ­ζ–‡](README_zh.md)
12
+
13
+ _An intelligent AI-powered CLI tool for developers_
14
+ </div>
15
+
16
+ Snow CLI is an intelligent AI-powered CLI tool that brings advanced AI capabilities directly into your terminal. It provides lightweight access to multiple AI models, giving you the most direct path from your prompt to powerful AI assistance.
17
+
18
+ **English** | [δΈ­ζ–‡](README_zh.md)
19
+
20
+
21
+ ## πŸš€ Why Snow CLI?
22
+
23
+ - **🎯 Multi-Model Support**: Compatible with OpenAI, Anthropic, Gemini, and any OpenAI-compatible APIs
24
+ - **πŸ”§ Built-in Tools**: File operations, shell commands, web fetching, and search capabilities
25
+ - **πŸ”Œ Extensible**: MCP (Model Context Protocol) support for custom integrations
26
+ - **πŸ’» Terminal-First**: Designed for developers who live in the command line
27
+ - **πŸ›‘οΈ Open Source**: Fully open source and community-driven
28
+ - **πŸ“¦ IDE Integration**: VSCode and JetBrains plugins for seamless workflow
29
+
30
+
31
+ ## πŸ“‹ Key Features
32
+
33
+ ### Code Understanding & Generation
34
+
35
+ - Query and edit large codebases with AI assistance
36
+ - Generate new applications from natural language descriptions
37
+ - Debug issues and troubleshoot with intelligent suggestions
38
+ - Multi-file context awareness for better code understanding
39
+
40
+ ### Automation & Integration
41
+
42
+ - Automate operational tasks with AI-powered workflows
43
+ - Use MCP servers to connect new capabilities and tools
44
+ - Run non-interactively in scripts for workflow automation
45
+ - IDE integration for seamless development experience
46
+
47
+ ### Advanced Capabilities
48
+
49
+ - **Multiple Configuration Profiles**: Switch between different API and model configurations
50
+ - **Conversation Checkpointing**: Save and resume complex sessions with `/resume`
51
+ - **Custom System Prompts**: Tailor AI behavior for your specific needs
52
+ - **File Snapshots**: Automatic rollback capability for AI-made changes
53
+ - **Yolo Mode**: Unattended execution for trusted operations
54
+ - **Token Caching**: Optimize token usage with intelligent caching
55
+
56
+
57
+ ## πŸ“¦ Installation
58
+
59
+ ### Pre-requisites
60
+
61
+ - Node.js version 16 or higher
62
+ - npm >= 8.3.0
63
+ - macOS, Linux, or Windows
64
+
65
+ ### Check Your Node.js Version
66
+
67
+ ```bash
68
+ node --version
69
+ ```
70
+
71
+ If your version is below 16.x, please upgrade:
72
+
73
+ ```bash
74
+ # Using nvm (recommended)
75
+ nvm install 16
76
+ nvm use 16
77
+
78
+ # Or download from official website
79
+ # https://nodejs.org/
80
+ ```
81
+
82
+ ### Quick Install
83
+
84
+ #### Install globally with npm
85
+
86
+ ```bash
87
+ npm install -g snow-ai
88
+ ```
89
+
90
+ #### Build from source
91
+
92
+ ```bash
93
+ git clone https://github.com/MayDay-wpf/snow-cli
94
+ cd snow-cli
95
+ npm install
96
+ npm run link # builds and globally links `snow`
97
+ # to remove the link later: npm run unlink
98
+ ```
99
+
100
+ ### IDE Extensions
101
+
102
+ #### VSCode Extension
103
+
104
+ - Download [snow-cli-x.x.x.vsix](https://github.com/MayDay-wpf/snow-cli/releases/tag/vsix)
105
+ - Open VSCode, click `Extensions` β†’ `Install from VSIX...` β†’ select the downloaded file
106
+
107
+ #### JetBrains Plugin
108
+
109
+ - Download [JetBrains plugins](https://github.com/MayDay-wpf/snow-cli/releases/tag/jetbrains)
110
+ - Follow JetBrains plugin installation instructions
111
+
112
+
113
+ ## πŸš€ Quick Start
114
+
115
+ After install snow and Extension/plugin, start Snow CLI in terminal.
116
+
117
+ ### Basic Usage
118
+
119
+ #### Start in current directory
120
+
121
+ ```bash
122
+ snow
123
+ ```
124
+
125
+ #### Update to latest version
126
+
127
+ ```bash
128
+ snow --update
129
+ ```
130
+
131
+ #### Check version
132
+
133
+ ```bash
134
+ snow --version
135
+ ```
136
+
137
+ #### Resume latest conversation (fully compatible with Claude Code)
138
+
139
+ ```bash
140
+ snow -c
141
+ ```
142
+
143
+
144
+ ## πŸ” API & Model Configuration
145
+
146
+ Snow CLI supports multiple AI providers and allows you to save multiple configuration profiles. From `v0.3.2` onward the bundled vendor SDKs were removed to keep the tool lightweight, so everything is configured through API & Model Settings.
147
+
148
+ ### Configuration Options
149
+
150
+ After starting Snow CLI, enter `API & Model Settings` to configure:
151
+
152
+ ![API & Model Settings](docs/images/image.png)
153
+
154
+ - **Profile**: Switch or create new configurations for different API setups
155
+ - **Base URL**: Request endpoint for your AI provider
156
+ - OpenAI/Anthropic: Requires `/v1` suffix
157
+ - Gemini: Requires `/v1beta` suffix
158
+ - **API Key**: Your API key for authentication
159
+ - **Request Method**: Choose:
160
+ - Chat Completions - OpenAI-Compatible API
161
+ - Responses - OpenAI's Responses API (Codex CLI)
162
+ - Gemini - Google Gemini API
163
+ - Anthropic - Anthropic Claude API
164
+ - **Anthropic Beta**: Enable beta features for Anthropic requests
165
+ - **Model Configuration**:
166
+ - **Advanced Model**: High-performance model for complex tasks
167
+ - **Basic Model**: Smaller model for summarization
168
+ - **Compact Model**: Efficient model for context compression
169
+ - All three model slots share the configured Base URL and API Key. Snow auto-fetches available models from the `/models` endpoint (with filtering); use Manual Input to specify a model name when the provider’s list is incomplete.
170
+ - **Max Context Tokens**: Model's maximum context window (e.g., 1000000 for Gemini). This only affects UI calculations for context percentage and does not change the actual model context.
171
+ - **Max Tokens**: Maximum tokens per response (added to API requests)
172
+
173
+
174
+ ## πŸš€ Getting Started
175
+
176
+ After configuring, click **Start** to open the conversation view. When launched from VSCode or other editors, Snow automatically connects to the IDE via the Snow CLI plugin and shows a connection message.
177
+
178
+ ![Conversation](docs/images/image-2.png)
179
+
180
+
181
+ ## πŸ“š Core Features
182
+
183
+ ### File Selection & Commands
184
+
185
+ - **File Selection**: Use `@` to select files for context
186
+ - In VSCode: Hold `Shift` and drag files for quick selection
187
+ - **Slash Commands**: Use `/` to access built-in commands
188
+ - `/init` - Build project documentation `AGENTS.md`
189
+ - `/clear` - Create a new session
190
+ - `/resume` - Restore conversation history
191
+ - `/mcp` - Check MCP connection status and reconnect
192
+ - `/yolo` - Unattended mode (auto-approve all tool calls; use with caution)
193
+ - `/ide` - Manually connect to IDE
194
+ - `/compact` - Compress context (use sparingly)
195
+
196
+ ### Keyboard Shortcuts
197
+
198
+ - **Windows**: `Alt+V` - Paste image
199
+ - **macOS/Linux**: `Ctrl+V` - Paste image (with prompt)
200
+ - `Ctrl+L` - Clear input from cursor to left
201
+ - `Ctrl+R` - Clear input from cursor to right
202
+ - `Shift+Tab` - Toggle Yolo mode
203
+ - `ESC` - Stop AI generation
204
+ - **Double-click `ESC`** - Rollback conversation with file checkpoints
205
+
206
+ ### Token Usage Display
207
+
208
+ The input area shows real-time token statistics:
209
+ - Context usage percentage
210
+ - Total token count
211
+ - Cache hit tokens
212
+ - Cache creation tokens
213
+
214
+ ![Token Usage](docs/images/image-3.png)
215
+
216
+
217
+ ## πŸ”§ Advanced Configuration
218
+
219
+ ### Proxy & Browser Settings
220
+
221
+ Configure system proxy and search engine preferences:
222
+ - Automatic system proxy detection (usually no changes needed)
223
+ - Browser selection for web search (Edge/Chrome auto-detected unless you changed installation paths)
224
+ - Custom proxy port configuration
225
+
226
+ ![Proxy & Browser Settings](docs/images/image-1.png)
227
+
228
+ ### Custom System Prompts
229
+
230
+ Customize AI behavior with your own system prompts:
231
+ - Supplements (does not replace) Snow's built-in prompt; the default prompt is downgraded to a user message and appended to your first user message
232
+ - Opens the system text editor for editing (Notepad on Windows; default terminal editor on macOS/Linux)
233
+ - Requires restart after saving (shows: `Custom system prompt saved successfully! Please use 'snow' to restart!`)
234
+
235
+ ### Custom Headers
236
+
237
+ Add custom HTTP headers to API requests:
238
+ - Extends default headers (cannot override built-in headers)
239
+ - Useful for custom authentication or routing
240
+
241
+ ### MCP Configuration
242
+
243
+ Configure Model Context Protocol servers:
244
+ - JSON format compatible with Cursor
245
+ - Extends Snow CLI with custom tools and capabilities
246
+ - Same editing workflow as system prompts
247
+
248
+
249
+ ## πŸ“ Snow System Files
250
+
251
+ All Snow CLI files are stored in `~/.snow/`:
252
+
253
+ ```
254
+ .snow/
255
+ β”œβ”€β”€ log/ # Runtime logs (local only, safe to delete)
256
+ β”œβ”€β”€ profiles/ # Multiple API/model configurations
257
+ β”œβ”€β”€ sessions/ # Conversation history for /resume
258
+ β”œβ”€β”€ snapshots/ # File backups for rollback
259
+ β”œβ”€β”€ todo/ # Persisted todo lists
260
+ β”œβ”€β”€ active-profile.txt # Current active profile
261
+ β”œβ”€β”€ config.json # Main API configuration
262
+ β”œβ”€β”€ custom-headers.json # Custom request headers
263
+ β”œβ”€β”€ mcp-config.json # MCP service configuration
264
+ └── system-prompt.txt # Custom system prompt
265
+ ```
266
+
267
+ ![Snow Files](docs/images/image-4.png)
268
+
269
+ ### File Management
270
+
271
+ - **Logs**: Local-only runtime logs; safe to delete for cleanup
272
+ - **Sessions**: Stored locally and required for conversation history features like `/resume`
273
+ - **Snapshots**: Automatic file checkpoints that enable rollback functionality
274
+ - **Todo**: Persists tasks so they survive unexpected exits
275
+
276
+
277
+ ## 🀝 Contributing
278
+
279
+ We welcome contributions! Snow CLI is fully open source, and we encourage the community to:
280
+
281
+ - Report bugs and suggest features
282
+ - Improve documentation
283
+ - Submit code improvements
284
+ - Share your MCP servers and extensions
285
+
286
+ Visit our [GitHub repository](https://github.com/MayDay-wpf/snow-cli) to get started.
287
+
288
+
289
+ ## πŸ“– Resources
290
+
291
+ - **[GitHub Repository](https://github.com/MayDay-wpf/snow-cli)** - Source code and issues
292
+ - **[NPM Package](https://www.npmjs.com/package/snow-ai)** - Package registry
293
+ - **[Releases](https://github.com/MayDay-wpf/snow-cli/releases)** - Download IDE extensions
294
+
295
+ ## πŸ“Š Star History
296
+
297
+ [![Star History Chart](https://api.star-history.com/svg?repos=MayDay-wpf/snow-cli&type=Date)](https://star-history.com/#MayDay-wpf/snow-cli&Date)
298
+
299
+ ## πŸ“„ Legal
300
+
301
+ - **License**: Open source (License Type TBC)
302
+ - **Privacy**: All data stored locally, no telemetry
303
+
304
+ ---
305
+
306
+ <p align="center">
307
+ Built with ❀️ by the open source community
308
+ </p>