language-operator 0.1.61 → 0.1.62

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 (143) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/commands/persona.md +9 -0
  3. data/.claude/commands/task.md +46 -1
  4. data/.rubocop.yml +13 -0
  5. data/.rubocop_custom/use_ux_helper.rb +44 -0
  6. data/CHANGELOG.md +8 -0
  7. data/Gemfile.lock +12 -1
  8. data/Makefile +26 -7
  9. data/Makefile.common +50 -0
  10. data/bin/aictl +8 -1
  11. data/components/agent/Gemfile +1 -1
  12. data/components/agent/bin/langop-agent +7 -0
  13. data/docs/README.md +58 -0
  14. data/docs/{dsl/best-practices.md → best-practices.md} +4 -4
  15. data/docs/cli-reference.md +274 -0
  16. data/docs/{dsl/constraints.md → constraints.md} +5 -5
  17. data/docs/how-agents-work.md +156 -0
  18. data/docs/installation.md +218 -0
  19. data/docs/quickstart.md +299 -0
  20. data/docs/understanding-generated-code.md +265 -0
  21. data/docs/using-tools.md +457 -0
  22. data/docs/webhooks.md +509 -0
  23. data/examples/ux_helpers_demo.rb +296 -0
  24. data/lib/language_operator/agent/base.rb +11 -1
  25. data/lib/language_operator/agent/executor.rb +23 -6
  26. data/lib/language_operator/agent/safety/safe_executor.rb +41 -39
  27. data/lib/language_operator/agent/task_executor.rb +346 -63
  28. data/lib/language_operator/agent/web_server.rb +110 -14
  29. data/lib/language_operator/agent/webhook_authenticator.rb +39 -5
  30. data/lib/language_operator/agent.rb +88 -2
  31. data/lib/language_operator/cli/base_command.rb +17 -11
  32. data/lib/language_operator/cli/command_loader.rb +72 -0
  33. data/lib/language_operator/cli/commands/agent/base.rb +837 -0
  34. data/lib/language_operator/cli/commands/agent/code_operations.rb +102 -0
  35. data/lib/language_operator/cli/commands/agent/helpers/cluster_llm_client.rb +116 -0
  36. data/lib/language_operator/cli/commands/agent/helpers/code_parser.rb +115 -0
  37. data/lib/language_operator/cli/commands/agent/helpers/synthesis_watcher.rb +96 -0
  38. data/lib/language_operator/cli/commands/agent/learning.rb +289 -0
  39. data/lib/language_operator/cli/commands/agent/lifecycle.rb +102 -0
  40. data/lib/language_operator/cli/commands/agent/logs.rb +125 -0
  41. data/lib/language_operator/cli/commands/agent/workspace.rb +327 -0
  42. data/lib/language_operator/cli/commands/cluster.rb +129 -84
  43. data/lib/language_operator/cli/commands/install.rb +1 -1
  44. data/lib/language_operator/cli/commands/model/base.rb +215 -0
  45. data/lib/language_operator/cli/commands/model/test.rb +165 -0
  46. data/lib/language_operator/cli/commands/persona.rb +16 -34
  47. data/lib/language_operator/cli/commands/quickstart.rb +3 -2
  48. data/lib/language_operator/cli/commands/status.rb +40 -67
  49. data/lib/language_operator/cli/commands/system/base.rb +44 -0
  50. data/lib/language_operator/cli/commands/system/exec.rb +147 -0
  51. data/lib/language_operator/cli/commands/system/helpers/llm_synthesis.rb +183 -0
  52. data/lib/language_operator/cli/commands/system/helpers/pod_manager.rb +212 -0
  53. data/lib/language_operator/cli/commands/system/helpers/template_loader.rb +57 -0
  54. data/lib/language_operator/cli/commands/system/helpers/template_validator.rb +174 -0
  55. data/lib/language_operator/cli/commands/system/schema.rb +92 -0
  56. data/lib/language_operator/cli/commands/system/synthesis_template.rb +151 -0
  57. data/lib/language_operator/cli/commands/system/synthesize.rb +224 -0
  58. data/lib/language_operator/cli/commands/system/validate_template.rb +130 -0
  59. data/lib/language_operator/cli/commands/tool/base.rb +271 -0
  60. data/lib/language_operator/cli/commands/tool/install.rb +255 -0
  61. data/lib/language_operator/cli/commands/tool/search.rb +69 -0
  62. data/lib/language_operator/cli/commands/tool/test.rb +115 -0
  63. data/lib/language_operator/cli/commands/use.rb +29 -6
  64. data/lib/language_operator/cli/errors/handler.rb +20 -17
  65. data/lib/language_operator/cli/errors/suggestions.rb +3 -5
  66. data/lib/language_operator/cli/errors/thor_errors.rb +55 -0
  67. data/lib/language_operator/cli/formatters/code_formatter.rb +4 -11
  68. data/lib/language_operator/cli/formatters/log_formatter.rb +8 -15
  69. data/lib/language_operator/cli/formatters/progress_formatter.rb +6 -8
  70. data/lib/language_operator/cli/formatters/status_formatter.rb +26 -7
  71. data/lib/language_operator/cli/formatters/table_formatter.rb +47 -36
  72. data/lib/language_operator/cli/formatters/value_formatter.rb +75 -0
  73. data/lib/language_operator/cli/helpers/cluster_context.rb +5 -3
  74. data/lib/language_operator/cli/helpers/kubeconfig_validator.rb +2 -1
  75. data/lib/language_operator/cli/helpers/label_utils.rb +97 -0
  76. data/lib/language_operator/{ux/concerns/provider_helpers.rb → cli/helpers/provider_helper.rb} +10 -29
  77. data/lib/language_operator/cli/helpers/schedule_builder.rb +21 -1
  78. data/lib/language_operator/cli/helpers/user_prompts.rb +19 -11
  79. data/lib/language_operator/cli/helpers/ux_helper.rb +538 -0
  80. data/lib/language_operator/{ux/concerns/input_validation.rb → cli/helpers/validation_helper.rb} +13 -66
  81. data/lib/language_operator/cli/main.rb +50 -40
  82. data/lib/language_operator/cli/templates/tools/generic.yaml +3 -0
  83. data/lib/language_operator/cli/wizards/agent_wizard.rb +12 -20
  84. data/lib/language_operator/cli/wizards/model_wizard.rb +271 -0
  85. data/lib/language_operator/cli/wizards/quickstart_wizard.rb +8 -34
  86. data/lib/language_operator/client/base.rb +28 -0
  87. data/lib/language_operator/client/config.rb +4 -1
  88. data/lib/language_operator/client/mcp_connector.rb +1 -1
  89. data/lib/language_operator/config/cluster_config.rb +3 -2
  90. data/lib/language_operator/config.rb +38 -11
  91. data/lib/language_operator/constants/kubernetes_labels.rb +80 -0
  92. data/lib/language_operator/constants.rb +13 -0
  93. data/lib/language_operator/dsl/http.rb +127 -10
  94. data/lib/language_operator/dsl.rb +153 -6
  95. data/lib/language_operator/errors.rb +50 -0
  96. data/lib/language_operator/kubernetes/client.rb +11 -6
  97. data/lib/language_operator/kubernetes/resource_builder.rb +58 -84
  98. data/lib/language_operator/templates/schema/agent_dsl_openapi.yaml +1 -1
  99. data/lib/language_operator/templates/schema/agent_dsl_schema.json +1 -1
  100. data/lib/language_operator/type_coercion.rb +118 -34
  101. data/lib/language_operator/utils/secure_path.rb +74 -0
  102. data/lib/language_operator/utils.rb +7 -0
  103. data/lib/language_operator/validators.rb +54 -2
  104. data/lib/language_operator/version.rb +1 -1
  105. data/synth/001/Makefile +10 -2
  106. data/synth/001/agent.rb +16 -15
  107. data/synth/001/output.log +27 -10
  108. data/synth/002/Makefile +10 -2
  109. data/synth/003/Makefile +1 -1
  110. data/synth/003/README.md +205 -133
  111. data/synth/003/agent.optimized.rb +66 -0
  112. data/synth/003/agent.synthesized.rb +41 -0
  113. metadata +111 -35
  114. data/docs/dsl/agent-reference.md +0 -604
  115. data/docs/dsl/mcp-integration.md +0 -1177
  116. data/docs/dsl/webhooks.md +0 -932
  117. data/docs/dsl/workflows.md +0 -744
  118. data/lib/language_operator/cli/commands/agent.rb +0 -1712
  119. data/lib/language_operator/cli/commands/model.rb +0 -366
  120. data/lib/language_operator/cli/commands/system.rb +0 -1259
  121. data/lib/language_operator/cli/commands/tool.rb +0 -654
  122. data/lib/language_operator/cli/formatters/optimization_formatter.rb +0 -226
  123. data/lib/language_operator/cli/helpers/pastel_helper.rb +0 -24
  124. data/lib/language_operator/learning/adapters/base_adapter.rb +0 -149
  125. data/lib/language_operator/learning/adapters/jaeger_adapter.rb +0 -221
  126. data/lib/language_operator/learning/adapters/signoz_adapter.rb +0 -435
  127. data/lib/language_operator/learning/adapters/tempo_adapter.rb +0 -239
  128. data/lib/language_operator/learning/optimizer.rb +0 -319
  129. data/lib/language_operator/learning/pattern_detector.rb +0 -260
  130. data/lib/language_operator/learning/task_synthesizer.rb +0 -288
  131. data/lib/language_operator/learning/trace_analyzer.rb +0 -285
  132. data/lib/language_operator/templates/task_synthesis.tmpl +0 -98
  133. data/lib/language_operator/ux/base.rb +0 -81
  134. data/lib/language_operator/ux/concerns/README.md +0 -155
  135. data/lib/language_operator/ux/concerns/headings.rb +0 -90
  136. data/lib/language_operator/ux/create_agent.rb +0 -255
  137. data/lib/language_operator/ux/create_model.rb +0 -267
  138. data/lib/language_operator/ux/quickstart.rb +0 -594
  139. data/synth/003/agent.rb +0 -41
  140. data/synth/003/output.log +0 -68
  141. /data/docs/{architecture/agent-runtime.md → agent-internals.md} +0 -0
  142. /data/docs/{dsl/chat-endpoints.md → chat-endpoints.md} +0 -0
  143. /data/docs/{dsl/SCHEMA_VERSION.md → schema-versioning.md} +0 -0
