|
2 | 2 | import Docs from '../../layouts/Docs.astro'; |
3 | 3 | --- |
4 | 4 |
|
5 | | -<Docs title="Configuration" description="Configure Clarissa with environment variables and settings"> |
| 5 | +<Docs title="Configuration" description="Configure Clarissa with a config file or environment variables"> |
6 | 6 | <h1>Configuration</h1> |
7 | 7 | <p> |
8 | | - Clarissa is configured primarily through environment variables. The only required setting |
9 | | - is your OpenRouter API key. |
| 8 | + Clarissa can be configured via a config file or environment variables. |
| 9 | + The only required setting is your OpenRouter API key. |
10 | 10 | </p> |
11 | 11 |
|
12 | 12 | <h2>API Key Setup</h2> |
13 | 13 | <p> |
14 | | - Set your <a href="https://openrouter.ai/keys" target="_blank" rel="noopener">OpenRouter API key</a> |
15 | | - as an environment variable: |
| 14 | + Get your API key from <a href="https://openrouter.ai/keys" target="_blank" rel="noopener">OpenRouter</a>. |
16 | 15 | </p> |
17 | | - <pre><code>export OPENROUTER_API_KEY=your_api_key_here</code></pre> |
18 | | - |
19 | | - <p>To make this permanent, add it to your shell configuration file:</p> |
20 | | - |
21 | | - <h3>Bash (~/.bashrc or ~/.bash_profile)</h3> |
22 | | - <pre><code>echo 'export OPENROUTER_API_KEY=your_api_key_here' >> ~/.bashrc |
23 | | -source ~/.bashrc</code></pre> |
24 | 16 |
|
25 | | - <h3>Zsh (~/.zshrc)</h3> |
26 | | - <pre><code>echo 'export OPENROUTER_API_KEY=your_api_key_here' >> ~/.zshrc |
27 | | -source ~/.zshrc</code></pre> |
| 17 | + <h3>Option 1: Config File (Recommended)</h3> |
| 18 | + <p>Create a config file at <code>~/.clarissa/config.json</code>:</p> |
| 19 | + <pre><code>mkdir -p ~/.clarissa |
| 20 | +echo '{{"apiKey": "your_api_key_here"}}' > ~/.clarissa/config.json</code></pre> |
| 21 | + |
| 22 | + <h3>Option 2: Environment Variable</h3> |
| 23 | + <p>Set your API key as an environment variable:</p> |
| 24 | + <pre><code>export OPENROUTER_API_KEY=your_api_key_here</code></pre> |
| 25 | + <p>To make this permanent, add it to your shell configuration file (~/.zshrc or ~/.bashrc).</p> |
28 | 26 |
|
29 | | - <h2>Environment Variables</h2> |
| 27 | + <h2>Configuration Options</h2> |
| 28 | + <p>Settings can be specified in the config file or as environment variables. Environment variables take precedence.</p> |
30 | 29 | <table> |
31 | 30 | <thead> |
32 | 31 | <tr> |
33 | | - <th>Variable</th> |
| 32 | + <th>Config Key</th> |
| 33 | + <th>Env Variable</th> |
34 | 34 | <th>Default</th> |
35 | 35 | <th>Description</th> |
36 | 36 | </tr> |
37 | 37 | </thead> |
38 | 38 | <tbody> |
39 | 39 | <tr> |
| 40 | + <td><code>apiKey</code></td> |
40 | 41 | <td><code>OPENROUTER_API_KEY</code></td> |
41 | 42 | <td>(required)</td> |
42 | 43 | <td>Your OpenRouter API key</td> |
43 | 44 | </tr> |
44 | 45 | <tr> |
| 46 | + <td><code>model</code></td> |
45 | 47 | <td><code>OPENROUTER_MODEL</code></td> |
46 | 48 | <td><code>anthropic/claude-sonnet-4</code></td> |
47 | 49 | <td>Default model to use</td> |
48 | 50 | </tr> |
49 | 51 | <tr> |
| 52 | + <td><code>maxIterations</code></td> |
50 | 53 | <td><code>MAX_ITERATIONS</code></td> |
51 | 54 | <td><code>10</code></td> |
52 | 55 | <td>Maximum tool execution iterations per request</td> |
53 | 56 | </tr> |
54 | 57 | <tr> |
| 58 | + <td><code>debug</code></td> |
55 | 59 | <td><code>DEBUG</code></td> |
56 | 60 | <td><code>false</code></td> |
57 | 61 | <td>Enable debug logging</td> |
58 | 62 | </tr> |
59 | 63 | </tbody> |
60 | 64 | </table> |
61 | 65 |
|
| 66 | + <h3>Example Config File</h3> |
| 67 | + <pre><code set:html={`{ |
| 68 | + "apiKey": "sk-or-...", |
| 69 | + "model": "anthropic/claude-sonnet-4", |
| 70 | + "maxIterations": 10, |
| 71 | + "debug": false, |
| 72 | + "mcpServers": { |
| 73 | + "filesystem": { |
| 74 | + "command": "npx", |
| 75 | + "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"] |
| 76 | + } |
| 77 | + } |
| 78 | +}`} /></pre> |
| 79 | + |
| 80 | + <h3>MCP Servers</h3> |
| 81 | + <p> |
| 82 | + Configure MCP (Model Context Protocol) servers to extend Clarissa with additional tools. |
| 83 | + Servers defined in <code>mcpServers</code> are automatically loaded on startup. |
| 84 | + </p> |
| 85 | + <table> |
| 86 | + <thead> |
| 87 | + <tr> |
| 88 | + <th>Property</th> |
| 89 | + <th>Type</th> |
| 90 | + <th>Description</th> |
| 91 | + </tr> |
| 92 | + </thead> |
| 93 | + <tbody> |
| 94 | + <tr> |
| 95 | + <td><code>command</code></td> |
| 96 | + <td>string</td> |
| 97 | + <td>Command to run the MCP server</td> |
| 98 | + </tr> |
| 99 | + <tr> |
| 100 | + <td><code>args</code></td> |
| 101 | + <td>string[]</td> |
| 102 | + <td>Arguments to pass to the command</td> |
| 103 | + </tr> |
| 104 | + <tr> |
| 105 | + <td><code>env</code></td> |
| 106 | + <td>object</td> |
| 107 | + <td>Environment variables for the server</td> |
| 108 | + </tr> |
| 109 | + </tbody> |
| 110 | + </table> |
| 111 | + <p>Use <code>/mcp</code> to view connected servers and <code>/tools</code> to see available tools.</p> |
| 112 | + |
62 | 113 | <h2>Available Models</h2> |
63 | 114 | <p> |
64 | 115 | Clarissa supports any model available through OpenRouter. Some popular options include: |
@@ -119,6 +170,10 @@ source ~/.zshrc</code></pre> |
119 | 170 | </tr> |
120 | 171 | </thead> |
121 | 172 | <tbody> |
| 173 | + <tr> |
| 174 | + <td><code>~/.clarissa/config.json</code></td> |
| 175 | + <td>Configuration file (API key, model, etc.)</td> |
| 176 | + </tr> |
122 | 177 | <tr> |
123 | 178 | <td><code>~/.clarissa/sessions/</code></td> |
124 | 179 | <td>Saved conversation sessions (JSON files)</td> |
|
0 commit comments