@syrin/cli 1.3.2 → 1.4.1

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 (150) hide show
  1. package/README.md +184 -152
  2. package/dist/cli/commands/config.d.ts +47 -0
  3. package/dist/cli/commands/config.js +360 -0
  4. package/dist/cli/commands/dev.d.ts +6 -0
  5. package/dist/cli/commands/dev.js +67 -15
  6. package/dist/cli/commands/doctor.js +49 -13
  7. package/dist/cli/commands/init.d.ts +2 -0
  8. package/dist/cli/commands/init.js +89 -18
  9. package/dist/cli/commands/status.d.ts +10 -0
  10. package/dist/cli/commands/status.js +162 -0
  11. package/dist/cli/index.js +211 -12
  12. package/dist/cli/prompts/init-prompt.d.ts +18 -0
  13. package/dist/cli/prompts/init-prompt.js +159 -99
  14. package/dist/cli/utils/command-error-handler.js +2 -5
  15. package/dist/config/env-checker.d.ts +12 -2
  16. package/dist/config/env-checker.js +88 -38
  17. package/dist/config/env-templates.d.ts +15 -0
  18. package/dist/config/env-templates.js +49 -0
  19. package/dist/config/generator.js +17 -0
  20. package/dist/config/global-loader.d.ts +50 -0
  21. package/dist/config/global-loader.js +244 -0
  22. package/dist/config/loader.d.ts +28 -0
  23. package/dist/config/loader.js +95 -9
  24. package/dist/config/merger.d.ts +37 -0
  25. package/dist/config/merger.js +68 -0
  26. package/dist/config/schema.d.ts +26 -1
  27. package/dist/config/schema.js +73 -8
  28. package/dist/config/types.d.ts +19 -0
  29. package/dist/config/types.js +26 -1
  30. package/dist/constants/messages.d.ts +7 -0
  31. package/dist/constants/messages.js +8 -0
  32. package/dist/constants/paths.d.ts +6 -0
  33. package/dist/constants/paths.js +10 -0
  34. package/dist/events/emitter.js +7 -7
  35. package/dist/index.js +0 -0
  36. package/dist/presentation/config-ui.d.ts +34 -0
  37. package/dist/presentation/config-ui.js +139 -0
  38. package/dist/presentation/doctor-ui.d.ts +11 -0
  39. package/dist/presentation/doctor-ui.js +52 -1
  40. package/dist/presentation/init-ui.d.ts +9 -0
  41. package/dist/presentation/init-ui.js +33 -0
  42. package/dist/runtime/analysis/analyser.js +2 -2
  43. package/dist/runtime/analysis/rules/warnings/w104-generic-description.d.ts +1 -1
  44. package/dist/runtime/analysis/rules/warnings/w104-generic-description.js +1 -1
  45. package/dist/runtime/dev/event-mapper.js +19 -3
  46. package/dist/runtime/dev/session.d.ts +4 -0
  47. package/dist/runtime/dev/session.js +52 -3
  48. package/dist/runtime/llm/ollama.js +4 -4
  49. package/dist/runtime/mcp/client/manager.js +3 -3
  50. package/dist/runtime/sandbox/executor.js +5 -5
  51. package/dist/runtime/test/orchestrator.js +4 -4
  52. package/dist/utils/editor.d.ts +37 -0
  53. package/dist/utils/editor.js +137 -0
  54. package/dist/utils/logger.d.ts +24 -6
  55. package/dist/utils/logger.js +51 -8
  56. package/package.json +23 -23
  57. package/dist/runtime/analysis/rules/errors/e001-missing-output-schema.d.ts +0 -22
  58. package/dist/runtime/analysis/rules/errors/e001-missing-output-schema.js +0 -30
  59. package/dist/runtime/analysis/rules/errors/e002-underspecified-input.d.ts +0 -24
  60. package/dist/runtime/analysis/rules/errors/e002-underspecified-input.js +0 -52
  61. package/dist/runtime/analysis/rules/errors/e003-type-mismatch.d.ts +0 -23
  62. package/dist/runtime/analysis/rules/errors/e003-type-mismatch.js +0 -73
  63. package/dist/runtime/analysis/rules/errors/e004-free-text-propagation.d.ts +0 -23
  64. package/dist/runtime/analysis/rules/errors/e004-free-text-propagation.js +0 -47
  65. package/dist/runtime/analysis/rules/errors/e005-tool-ambiguity.d.ts +0 -25
  66. package/dist/runtime/analysis/rules/errors/e005-tool-ambiguity.js +0 -73
  67. package/dist/runtime/analysis/rules/errors/e006-param-not-in-description.d.ts +0 -22
  68. package/dist/runtime/analysis/rules/errors/e006-param-not-in-description.js +0 -57
  69. package/dist/runtime/analysis/rules/errors/e007-output-not-guaranteed.d.ts +0 -23
  70. package/dist/runtime/analysis/rules/errors/e007-output-not-guaranteed.js +0 -56
  71. package/dist/runtime/analysis/rules/errors/e008-circular-dependency.d.ts +0 -22
  72. package/dist/runtime/analysis/rules/errors/e008-circular-dependency.js +0 -84
  73. package/dist/runtime/analysis/rules/errors/e009-implicit-user-input.d.ts +0 -23
  74. package/dist/runtime/analysis/rules/errors/e009-implicit-user-input.js +0 -89
  75. package/dist/runtime/analysis/rules/errors/e010-non-serializable.d.ts +0 -25
  76. package/dist/runtime/analysis/rules/errors/e010-non-serializable.js +0 -46
  77. package/dist/runtime/analysis/rules/errors/e011-missing-tool-description.d.ts +0 -24
  78. package/dist/runtime/analysis/rules/errors/e011-missing-tool-description.js +0 -33
  79. package/dist/runtime/analysis/rules/errors/e012-side-effect-detected.d.ts +0 -39
  80. package/dist/runtime/analysis/rules/errors/e012-side-effect-detected.js +0 -40
  81. package/dist/runtime/analysis/rules/errors/e013-non-deterministic-output.d.ts +0 -37
  82. package/dist/runtime/analysis/rules/errors/e013-non-deterministic-output.js +0 -34
  83. package/dist/runtime/analysis/rules/errors/e013-output-explosion.d.ts +0 -39
  84. package/dist/runtime/analysis/rules/errors/e013-output-explosion.js +0 -36
  85. package/dist/runtime/analysis/rules/errors/e014-hidden-dependency.d.ts +0 -42
  86. package/dist/runtime/analysis/rules/errors/e014-hidden-dependency.js +0 -46
  87. package/dist/runtime/analysis/rules/errors/e014-output-explosion.d.ts +0 -39
  88. package/dist/runtime/analysis/rules/errors/e014-output-explosion.js +0 -36
  89. package/dist/runtime/analysis/rules/errors/e015-hidden-dependency.d.ts +0 -42
  90. package/dist/runtime/analysis/rules/errors/e015-hidden-dependency.js +0 -46
  91. package/dist/runtime/analysis/rules/errors/e015-unbounded-execution.d.ts +0 -44
  92. package/dist/runtime/analysis/rules/errors/e015-unbounded-execution.js +0 -66
  93. package/dist/runtime/analysis/rules/errors/e016-output-validation-failed.d.ts +0 -43
  94. package/dist/runtime/analysis/rules/errors/e016-output-validation-failed.js +0 -42
  95. package/dist/runtime/analysis/rules/errors/e016-unbounded-execution.d.ts +0 -44
  96. package/dist/runtime/analysis/rules/errors/e016-unbounded-execution.js +0 -66
  97. package/dist/runtime/analysis/rules/errors/e017-input-validation-failed.d.ts +0 -57
  98. package/dist/runtime/analysis/rules/errors/e017-input-validation-failed.js +0 -80
  99. package/dist/runtime/analysis/rules/errors/e017-output-validation-failed.d.ts +0 -43
  100. package/dist/runtime/analysis/rules/errors/e017-output-validation-failed.js +0 -42
  101. package/dist/runtime/analysis/rules/errors/e018-input-validation-failed.d.ts +0 -57
  102. package/dist/runtime/analysis/rules/errors/e018-input-validation-failed.js +0 -80
  103. package/dist/runtime/analysis/rules/errors/e018-tool-execution-failed.d.ts +0 -38
  104. package/dist/runtime/analysis/rules/errors/e018-tool-execution-failed.js +0 -37
  105. package/dist/runtime/analysis/rules/errors/e019-tool-execution-failed.d.ts +0 -38
  106. package/dist/runtime/analysis/rules/errors/e019-tool-execution-failed.js +0 -37
  107. package/dist/runtime/analysis/rules/errors/e019-unexpected-test-result.d.ts +0 -65
  108. package/dist/runtime/analysis/rules/errors/e019-unexpected-test-result.js +0 -109
  109. package/dist/runtime/analysis/rules/errors/e020-unexpected-test-result.d.ts +0 -65
  110. package/dist/runtime/analysis/rules/errors/e020-unexpected-test-result.js +0 -109
  111. package/dist/runtime/analysis/rules/warnings/w001-implicit-dependency.d.ts +0 -22
  112. package/dist/runtime/analysis/rules/warnings/w001-implicit-dependency.js +0 -39
  113. package/dist/runtime/analysis/rules/warnings/w002-free-text-without-normalization.d.ts +0 -24
  114. package/dist/runtime/analysis/rules/warnings/w002-free-text-without-normalization.js +0 -40
  115. package/dist/runtime/analysis/rules/warnings/w003-missing-examples.d.ts +0 -22
  116. package/dist/runtime/analysis/rules/warnings/w003-missing-examples.js +0 -84
  117. package/dist/runtime/analysis/rules/warnings/w004-overloaded-responsibility.d.ts +0 -23
  118. package/dist/runtime/analysis/rules/warnings/w004-overloaded-responsibility.js +0 -96
  119. package/dist/runtime/analysis/rules/warnings/w005-generic-description.d.ts +0 -53
  120. package/dist/runtime/analysis/rules/warnings/w005-generic-description.js +0 -108
  121. package/dist/runtime/analysis/rules/warnings/w006-optional-as-required.d.ts +0 -22
  122. package/dist/runtime/analysis/rules/warnings/w006-optional-as-required.js +0 -44
  123. package/dist/runtime/analysis/rules/warnings/w007-broad-output-schema.d.ts +0 -23
  124. package/dist/runtime/analysis/rules/warnings/w007-broad-output-schema.js +0 -37
  125. package/dist/runtime/analysis/rules/warnings/w008-multiple-entry-points.d.ts +0 -22
  126. package/dist/runtime/analysis/rules/warnings/w008-multiple-entry-points.js +0 -97
  127. package/dist/runtime/analysis/rules/warnings/w009-hidden-side-effects.d.ts +0 -23
  128. package/dist/runtime/analysis/rules/warnings/w009-hidden-side-effects.js +0 -88
  129. package/dist/runtime/analysis/rules/warnings/w010-output-not-reusable.d.ts +0 -22
  130. package/dist/runtime/analysis/rules/warnings/w010-output-not-reusable.js +0 -81
  131. package/dist/runtime/analysis/rules/warnings/w021-weak-schema.d.ts +0 -40
  132. package/dist/runtime/analysis/rules/warnings/w021-weak-schema.js +0 -32
  133. package/dist/runtime/analysis/rules/warnings/w022-high-entropy-output.d.ts +0 -39
  134. package/dist/runtime/analysis/rules/warnings/w022-high-entropy-output.js +0 -36
  135. package/dist/runtime/analysis/rules/warnings/w023-unstable-defaults.d.ts +0 -38
  136. package/dist/runtime/analysis/rules/warnings/w023-unstable-defaults.js +0 -36
  137. package/dist/runtime/test/dependency-tracker.d.ts +0 -66
  138. package/dist/runtime/test/dependency-tracker.js +0 -80
  139. package/dist/runtime/test/formatters.d.ts +0 -18
  140. package/dist/runtime/test/formatters.js +0 -172
  141. package/dist/runtime/test/input-generator.d.ts +0 -33
  142. package/dist/runtime/test/input-generator.js +0 -498
  143. package/dist/runtime/test/mcp-root-detector.d.ts +0 -31
  144. package/dist/runtime/test/mcp-root-detector.js +0 -105
  145. package/dist/runtime/test/retry-tester.d.ts +0 -44
  146. package/dist/runtime/test/retry-tester.js +0 -103
  147. package/dist/runtime/test/synthetic-input-generator.d.ts +0 -11
  148. package/dist/runtime/test/synthetic-input-generator.js +0 -154
  149. package/dist/runtime/test/test-runner.d.ts +0 -28
  150. package/dist/runtime/test/test-runner.js +0 -55