@@ -0,0 +1,274 @@
1
+ # aictl CLI Reference
2
+
3
+ Complete reference for the `aictl` command-line interface.
4
+
5
+ ## Global Commands
6
+
7
+ ### `aictl status`
8
+ Show system status and overview of the current cluster.
9
+
10
+ ```bash
11
+ aictl status
12
+ ```
13
+
14
+ ### `aictl version`
15
+ Display aictl version and operator installation status.
16
+
17
+ ```bash
18
+ aictl version
19
+ ```
20
+
21
+ ## Cluster Management
22
+
23
+ ### `aictl cluster`
24
+ Manage Kubernetes clusters for Language Operator.
25
+
26
+ ```bash
27
+ # Create a new cluster configuration
28
+ aictl cluster create my-cluster
29
+
30
+ # List configured clusters
31
+ aictl cluster list
32
+
33
+ # Switch active cluster context
34
+ aictl use my-cluster
35
+
36
+ # Remove cluster configuration
37
+ aictl cluster delete my-cluster
38
+ ```
39
+
40
+ ## Agent Management
41
+
42
+ ### `aictl agent`
43
+ Create, deploy, and manage agents.
44
+
45
+ ```bash
46
+ # Create a new agent
47
+ aictl agent create my-agent
48
+
49
+ # List agents in current cluster
50
+ aictl agent list
51
+
52
+ # Get detailed agent information
53
+ aictl agent inspect my-agent
54
+
55
+ # View agent logs
56
+ aictl agent logs my-agent
57
+
58
+ # Delete an agent
59
+ aictl agent delete my-agent
60
+
61
+ # Work with agent code
62
+ aictl agent workspace my-agent
63
+ ```
64
+
65
+ ## Model Management
66
+
67
+ ### `aictl model`
68
+ Manage language models in the cluster.
69
+
70
+ ```bash
71
+ # Create a new model resource
72
+ aictl model create
73
+
74
+ # List available models
75
+ aictl model list
76
+
77
+ # Test model connectivity
78
+ aictl model test my-model
79
+ ```
80
+
81
+ ## Persona Management
82
+
83
+ ### `aictl persona`
84
+ Manage agent personas and system prompts.
85
+
86
+ ```bash
87
+ # Create a new persona
88
+ aictl persona create
89
+
90
+ # List available personas
91
+ aictl persona list
92
+
93
+ # View persona details
94
+ aictl persona inspect my-persona
95
+
96
+ # Delete a persona
97
+ aictl persona delete my-persona
98
+ ```
99
+
100
+ ## Tool Management
101
+
102
+ ### `aictl tool`
103
+ Manage MCP tool servers.
104
+
105
+ ```bash
106
+ # Deploy a tool server
107
+ aictl tool deploy ./my-tool
108
+
109
+ # List tool deployments
110
+ aictl tool list
111
+
112
+ # Test tool connectivity
113
+ aictl tool test my-tool
114
+
115
+ # View tool logs
116
+ aictl tool logs my-tool
117
+
118
+ # Search for tools
119
+ aictl tool search database
120
+
121
+ # Install a tool from registry
122
+ aictl tool install calculator
123
+ ```
124
+
125
+ ## System Utilities
126
+
127
+ ### `aictl system`
128
+ System-level operations and utilities.
129
+
130
+ ```bash
131
+ # Validate system templates
132
+ aictl system validate-template
133
+
134
+ # Work with synthesis templates
135
+ aictl system synthesis-template
136
+
137
+ # Synthesize agent code
138
+ aictl system synthesize
139
+
140
+ # Execute system commands
141
+ aictl system exec
142
+ ```
143
+
144
+ ## Setup and Installation
145
+
146
+ ### `aictl quickstart`
147
+ Interactive wizard for first-time setup.
148
+
149
+ ```bash
150
+ aictl quickstart
151
+ ```
152
+
153
+ ### `aictl install`
154
+ Install Language Operator to a Kubernetes cluster.
155
+
156
+ ```bash
157
+ aictl install
158
+ ```
159
+
160
+ ### `aictl upgrade`
161
+ Upgrade Language Operator installation.
162
+
163
+ ```bash
164
+ aictl upgrade
165
+ ```
166
+
167
+ ### `aictl uninstall`
168
+ Remove Language Operator from cluster.
169
+
170
+ ```bash
171
+ aictl uninstall
172
+ ```
173
+
174
+ ## Shell Completion
175
+
176
+ ### `aictl completion`
177
+ Install shell completion for aictl.
178
+
179
+ ```bash
180
+ # Bash completion
181
+ aictl completion bash
182
+
183
+ # Zsh completion
184
+ aictl completion zsh
185
+
186
+ # Fish completion
187
+ aictl completion fish
188
+ ```
189
+
190
+ To install completion:
191
+
192
+ ```bash
193
+ # Bash (add to ~/.bashrc)
194
+ eval "$(aictl completion bash)"
195
+
196
+ # Zsh (add to ~/.zshrc)
197
+ eval "$(aictl completion zsh)"
198
+
199
+ # Fish
200
+ aictl completion fish | source
201
+ ```
202
+
203
+ ## Common Workflows
204
+
205
+ ### Creating Your First Agent
206
+
207
+ ```bash
208
+ # 1. Set up cluster
209
+ aictl quickstart
210
+
211
+ # 2. Create an agent
212
+ aictl agent create my-agent
213
+
214
+ # 3. Check status
215
+ aictl agent list
216
+ aictl agent inspect my-agent
217
+
218
+ # 4. View logs
219
+ aictl agent logs my-agent -f
220
+ ```
221
+
222
+ ### Working with Models
223
+
224
+ ```bash
225
+ # 1. Create a model
226
+ aictl model create
227
+
228
+ # 2. Test connectivity
229
+ aictl model test my-model
230
+
231
+ # 3. List models
232
+ aictl model list
233
+ ```
234
+
235
+ ### Tool Server Development
236
+
237
+ ```bash
238
+ # 1. Deploy your tool
239
+ aictl tool deploy ./my-custom-tools
240
+
241
+ # 2. Test tool functionality
242
+ aictl tool test my-custom-tools
243
+
244
+ # 3. Monitor logs
245
+ aictl tool logs my-custom-tools -f
246
+ ```
247
+
248
+ ## Environment Variables
249
+
250
+ aictl respects these environment variables:
251
+
252
+ - `KUBECONFIG` - Path to Kubernetes config file
253
+ - `AICTL_CLUSTER` - Default cluster name
254
+ - `AICTL_LOG_LEVEL` - Log level (debug, info, warn, error)
255
+ - `NO_COLOR` - Disable colored output
256
+
257
+ ## Exit Codes
258
+
259
+ - `0` - Success
260
+ - `1` - General error
261
+ - `2` - Configuration error
262
+ - `3` - Connection error
263
+ - `4` - Resource not found
264
+ - `5` - Permission denied
265
+
266
+ ## Getting Help
267
+
268
+ All commands support the `--help` flag for detailed usage:
269
+
270
+ ```bash
271
+ aictl --help
272
+ aictl agent --help
273
+ aictl agent create --help
274
+ ```
@@ -1,6 +1,6 @@
1
- # Constraints Reference
1
+ # Agent Constraints Reference
2
2
 
