clasp-ai 0.59.0 → 0.60.4
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/README.md +80 -0
- package/package.json +1 -1
- package/scripts/install.js +1 -1
package/README.md
CHANGED
|
@@ -105,6 +105,86 @@ clasp -provider custom -model llama3.1
|
|
|
105
105
|
|
|
106
106
|
## Configuration
|
|
107
107
|
|
|
108
|
+
CLASP supports three configuration methods, with the following precedence (highest to lowest):
|
|
109
|
+
1. **Command-line flags** - Override all other settings
|
|
110
|
+
2. **Environment variables** - Override config file settings
|
|
111
|
+
3. **Configuration file** - YAML-based configuration
|
|
112
|
+
4. **Default values** - Built-in defaults
|
|
113
|
+
|
|
114
|
+
### Configuration File
|
|
115
|
+
|
|
116
|
+
CLASP can load configuration from a YAML file, which is cleaner for complex setups and version control friendly.
|
|
117
|
+
|
|
118
|
+
**Configuration file locations** (searched in order):
|
|
119
|
+
1. `./clasp.yaml` or `./clasp.yml` - Current directory
|
|
120
|
+
2. `~/.clasp/config.yaml` - User config directory
|
|
121
|
+
3. `~/.config/clasp/config.yaml` - XDG config directory
|
|
122
|
+
4. `/etc/clasp/config.yaml` - System-wide config
|
|
123
|
+
5. Custom path via `CLASP_CONFIG_FILE` environment variable
|
|
124
|
+
|
|
125
|
+
**Example configuration file** (`clasp.yaml`):
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
# Provider selection
|
|
129
|
+
provider: openai
|
|
130
|
+
|
|
131
|
+
# API Keys (supports ${VAR} syntax for environment variables)
|
|
132
|
+
api_keys:
|
|
133
|
+
openai: ${OPENAI_API_KEY}
|
|
134
|
+
# azure: ${AZURE_API_KEY}
|
|
135
|
+
# openrouter: ${OPENROUTER_API_KEY}
|
|
136
|
+
|
|
137
|
+
# Custom endpoints (optional)
|
|
138
|
+
endpoints:
|
|
139
|
+
openai: https://api.openai.com/v1
|
|
140
|
+
ollama: http://localhost:11434
|
|
141
|
+
|
|
142
|
+
# Model configuration
|
|
143
|
+
models:
|
|
144
|
+
default: gpt-4o
|
|
145
|
+
opus: gpt-4o # Maps claude-opus-* to gpt-4o
|
|
146
|
+
sonnet: gpt-4o-mini # Maps claude-sonnet-* to gpt-4o-mini
|
|
147
|
+
haiku: gpt-4o-mini # Maps claude-haiku-* to gpt-4o-mini
|
|
148
|
+
|
|
149
|
+
# Server settings
|
|
150
|
+
server:
|
|
151
|
+
port: 8080
|
|
152
|
+
log_level: info
|
|
153
|
+
|
|
154
|
+
# Feature toggles
|
|
155
|
+
cache:
|
|
156
|
+
enabled: true
|
|
157
|
+
max_size: 1000
|
|
158
|
+
ttl: 3600
|
|
159
|
+
|
|
160
|
+
rate_limit:
|
|
161
|
+
enabled: false
|
|
162
|
+
requests: 60
|
|
163
|
+
window: 60
|
|
164
|
+
|
|
165
|
+
# Multi-provider routing
|
|
166
|
+
multi_provider:
|
|
167
|
+
enabled: false
|
|
168
|
+
opus:
|
|
169
|
+
provider: openai
|
|
170
|
+
model: gpt-4o
|
|
171
|
+
sonnet:
|
|
172
|
+
provider: anthropic
|
|
173
|
+
model: claude-sonnet-4-20250514
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Environment variable expansion:**
|
|
177
|
+
|
|
178
|
+
The config file supports `${VAR}` and `${VAR:-default}` syntax:
|
|
179
|
+
|
|
180
|
+
```yaml
|
|
181
|
+
api_keys:
|
|
182
|
+
openai: ${OPENAI_API_KEY}
|
|
183
|
+
openrouter: ${OPENROUTER_API_KEY:-sk-or-default-key}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Complete example:** See [clasp.example.yaml](clasp.example.yaml) for all available options.
|
|
187
|
+
|
|
108
188
|
### Command Line Options
|
|
109
189
|
|
|
110
190
|
```
|
package/package.json
CHANGED
package/scripts/install.js
CHANGED