package/README.md CHANGED
@@ -1,231 +1,248 @@
1
1
  # Syrin
2
2
 
3
- ![Syrin Logo](/assets/syrin-logo-dark-bg.png)
3
+ ![Syrin Logo](https://github.com/Syrin-Labs/cli/raw/main/assets/syrin-logo-dark-bg.png)
4
4
 
5
- [![npm version](https://badge.fury.io/js/%40syrin%2Fsyrin.svg)](https://badge.fury.io/js/%40syrin%2Fsyrin) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC) [![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org/)
5
+ [![npm version](https://badge.fury.io/js/%40syrin%2Fcli.svg)](https://www.npmjs.com/package/@syrin/cli) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC) [![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.12.0-brightgreen)](https://nodejs.org/)
6
6
 
7
- **Syrin is a runtime intelligence system for MCP servers.**
7
+ ## Stop Silent Failures in AI Tool Calls
8
8
 
9
- It helps developers **see, validate, and reason about MCP execution** before systems reach production.
9
+ Your AI agent just called the same tool 47 times with identical parameters.
10
+ Your logs look fine. You're silently burning $200 in tokens.
10
11
 
11
- Documentation: [https://docs.syrin.dev](https://docs.syrin.dev)
12
+ **Syrin catches these failures before production.**
12
13
 
13
14
  ---
14
15
 
15
- ## The Problem
16
+ ## What Is This?
16
17
 
17
- Building MCP servers today usually looks like this:
18
+ Syrin is a development toolkit for [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) servers the standard way AI agents call external tools.
18
19
 
19
- 1. Define tools and prompts
20
- 2. Connect an LLM
21
- 3. Run the server
22
- 4. Hope execution behaves as expected
20
+ **Without Syrin:**
23
21
 
24
- When things go wrong:
22
+ ```txt
23
+ Tool called 47x → No visibility
24
+ $200 burned → Silent failure
25
+ Logs look "fine" → Debug for hours
26
+ ```
25
27
 
26
- - Tools are called for unclear reasons
27
- - Behaviour changes between runs
28
- - Debugging relies on logs and guesswork
29
- - Contract issues surface only after failures
28
+ **With Syrin:**
30
29
 
31
- Most problems are discovered **after** deployment.
30
+ ```txt
31
+ Loop detected at call #3 → Execution halted
32
+ Full event trace → See exactly what happened
33
+ Contract validated → Catch issues before runtime
34
+ ```
32
35
 
33
36
  ---
34
37
 
35
- ## Installation
38
+ ## What Syrin Catches
36
39
 
37
- ### Quick start
40
+ **Tool Loops** — Model proposes the same tool repeatedly with no progress
38
41
 
39
- ```bash
40
- npx @syrin/cli init
41
- ```
42
+ **Wrong Tool Selection** — Similar names, overlapping schemas, ambiguous descriptions cause silent misbehavior
42
43
 
43
- ### Global install
44
+ **Silent Failures** — Tool throws an error but execution continues with broken state
44
45
 
45
- ```bash
46
- npm install -g @syrin/cli
47
- ```
46
+ **Contract Mismatches** — Input/output schemas don't align between chained tools
48
47
 
49
- ### Local install (recommended for CI)
48
+ **Hidden Dependencies** Tools assume state that doesn't exist
50
49
 
51
- ```bash
52
- npm install @syrin/cli
53
- ```
50
+ Documentation: [https://docs.syrin.dev](https://docs.syrin.dev)
54
51
 
55
- Requirements:
52
+ ---
56
53
 
57
- - Node.js 18
58
- - npm ≥ 9
54
+ ## See It In Action
55
+
56
+ <table>
57
+ <tr>
58
+ <td width="33%"><strong>syrin analyse</strong><br/>Catch contract issues</td>
59
+ <td width="33%"><strong>syrin dev</strong><br/>Interactive development</td>
60
+ <td width="33%"><strong>syrin test</strong><br/>Sandboxed tool testing</td>
61
+ </tr>
62
+ <tr>
63
+ <td><img src="https://github.com/Syrin-Labs/cli/raw/main/assets/demo/syrin-analyse/analyse.gif" width="280" alt="syrin analyse demo"/></td>
64
+ <td><img src="https://github.com/Syrin-Labs/cli/raw/main/assets/demo/syrin-dev/dev.gif" width="280" alt="syrin dev demo"/></td>
65
+ <td><img src="https://github.com/Syrin-Labs/cli/raw/main/assets/demo/syrin-test/test_tool.gif" width="280" alt="syrin test demo"/></td>
66
+ </tr>
67
+ <tr>
68
+ <td width="33%"><strong>syrin init</strong><br/>Project setup</td>
69
+ <td width="33%"><strong>syrin list</strong><br/>Inspect tools</td>
70
+ <td width="33%"><strong>syrin test --connection</strong><br/>Connection test</td>
71
+ </tr>
72
+ <tr>
73
+ <td><img src="https://github.com/Syrin-Labs/cli/raw/main/assets/demo/syrin-init/init.gif" width="280" alt="syrin init demo"/></td>
74
+ <td><img src="https://github.com/Syrin-Labs/cli/raw/main/assets/demo/syrin-list/list.gif" width="280" alt="syrin list demo"/></td>
75
+ <td><img src="https://github.com/Syrin-Labs/cli/raw/main/assets/demo/syrin-test/test_connection.gif" width="280" alt="syrin test --connection demo"/></td>
76
+ </tr>
77
+ </table>
59
78
 
60
79
  ---
61
80
 
62
- ## The Syrin Way
81
+ ## Try It Now
63
82
 
64
- Syrin changes the workflow.
83
+ ```bash
84
+ # No install needed — run directly
85
+ npx @syrin/cli analyse --transport http --url http://localhost:8000/mcp
86
+ ```
65
87
 
66
- Instead of guessing how MCP behaves, you **inspect and validate it explicitly**.
88
+ Or install globally:
67
89
 
68
- **Before:**
90
+ ```bash
91
+ npm install -g @syrin/cli
69
92
 
70
- ```text
71
- Write tools Connect LLM → Run server → Debug via logs
93
+ syrin init --global
94
+ syrin doctor # Check your environment
95
+ syrin analyse --transport http --url http://localhost:8000/mcp # Analyze an MCP server
96
+ syrin dev --exec --transport http --url http://localhost:8000/mcp # Interactive dev mode
72
97
  ```
73
98
 
74
- **With Syrin:**
99
+ Or initialize a project with local config:
75
100
 
76
- ```text
77
- Define tools
78
- Analyse contracts
79
- Validate protocol
80
- → Inspect behaviour interactively
81
- → Enable execution with confidence
101
+ ```bash
102
+ npx @syrin/cli init
103
+ syrin doctor
104
+ syrin analyse
82
105
  ```
83
106
 
84
- Syrin does not replace MCP.
85
- It makes MCP systems understandable and testable.
107
+ **Want to try with a sample server?** Clone the repo and use the included [example MCP server](./examples/demo-mcp-py/):
86
108
 
87
- ---
88
-
89
- ## What Syrin Does
109
+ ```bash
110
+ git clone https://github.com/Syrin-Labs/cli.git && cd cli/examples/demo-mcp-py
111
+ python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt
112
+ python server.py --mode http --port 8000 &
113
+ npx @syrin/cli analyse --transport http --url http://localhost:8000/mcp
114
+ ```
90
115
 
91
- - Validates MCP protocol compliance
92
- - Analyses tool contracts statically
93
- - Lets you interact with MCP servers using real LLMs
94
- - Shows which tools are proposed and why
95
- - Prevents accidental execution by default
96
- - Surfaces configuration and contract errors early
116
+ Requirements: Node.js >= 20.12, npm >= 9
97
117
 
98
118
  ---
99
119
 
100
- ## Key Capabilities
101
-
102
- ### Static Tool Contract Analysis (`syrin analyse`)
120
+ ## Core Commands
103
121
 
104
- LLMs rely entirely on tool contracts.
105
- If contracts are vague or incomplete, behaviour becomes unreliable.
122
+ | Command | What It Does |
123
+ |---------|--------------|
124
+ | `syrin analyse` | Static analysis — catches contract issues before runtime |
125
+ | `syrin dev` | Interactive mode — see exactly what your LLM proposes |
126
+ | `syrin test` | Contract testing — validate tools in sandboxed execution |
127
+ | `syrin doctor` | Environment check — validate config and connections |
128
+ | `syrin list` | Inspect tools, resources, and prompts from your server |
106
129
 
107
- `syrin analyse` inspects:
130
+ ---
108
131
 
109
- - Tool definitions
110
- - Parameter schemas
111
- - Description clarity
112
- - Implicit dependencies between tools
132
+ ## Global Configuration
113
133
 
114
- This catches issues **before runtime**.
134
+ Syrin supports both **local** (project-specific) and **global** (user-wide) configurations. This allows you to:
115
135
 
116
- ```bash
117
- syrin analyse
118
- ```
136
+ - Use Syrin from any directory without initializing a project
137
+ - Share LLM API keys across multiple projects
138
+ - Set default agent names and LLM providers globally
119
139
 
120
- This is especially useful in CI:
140
+ ### Quick Setup
121
141
 
122
142
  ```bash
123
- syrin analyse --ci
124
- ```
143
+ # Set up global configuration
144
+ syrin config setup --global
125
145
 
126
- ---
146
+ # Set API keys in global .env
147
+ syrin config edit-env --global
127
148
 
128
- ### Interactive Execution Inspection (`syrin dev`)
129
-
130
- `syrin dev` provides a governed chat interface for MCP servers.
149
+ # Use Syrin from any directory
150
+ syrin dev --exec --transport http --url http://localhost:8000/mcp
151
+ ```
131
152
 
132
- - Preview tool calls before execution
133
- - Execute tools only when explicitly enabled
134
- - Switch between LLM providers
135
- - Inspect large tool outputs safely
153
+ ### Configuration Management
136
154
 
137
155
  ```bash
138
- syrin dev
139
- ```
156
+ # View global config
157
+ syrin config list --global
140
158
 
141
- Enable execution only when ready:
159
+ # Set global LLM provider
160
+ syrin config set openai.model "gpt-4-turbo" --global
142
161
 
143
- ```bash
144
- syrin dev --exec
162
+ # Set default provider
163
+ syrin config set-default claude --global
145
164
  ```
146
165
 
147
- ---
166
+ See the [Configuration Guide](docs/Commands/syrin-config.md) for more details.
148
167
 
149
- ### Tool-Level Structural Safety Validation (`syrin test`)
168
+ ## Key Capabilities
150
169
 
151
- **v1.3.0 Feature**: `syrin test` now validates tool contracts through sandboxed execution.
170
+ ### `syrin analyse` Find Problems Before They Hit Production
152
171
 
153
- This acts as a "hard design gate" to ensure each tool is individually safe for agent-driven systems:
172
+ **The Problem:** Your LLM picks the wrong tool, or calls tools with missing parameters. You only find out after deployment when users report broken behavior.
154
173
 
155
- - **Tool Unit Contracts**: Define behavioral guarantees in `tools/<tool-name>.yaml` files
156
- - **Sandboxed Execution**: Tools tested in isolated environments with resource limits
157
- - **Behavioral Observation**: Detects side effects, non-determinism, output explosions, hidden dependencies
158
- - **Process Reuse**: Optimized for performance (100+ tools in 1-3 minutes)
174
+ **The Solution:** Static analysis of your tool contracts catches issues before any code runs.
159
175
 
160
176
  ```bash
161
- # Validate all tools
162
- syrin test
163
-
164
- # Test specific tool
165
- syrin test --tool fetch_user
166
-
167
- # Strict mode (warnings become errors)
168
- syrin test --strict
169
-
170
- # JSON output for CI
171
- syrin test --json
177
+ syrin analyse # Check all tool contracts
178
+ syrin analyse --ci # Exit code 1 on errors (for CI pipelines)
179
+ syrin analyse --strict # Treat warnings as errors
172
180
  ```
173
181
 
174
- **Connection Testing** (legacy behavior):
182
+ **What it catches:**
183
+ - Vague or missing tool descriptions
184
+ - Parameters without descriptions (LLMs guess wrong)
185
+ - Overlapping tools that confuse model selection
186
+ - Schema mismatches between chained tools
187
+ - Circular dependencies
175
188
 
176
- ```bash
177
- syrin test --connection
178
- ```
189
+ ---
190
+
191
+ ### `syrin dev` — See What Your LLM Actually Does
179
192
 
180
- ### Protocol and Configuration Validation
193
+ **The Problem:** Your LLM calls tools, but you can't see *why* it chose that tool, what parameters it's sending, or what happens between steps. You're debugging blind.
181
194
 
182
- Before running anything, Syrin validates assumptions.
195
+ **The Solution:** An interactive environment where you see every tool proposal before it executes.
183
196
 
184
197
  ```bash
185
- syrin doctor
186
- syrin test --connection # Test MCP connection only
198
+ syrin dev # Preview mode (no execution)
199
+ syrin dev --exec # Enable execution when ready
187
200
  ```
188
201
 
189
- These commands ensure:
190
-
191
- - Configuration is valid
192
- - Environment variables are set
193
- - MCP protocol is followed correctly
202
+ **What you get:**
203
+ - See exactly which tool the LLM wants to call and why
204
+ - Inspect parameters before they're sent
205
+ - Step through tool chains one call at a time
206
+ - Full event trace of every decision
194
207
 
195
208
  ---
196
209
 
197
- ## Typical Workflow
210
+ ### `syrin test` — Validate Tools in Isolation
211
+
212
+ **The Problem:** A tool works fine in manual testing, but in production it has side effects you didn't expect, returns massive outputs that blow your context window, or behaves differently on repeated calls.
213
+
214
+ **The Solution:** Sandboxed execution that validates each tool against its behavioral contract.
198
215
 
199
216
  ```bash
200
- syrin init # Initialise configuration
201
- syrin doctor # Validate setup
202
- syrin analyse # Static analysis of tool contracts
203
- syrin test # Validate tool contracts (sandboxed execution)
204
- syrin test --connection # Test MCP protocol connection
205
- syrin dev # Inspect behaviour interactively
217
+ syrin test # Test all tools
218
+ syrin test --tool fetch_user # Test specific tool
219
+ syrin test --strict # Warnings become errors
220
+ syrin test --json # JSON output for CI
206
221
  ```
207
222
 
208
- This workflow is designed to catch issues **before production**.
223
+ **What it catches:**
224
+ - Unexpected side effects (file writes, network calls)
225
+ - Non-deterministic outputs
226
+ - Output size explosions
227
+ - Hidden dependencies on external state
228
+ - Contract violations
209
229
 
210
230
  ---
211
231
 
212
- ## Commands Overview
232
+ ### `syrin doctor` — Validate Your Setup
213
233
 
214
- | Command | Purpose |
215
- | ------------------------- | --------------------------------------------- |
216
- | `syrin init` | Initialise a Syrin project |
217
- | `syrin doctor` | Validate configuration and environment |
218
- | `syrin analyse` | Static analysis of MCP tool contracts |
219
- | `syrin test` | Validate tool contracts (sandboxed execution) |
220
- | `syrin test --connection` | Test MCP protocol connection (legacy) |
221
- | `syrin list` | Inspect tools, resources, and prompts |
222
- | `syrin dev` | Interactive execution inspection |
234
+ **The Problem:** Something's misconfigured, but you're not sure what. API keys? Transport settings? MCP connection?
223
235
 
224
- Full documentation: [https://docs.syrin.dev/commands](https://docs.syrin.dev/commands)
236
+ **The Solution:** A single command that checks everything.
237
+
238
+ ```bash
239
+ syrin doctor # Check config, env, connections
240
+ syrin test --connection # Test MCP connection only
241
+ ```
225
242
 
226
243
  ---
227
244
 
228
- ## Tool Contracts (v1.3.0)
245
+ ## Tool Contracts
229
246
 
230
247
  Define behavioral guarantees for your tools in `tools/<tool-name>.yaml` files:
231
248
 
@@ -246,17 +263,12 @@ See [Tool Contracts Documentation](./docs/tool-contracts.md) for details.
246
263
 
247
264
  ## Configuration
248
265
 
249
- Syrin uses a single configuration file:
266
+ Syrin supports **two configuration layers**:
250
267
 
251
- ```bash
252
- syrin.yaml
253
- ```
268
+ - **Local** (`syrin.yaml` in project root) — transport, MCP connection, LLM providers
269
+ - **Global** (`~/.syrin/syrin.yaml`) — shared LLM API keys and defaults across projects
254
270
 
255
- This file defines:
256
-
257
- - Transport type (`stdio` or `http`)
258
- - MCP server connection
259
- - Allowed LLM providers
271
+ Local config overrides global config. CLI flags override both.
260
272
 
261
273
  Configuration reference: [https://docs.syrin.dev/configuration](https://docs.syrin.dev/configuration)
262
274
 
@@ -286,17 +298,37 @@ Provider configuration: [https://docs.syrin.dev/configuration/llm](https://docs.
286
298
 
287
299
  ---
288
300
 
301
+ ## Community
302
+
303
+ - [Discord](https://discord.gg/j8GUvHybSa) — Ask questions, share feedback
304
+ - [GitHub Discussions](https://github.com/Syrin-Labs/cli/discussions) — Feature ideas, show & tell
305
+ - [Documentation](https://docs.syrin.dev) — Full guides and API reference
306
+
307
+ Found a bug or have a feature request? [Open an issue](https://github.com/Syrin-Labs/cli/issues) — we read every one.
308
+
309
+ If Syrin helped you catch something your logs missed, a [star on GitHub](https://github.com/Syrin-Labs/cli) helps others find it too.
310
+
311
+ ---
312
+
289
313
  ## Links
290
314
 
291
315
  - Documentation: [https://docs.syrin.dev](https://docs.syrin.dev)
292
- - GitHub: [https://github.com/syrin-labs/cli](https://github.com/syrin-labs/cli)
293
- - Issues: [https://github.com/syrin-labs/cli/issues](https://github.com/syrin-labs/cli/issues)
316
+ - GitHub: [https://github.com/Syrin-Labs/cli](https://github.com/Syrin-Labs/cli)
317
+ - Issues: [https://github.com/Syrin-Labs/cli/issues](https://github.com/Syrin-Labs/cli/issues)
294
318
  - npm: [https://www.npmjs.com/package/@syrin/cli](https://www.npmjs.com/package/@syrin/cli)
295
319
 
296
320
  ---
297
321
 
322
+ ## Contributing
323
+
324
+ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md) before submitting PRs.
325
+
326
+ For security issues, please see our [Security Policy](SECURITY.md).
327
+
328
+ ---
329
+
298
330
  ## License
299
331
 
300
- ISC License. See LICENSE for details.
332
+ ISC License. See [LICENSE](LICENSE) for details.
301
333
 
302
- Made with ❤️ by **Syrin Labs**.
334
+ Made with care by **Syrin Labs**.
@@ -0,0 +1,47 @@
1
+ /**
2
+ * `syrin config` command implementation.
3
+ * Manages both local and global Syrin configurations.
4
+ */
5
+ export interface ConfigCommandOptions {
6
+ /** Operate on global config */
7
+ global?: boolean;
8
+ /** Operate on local config */
9
+ local?: boolean;
10
+ /** Key to get/set (e.g., "openai.model", "agent_name") */
11
+ key?: string;
12
+ /** Value to set */
13
+ value?: string;
14
+ }
15
+ /**
16
+ * Execute config set command.
17
+ */
18
+ export declare function executeConfigSet(key: string, value: string, options?: ConfigCommandOptions, projectRoot?: string): Promise<void>;
19
+ /**
20
+ * Execute config get command.
21
+ */
22
+ export declare function executeConfigGet(key: string, options?: ConfigCommandOptions, projectRoot?: string): Promise<void>;
23
+ /**
24
+ * Execute config list command.
25
+ */
26
+ export declare function executeConfigList(options?: ConfigCommandOptions, projectRoot?: string): Promise<void>;
27
+ /**
28
+ * Execute config show command (same as list for now).
29
+ */
30
+ export declare function executeConfigShow(options?: ConfigCommandOptions, projectRoot?: string): Promise<void>;
31
+ /**
32
+ * Execute config edit command.
33
+ */
34
+ export declare function executeConfigEdit(options?: ConfigCommandOptions, projectRoot?: string): Promise<void>;
35
+ /**
36
+ * Execute config edit-env command.
37
+ */
38
+ export declare function executeConfigEditEnv(options?: ConfigCommandOptions, projectRoot?: string): Promise<void>;
39
+ /**
40
+ * Execute config set-default command.
41
+ */
42
+ export declare function executeConfigSetDefault(provider: string, options?: ConfigCommandOptions, projectRoot?: string): Promise<void>;
43
+ /**
44
+ * Execute config remove command.
45
+ */
46
+ export declare function executeConfigRemove(provider: string, options?: ConfigCommandOptions, projectRoot?: string): Promise<void>;
47
+ //# sourceMappingURL=config.d.ts.map