3
- Complete reference for configuring agent constraints in the Language Operator DSL.
3
+ Complete reference for configuring agent constraints to control behavior, resource usage, and costs.
4
4
 
5
5
  ## Table of Contents
6
6
 
@@ -665,7 +665,7 @@ end
665
665
 
666
666
  ## See Also
667
667
 
668
- - [Agent Reference](agent-reference.md) - Complete agent DSL reference
669
- - [Workflows](workflows.md) - Workflow definition guide
670
- - [Best Practices](best-practices.md) - Production deployment patterns
668
+ - [Understanding Generated Code](understanding-generated-code.md) - Working with agent definitions
669
+ - [Best Practices](best-practices.md) - Production deployment patterns
671
670
  - [Webhooks](webhooks.md) - Reactive agent configuration
671
+ - [CLI Reference](cli-reference.md) - Managing constraints via CLI
@@ -0,0 +1,156 @@
1
+ # How Agents Work
2
+
3
+ Language Operator transforms your natural language descriptions into working AI agents through a process called synthesis. This guide explains what happens when you create an agent.
4
+
5
+ ## The Agent Creation Process
6
+
7
+ ### 1. You Describe What You Want
8
+
9
+ ```bash
10
+ aictl agent create daily-report
11
+ # Interactive wizard asks:
12
+ # - What should this agent do?
13
+ # - When should it run?
14
+ # - What tools does it need?
15
+ ```
16
+
17
+ You describe your agent in plain English:
18
+ - "Generate a daily sales report from our database"
19
+ - "Respond to GitHub pull request webhooks with code reviews"
20
+ - "Monitor our API and alert on errors"
21
+
22
+ ### 2. Language Operator Synthesizes Code
23
+
24
+ Behind the scenes, Language Operator creates a complete agent definition that includes:
25
+ - **Tasks** - Individual work units with clear input/output contracts
26
+ - **Main logic** - The execution flow that coordinates tasks
27
+ - **Configuration** - Scheduling, constraints, and resource limits
28
+
29
+ ### 3. Your Agent Runs and Learns
30
+
31
+ Initially, your agent uses AI to figure out how to accomplish tasks. Over time, it learns patterns and generates optimized code automatically.
32
+
33
+ ## Agent Structure
34
+
35
+ When Language Operator synthesizes an agent, it creates code structured like this:
36
+
37
+ ### Tasks (Work Units)
38
+
39
+ Each task has a clear contract defining what data goes in and what comes out:
40
+
41
+ ```ruby
42
+ # A task that fetches sales data
43
+ task :fetch_sales_data,
44
+ instructions: "get yesterday's sales from the database",
45
+ inputs: {},
46
+ outputs: { sales: 'array', total: 'number' }
47
+ ```
48
+
49
+ ### Main Logic (Coordination)
50
+
51
+ The main block coordinates tasks and handles the overall flow:
52
+
53
+ ```ruby
54
+ main do |inputs|
55
+ # Get the data
56
+ sales = execute_task(:fetch_sales_data)
57
+
58
+ # Generate the report
59
+ report = execute_task(:generate_report, inputs: sales)
60
+
61
+ # Return the result
62
+ report
63
+ end
64
+ ```
65
+
66
+ ### Output Handling
67
+
68
+ Defines what happens with the results:
69
+
70
+ ```ruby
71
+ output do |outputs|
72
+ # Send the report via email
73
+ execute_tool('email', 'send', {
74
+ to: 'team@company.com',
75
+ subject: 'Daily Sales Report',
76
+ body: outputs[:report]
77
+ })
78
+ end
79
+ ```
80
+
81
+ ## How Tasks Execute
82
+
83
+ ### Neural Tasks (AI-Powered)
84
+
85
+ Initially, tasks use AI to figure out what to do:
86
+
87
+ ```ruby
88
+ task :analyze_data,
89
+ instructions: "identify trends and anomalies in the sales data",
90
+ inputs: { data: 'array' },
91
+ outputs: { trends: 'array', anomalies: 'array' }
92
+
93
+ # Language Operator uses AI to:
94
+ # 1. Understand the instruction
95
+ # 2. Call appropriate tools
96
+ # 3. Process the results
97
+ # 4. Return data matching the output schema
98
+ ```
99
+
100
+ ### Symbolic Tasks (Optimized Code)
101
+
102
+ Over time, agents learn patterns and generate optimized code:
103
+
104
+ ```ruby
105
+ task :analyze_data,
106
+ inputs: { data: 'array' },
107
+ outputs: { trends: 'array', anomalies: 'array' }
108
+ do |inputs|
109
+ # Generated code based on learned patterns
110
+ trends = inputs[:data].group_by { |item| item[:category] }
111
+ .map { |cat, items| { category: cat, total: items.sum { |i| i[:amount] } } }
112
+
113
+ anomalies = inputs[:data].select { |item| item[:amount] > 10000 }
114
+
115
+ { trends: trends, anomalies: anomalies }
116
+ end
117
+ ```
118
+
119
+ ## Agent Lifecycle
120
+
121
+ ### Phase 1: Initial Synthesis
122
+ - You describe what you want
123
+ - Language Operator creates a working agent
124
+ - All tasks start as neural (AI-powered)
125
+
126
+ ### Phase 2: Learning
127
+ - Agent runs and accomplishes tasks using AI
128
+ - Language Operator observes patterns in how tasks execute
129
+ - System identifies opportunities for optimization
130
+
131
+ ### Phase 3: Optimization
132
+ - Frequently-used patterns become optimized code
133
+ - AI tasks gradually become efficient symbolic code
134
+ - Performance improves and costs decrease
135
+
136
+ ### Phase 4: Continuous Improvement
137
+ - Agent continues learning new patterns automatically
138
+ - System continuously adapts to changing requirements
139
+ - Optimization happens transparently in the background
140
+
141
+ ## Key Benefits
142
+
143
+ **Immediate Functionality**: Your agent works right away, even for complex tasks
144
+
145
+ **Automatic Optimization**: No manual performance tuning required
146
+
147
+ **Cost Reduction**: AI usage decreases as agents learn efficient patterns
148
+
149
+ **Reliability**: Learned patterns are more predictable than AI inference
150
+
151
+ **Adaptability**: Agents can learn new patterns as requirements change
152
+
153
+ ## Next Steps
154
+
155
+ - **[Understanding Generated Code](understanding-generated-code.md)** - Learn to read synthesized agents
156
+ - **[Using Tools](using-tools.md)** - How agents interact with external services
@@ -0,0 +1,218 @@
1
+ # Installation Guide
2
+
3
+ Get started with Language Operator by installing the CLI and setting up your first cluster.
4
+
5
+ ## Prerequisites
6
+
7
+ - Ruby >= 3.2.0
8
+ - Kubernetes cluster (local or remote)
9
+ - `kubectl` configured with cluster access
10
+
11
+ ## Install the CLI
12
+
13
+ ### Using RubyGems
14
+
15
+ ```bash
16
+ gem install language-operator
17
+ ```
18
+
19
+ ### Verify Installation
20
+
21
+ ```bash
22
+ aictl version
23
+ ```
24
+
25
+ You should see the aictl version and operator status information.
26
+
27
+ ## Initial Setup
28
+
29
+ ### 1. Check System Status
30
+
31
+ ```bash
32
+ aictl status
33
+ ```
34
+
35
+ This command shows:
36
+ - CLI version
37
+ - Kubernetes connectivity
38
+ - Language Operator installation status
39
+
40
+ ### 2. Run Quickstart Wizard
41
+
42
+ For first-time users, the quickstart wizard guides you through setup:
43
+
44
+ ```bash
45
+ aictl quickstart
46
+ ```
47
+
48
+ The wizard will:
49
+ - Configure your first cluster
50
+ - Install Language Operator to Kubernetes
51
+ - Set up basic models and personas
52
+ - Create a sample agent
53
+
54
+ ### 3. Manual Setup (Alternative)
55
+
56
+ If you prefer manual configuration:
57
+
58
+ ```bash
59
+ # Create cluster configuration
60
+ aictl cluster create my-cluster
61
+
62
+ # Switch to the cluster
63
+ aictl use my-cluster
64
+
65
+ # Install Language Operator
66
+ aictl install
67
+
68
+ # Verify installation
69
+ aictl status
70
+ ```
71
+
72
+ ## Kubernetes Setup
73
+
74
+ ### Local Development (minikube/kind)
75
+
76
+ ```bash
77
+ # Start minikube
78
+ minikube start
79
+
80
+ # Or start kind cluster
81
+ kind create cluster --name language-operator
82
+
83
+ # Configure aictl
84
+ aictl cluster create local --kubeconfig ~/.kube/config
85
+ aictl use local
86
+ ```
87
+
88
+ ### Production Clusters
89
+
90
+ ```bash
91
+ # Configure cluster with specific context
92
+ aictl cluster create production \
93
+ --kubeconfig /path/to/kubeconfig \
94
+ --context production-context
95
+
96
+ aictl use production
97
+ ```
98
+
99
+ ## Model Configuration
100
+
101
+ Language Operator requires language model access. Configure your preferred provider:
102
+
103
+ ### OpenAI
104
+
105
+ ```bash
106
+ export OPENAI_API_KEY="sk-your-api-key"
107
+ aictl model create openai-gpt4 --provider openai --model gpt-4-turbo
108
+ ```
109
+
110
+ ### Anthropic (Claude)
111
+
112
+ ```bash
113
+ export ANTHROPIC_API_KEY="sk-your-api-key"
114
+ aictl model create claude-sonnet --provider anthropic --model claude-3-sonnet
115
+ ```
116
+
117
+ ### Local Models (Ollama)
118
+
119
+ ```bash
120
+ # Start Ollama locally
121
+ ollama serve
122
+
123
+ # Configure local model
124
+ aictl model create local-llama --provider ollama --model llama3
125
+ ```
126
+
127
+ ## Verification
128
+
129
+ ### Test Your Setup
130
+
131
+ ```bash
132
+ # Check overall status
133
+ aictl status
134
+
135
+ # List models
136
+ aictl model list
137
+
138
+ # Create a test agent
139
+ aictl agent create test-agent
140
+
141
+ # View agent status
142
+ aictl agent list
143
+ aictl agent inspect test-agent
144
+ ```
145
+
146
+ ### Sample Output
147
+
148
+ ```bash
149
+ $ aictl status
150
+
151
+ Language Operator Status
152
+ ========================
153
+
154
+ CLI Version: 0.1.30
155
+ Cluster: my-cluster (✓ connected)
156
+ Operator: v0.1.30 (✓ installed)
157
+ Models: 2 configured
158
+ Agents: 1 running
159
+
160
+ ✓ System ready
161
+ ```
162
+
163
+ ## Shell Completion (Optional)
164
+
165
+ Enable command completion for better CLI experience:
166
+
167
+ ### Bash
168
+
169
+ ```bash
170
+ echo 'eval "$(aictl completion bash)"' >> ~/.bashrc
171
+ source ~/.bashrc
172
+ ```
173
+
174
+ ### Zsh
175
+
176
+ ```bash
177
+ echo 'eval "$(aictl completion zsh)"' >> ~/.zshrc
178
+ source ~/.zshrc
179
+ ```
180
+
181
+ ### Fish
182
+
183
+ ```bash
184
+ aictl completion fish | source
185
+ ```
186
+
187
+ ## Troubleshooting
188
+
189
+ ### Common Issues
190
+
191
+ **Command not found: aictl**
192
+ - Ensure Ruby gem bin directory is in PATH
193
+ - Run `gem env` to check installation paths
194
+
195
+ **Cannot connect to Kubernetes**
196
+ - Verify `kubectl` works: `kubectl get nodes`
197
+ - Check kubeconfig: `echo $KUBECONFIG`
198
+ - Ensure cluster context is correct
199
+
200
+ **Language Operator not found**
201
+ - Run `aictl install` to install to current cluster
202
+ - Check installation: `kubectl get pods -n language-operator`
203
+
204
+ **Model configuration issues**
205
+ - Verify API keys are set correctly
206
+ - Test model connectivity: `aictl model test my-model`
207
+
208
+ ### Getting Help
209
+
210
+ - Check command help: `aictl --help`
211
+ - View logs: `aictl agent logs my-agent`
212
+ - Report issues: [GitHub Issues](https://github.com/language-operator/language-operator-gem/issues)
213
+
214
+ ## Next Steps
215
+
216
+ - **[Quickstart Guide](quickstart.md)** - Create your first agent
217
+ - **[How Agents Work](how-agents-work.md)** - Understand the synthesis process
218
+ - **[CLI Reference](cli-reference.md)** - Complete command documentation