cliara 0.4.2__tar.gz → 0.4.4__tar.gz
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.
- cliara-0.4.4/PKG-INFO +263 -0
- cliara-0.4.4/README.md +221 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/__init__.py +1 -1
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/__init__.py +7 -1
- cliara-0.4.4/cliara/agents/chat_polish.py +8 -0
- cliara-0.4.4/cliara/agents/prompts/chat_polish.txt +9 -0
- cliara-0.4.4/cliara/agents/prompts/commit_message.txt +28 -0
- cliara-0.4.4/cliara/agents/prompts/readme.txt +13 -0
- cliara-0.4.4/cliara/agents/prompts/session_reflect.txt +25 -0
- cliara-0.4.4/cliara/agents/readme_generator.py +8 -0
- cliara-0.4.4/cliara/agents/session_reflect.py +8 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/auth.py +40 -3
- cliara-0.4.4/cliara/chat_export.py +182 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/config.py +33 -10
- cliara-0.4.4/cliara/console.py +57 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/copilot_gate.py +22 -13
- cliara-0.4.4/cliara/file_lock.py +36 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/highlighting.py +46 -25
- {cliara-0.4.2 → cliara-0.4.4}/cliara/main.py +327 -174
- {cliara-0.4.2 → cliara-0.4.4}/cliara/nl_handler.py +163 -11
- cliara-0.4.4/cliara/readme_context.py +422 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/semantic_history.py +9 -5
- {cliara-0.4.2 → cliara-0.4.4}/cliara/session_store.py +463 -327
- {cliara-0.4.2 → cliara-0.4.4}/cliara/setup_ollama.py +143 -18
- {cliara-0.4.2 → cliara-0.4.4}/cliara/setup_wizard.py +179 -45
- {cliara-0.4.2 → cliara-0.4.4}/cliara/shell.py +6011 -5426
- {cliara-0.4.2 → cliara-0.4.4}/cliara/storage/json_backend.py +12 -8
- {cliara-0.4.2 → cliara-0.4.4}/cliara/tools/migrate.py +1 -1
- cliara-0.4.4/cliara.egg-info/PKG-INFO +263 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara.egg-info/SOURCES.txt +11 -1
- {cliara-0.4.2 → cliara-0.4.4}/cliara.egg-info/requires.txt +1 -0
- {cliara-0.4.2 → cliara-0.4.4}/pyproject.toml +6 -5
- cliara-0.4.4/tests/test_session_closeout.py +153 -0
- cliara-0.4.2/PKG-INFO +0 -182
- cliara-0.4.2/README.md +0 -141
- cliara-0.4.2/cliara/agents/prompts/commit_message.txt +0 -1
- cliara-0.4.2/cliara/console.py +0 -21
- cliara-0.4.2/cliara.egg-info/PKG-INFO +0 -182
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/commit_and_deploy.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/copilot_explain.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/explain.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/fix.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/history_search.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/history_summary.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/nl_to_commands.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/prompts/copilot_explain.txt +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/prompts/deploy.txt +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/prompts/explain.txt +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/prompts/fix.txt +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/prompts/history_search.txt +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/prompts/history_summary.txt +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/agents/prompts/nl_to_commands.txt +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/cross_platform.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/deploy_detector.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/deploy_store.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/diff_preview.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/execution_graph.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/icons.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/install_logo.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/macros.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/regression.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/safety.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/storage/__init__.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/storage/factory.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/storage/postgres_backend.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara/tools/__init__.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara-cloud/auth_middleware.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara-cloud/main.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara-cloud/proxy.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara-cloud/rate_limit.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara-cloud/settings.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara.egg-info/dependency_links.txt +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara.egg-info/entry_points.txt +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/cliara.egg-info/top_level.txt +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/setup.cfg +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/tests/test_basic.py +0 -0
- {cliara-0.4.2 → cliara-0.4.4}/tests/test_copilot_gate.py +0 -0
cliara-0.4.4/PKG-INFO
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cliara
|
|
3
|
+
Version: 0.4.4
|
|
4
|
+
Summary: An AI-powered shell that understands natural language and macros
|
|
5
|
+
Author: Cliara Contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/HreemPandya/cliara-app
|
|
8
|
+
Project-URL: Documentation, https://github.com/HreemPandya/cliara-app#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/HreemPandya/cliara-app
|
|
10
|
+
Project-URL: Issues, https://github.com/HreemPandya/cliara-app/issues
|
|
11
|
+
Keywords: cli,shell,ai,natural-language,macros,automation
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Topic :: System :: Shells
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
Requires-Dist: prompt-toolkit>=3.0.0
|
|
26
|
+
Requires-Dist: filelock>=3.12.0
|
|
27
|
+
Requires-Dist: pygments>=2.0.0
|
|
28
|
+
Requires-Dist: rich>=13.0.0
|
|
29
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
30
|
+
Requires-Dist: thefuzz>=0.20.0
|
|
31
|
+
Requires-Dist: openai>=1.0.0
|
|
32
|
+
Requires-Dist: httpx<0.28,>=0.25
|
|
33
|
+
Requires-Dist: anthropic>=0.8.0
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
37
|
+
Requires-Dist: flake8>=6.0.0; extra == "dev"
|
|
38
|
+
Provides-Extra: postgres
|
|
39
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgres"
|
|
40
|
+
Provides-Extra: all
|
|
41
|
+
Requires-Dist: cliara[postgres]; extra == "all"
|
|
42
|
+
|
|
43
|
+
# Cliara
|
|
44
|
+
|
|
45
|
+
**An AI-powered shell that understands natural language and macros.**
|
|
46
|
+
|
|
47
|
+
[](https://pypi.org/project/cliara/)
|
|
48
|
+
[](https://pypi.org/project/cliara/)
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## What is Cliara?
|
|
53
|
+
|
|
54
|
+
Cliara wraps your existing shell (bash, zsh, PowerShell, cmd) and adds:
|
|
55
|
+
|
|
56
|
+
| Feature | Description |
|
|
57
|
+
|---------|-------------|
|
|
58
|
+
| **Natural language** | `? <query>` — describe what you want, get shell commands |
|
|
59
|
+
| **Cliara Cloud** | Sign in with GitHub, 150 free queries/month, no API key |
|
|
60
|
+
| **Macros** | Create, edit, run reusable command sequences |
|
|
61
|
+
| **Semantic history** | `? find when I fixed the login` — search past commands by meaning |
|
|
62
|
+
| **Smart push** | `push` — auto-commit message, branch detection, one command |
|
|
63
|
+
| **Smart deploy** | `deploy` — auto-detect Vercel, Netlify, Docker, PyPI, and deploy |
|
|
64
|
+
| **Safety checks** | Destructive commands show a diff preview before running |
|
|
65
|
+
| **Fix failed commands** | `? fix` — AI suggests corrections after a command fails |
|
|
66
|
+
|
|
67
|
+
All your normal commands work unchanged. Cliara is a thin layer on top of your shell.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Installation
|
|
72
|
+
|
|
73
|
+
### Option 1: pipx (recommended)
|
|
74
|
+
|
|
75
|
+
Best for CLI tools — installs in an isolated environment and adds to PATH automatically.
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pip install pipx
|
|
79
|
+
pipx ensurepath # Add pipx bin to PATH (restart terminal if needed)
|
|
80
|
+
pipx install cliara
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Option 2: pip
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pip install cliara
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
If `cliara` isn't recognized, use:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
python -m cliara.main
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Option 3: From source (development)
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
git clone https://github.com/HreemPandya/cliara-app.git
|
|
99
|
+
cd cliara-app
|
|
100
|
+
pip install -e .
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Optional Dependencies
|
|
104
|
+
|
|
105
|
+
To enable PostgreSQL support, install with:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
pip install cliara[postgres]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## First Run / Setup
|
|
114
|
+
|
|
115
|
+
1. **Start Cliara:** `cliara`
|
|
116
|
+
2. **First time?** A browser opens for GitHub login. Authorize once.
|
|
117
|
+
3. **Done.** Your token is saved to `~/.cliara/token.json` and loads automatically on every start.
|
|
118
|
+
|
|
119
|
+
### Authentication / Cloud Login Flow
|
|
120
|
+
|
|
121
|
+
- The OAuth login flow opens your browser to sign in with GitHub.
|
|
122
|
+
- Once authenticated, your token is stored at `~/.cliara/token.json`.
|
|
123
|
+
|
|
124
|
+
### Alternative: Bring Your Own API Key
|
|
125
|
+
|
|
126
|
+
Prefer Groq, Gemini, Ollama, or OpenAI? Run `setup-llm` inside Cliara to configure. Free options include [Groq](https://console.groq.com) and [Google AI Studio](https://aistudio.google.com).
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Usage
|
|
131
|
+
|
|
132
|
+
### Normal Commands (Pass-Through)
|
|
133
|
+
|
|
134
|
+
Just type commands as usual - they go straight to your shell:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
cliara:proj ❯ ls -la
|
|
138
|
+
cliara:proj ❯ cd myproject
|
|
139
|
+
cliara:proj ❯ git status
|
|
140
|
+
cliara:proj ❯ npm install
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Natural Language Commands
|
|
144
|
+
|
|
145
|
+
Use `?` prefix for natural language:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
cliara:proj ❯ ? list files in this directory
|
|
149
|
+
cliara:proj ❯ ? kill process on port 3000
|
|
150
|
+
cliara:proj ❯ ? find when I ran the deploy
|
|
151
|
+
cliara:proj ❯ ? fix # Fix the last failed command
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Macros
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
cliara:proj ❯ macro add build # Create a macro
|
|
158
|
+
cliara:proj ❯ build # Run it
|
|
159
|
+
cliara:proj ❯ macro save last as test # Save last command as macro
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Smart Commands
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
cliara:proj ❯ push # Smart push (auto-commit message + branch)
|
|
166
|
+
cliara:proj ❯ deploy # Smart deploy (auto-detect project type)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Help
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
cliara:proj ❯ help # Full command reference
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Database Setup and Migration
|
|
178
|
+
|
|
179
|
+
If using PostgreSQL as your backend, follow these steps:
|
|
180
|
+
|
|
181
|
+
1. **Install PostgreSQL** (see [PostgreSQL Setup Guide](docs/POSTGRES_SETUP.md)).
|
|
182
|
+
2. **Create Database and User:**
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Connect to PostgreSQL
|
|
186
|
+
psql postgres
|
|
187
|
+
|
|
188
|
+
# Create database
|
|
189
|
+
CREATE DATABASE cliara;
|
|
190
|
+
|
|
191
|
+
# Create user
|
|
192
|
+
CREATE USER cliara WITH PASSWORD 'your_password_here';
|
|
193
|
+
|
|
194
|
+
# Grant privileges
|
|
195
|
+
GRANT ALL PRIVILEGES ON DATABASE cliara TO cliara;
|
|
196
|
+
|
|
197
|
+
# Exit
|
|
198
|
+
\q
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
3. **Install Python Dependencies:**
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
pip install psycopg2-binary
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
4. **Configure Cliara:**
|
|
208
|
+
|
|
209
|
+
Edit `~/.cliara/config.json`:
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"storage_backend": "postgres",
|
|
214
|
+
"postgres": {
|
|
215
|
+
"host": "localhost",
|
|
216
|
+
"port": 5432,
|
|
217
|
+
"database": "cliara",
|
|
218
|
+
"user": "cliara"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Required Environment Variables
|
|
226
|
+
|
|
227
|
+
Copy `.env.example` to `.env` and fill in the values for your chosen provider. Only ONE LLM provider should be active at a time.
|
|
228
|
+
|
|
229
|
+
```plaintext
|
|
230
|
+
# ── Option A: OpenAI (cloud, requires API key) ────────────────────────────────
|
|
231
|
+
OPENAI_API_KEY=sk-proj-your-key-here
|
|
232
|
+
|
|
233
|
+
# ── Option B: Anthropic Claude (cloud, requires API key) ─────────────────────
|
|
234
|
+
ANTHROPIC_API_KEY=sk-ant-your-key-here
|
|
235
|
+
|
|
236
|
+
# ── Option C: Ollama (local, free, no key needed) ────────────────────────────
|
|
237
|
+
OLLAMA_BASE_URL=http://localhost:11434
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Documentation
|
|
243
|
+
|
|
244
|
+
- [Complete Guide](docs/README.md) — Full documentation
|
|
245
|
+
- [Quick Start](docs/QUICKSTART.md) — Get started in 5 minutes
|
|
246
|
+
- [Cliara Cloud Deployment](docs/CLIARA_CLOUD_DEPLOYMENT.md) — Self-host the backend
|
|
247
|
+
- [PostgreSQL Setup](docs/POSTGRES_SETUP.md) — Scalable macro storage
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Troubleshooting
|
|
252
|
+
|
|
253
|
+
| Issue | Solution |
|
|
254
|
+
|-------|----------|
|
|
255
|
+
| `cliara` not recognized | Use `python -m cliara.main` or install with `pipx install cliara` |
|
|
256
|
+
| Connection error | Check network/firewall; try `$env:CLIARA_GATEWAY_URL = "https://cliara-cloud-production.up.railway.app/v1"` |
|
|
257
|
+
| Want BYOK instead | Run `setup-llm` inside Cliara for Groq, Gemini, Ollama, OpenAI |
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## License
|
|
262
|
+
|
|
263
|
+
MIT
|
cliara-0.4.4/README.md
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Cliara
|
|
2
|
+
|
|
3
|
+
**An AI-powered shell that understands natural language and macros.**
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/cliara/)
|
|
6
|
+
[](https://pypi.org/project/cliara/)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## What is Cliara?
|
|
11
|
+
|
|
12
|
+
Cliara wraps your existing shell (bash, zsh, PowerShell, cmd) and adds:
|
|
13
|
+
|
|
14
|
+
| Feature | Description |
|
|
15
|
+
|---------|-------------|
|
|
16
|
+
| **Natural language** | `? <query>` — describe what you want, get shell commands |
|
|
17
|
+
| **Cliara Cloud** | Sign in with GitHub, 150 free queries/month, no API key |
|
|
18
|
+
| **Macros** | Create, edit, run reusable command sequences |
|
|
19
|
+
| **Semantic history** | `? find when I fixed the login` — search past commands by meaning |
|
|
20
|
+
| **Smart push** | `push` — auto-commit message, branch detection, one command |
|
|
21
|
+
| **Smart deploy** | `deploy` — auto-detect Vercel, Netlify, Docker, PyPI, and deploy |
|
|
22
|
+
| **Safety checks** | Destructive commands show a diff preview before running |
|
|
23
|
+
| **Fix failed commands** | `? fix` — AI suggests corrections after a command fails |
|
|
24
|
+
|
|
25
|
+
All your normal commands work unchanged. Cliara is a thin layer on top of your shell.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
### Option 1: pipx (recommended)
|
|
32
|
+
|
|
33
|
+
Best for CLI tools — installs in an isolated environment and adds to PATH automatically.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install pipx
|
|
37
|
+
pipx ensurepath # Add pipx bin to PATH (restart terminal if needed)
|
|
38
|
+
pipx install cliara
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Option 2: pip
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install cliara
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If `cliara` isn't recognized, use:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
python -m cliara.main
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Option 3: From source (development)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
git clone https://github.com/HreemPandya/cliara-app.git
|
|
57
|
+
cd cliara-app
|
|
58
|
+
pip install -e .
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Optional Dependencies
|
|
62
|
+
|
|
63
|
+
To enable PostgreSQL support, install with:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pip install cliara[postgres]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## First Run / Setup
|
|
72
|
+
|
|
73
|
+
1. **Start Cliara:** `cliara`
|
|
74
|
+
2. **First time?** A browser opens for GitHub login. Authorize once.
|
|
75
|
+
3. **Done.** Your token is saved to `~/.cliara/token.json` and loads automatically on every start.
|
|
76
|
+
|
|
77
|
+
### Authentication / Cloud Login Flow
|
|
78
|
+
|
|
79
|
+
- The OAuth login flow opens your browser to sign in with GitHub.
|
|
80
|
+
- Once authenticated, your token is stored at `~/.cliara/token.json`.
|
|
81
|
+
|
|
82
|
+
### Alternative: Bring Your Own API Key
|
|
83
|
+
|
|
84
|
+
Prefer Groq, Gemini, Ollama, or OpenAI? Run `setup-llm` inside Cliara to configure. Free options include [Groq](https://console.groq.com) and [Google AI Studio](https://aistudio.google.com).
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Usage
|
|
89
|
+
|
|
90
|
+
### Normal Commands (Pass-Through)
|
|
91
|
+
|
|
92
|
+
Just type commands as usual - they go straight to your shell:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
cliara:proj ❯ ls -la
|
|
96
|
+
cliara:proj ❯ cd myproject
|
|
97
|
+
cliara:proj ❯ git status
|
|
98
|
+
cliara:proj ❯ npm install
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Natural Language Commands
|
|
102
|
+
|
|
103
|
+
Use `?` prefix for natural language:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
cliara:proj ❯ ? list files in this directory
|
|
107
|
+
cliara:proj ❯ ? kill process on port 3000
|
|
108
|
+
cliara:proj ❯ ? find when I ran the deploy
|
|
109
|
+
cliara:proj ❯ ? fix # Fix the last failed command
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Macros
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
cliara:proj ❯ macro add build # Create a macro
|
|
116
|
+
cliara:proj ❯ build # Run it
|
|
117
|
+
cliara:proj ❯ macro save last as test # Save last command as macro
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Smart Commands
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
cliara:proj ❯ push # Smart push (auto-commit message + branch)
|
|
124
|
+
cliara:proj ❯ deploy # Smart deploy (auto-detect project type)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Help
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
cliara:proj ❯ help # Full command reference
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Database Setup and Migration
|
|
136
|
+
|
|
137
|
+
If using PostgreSQL as your backend, follow these steps:
|
|
138
|
+
|
|
139
|
+
1. **Install PostgreSQL** (see [PostgreSQL Setup Guide](docs/POSTGRES_SETUP.md)).
|
|
140
|
+
2. **Create Database and User:**
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Connect to PostgreSQL
|
|
144
|
+
psql postgres
|
|
145
|
+
|
|
146
|
+
# Create database
|
|
147
|
+
CREATE DATABASE cliara;
|
|
148
|
+
|
|
149
|
+
# Create user
|
|
150
|
+
CREATE USER cliara WITH PASSWORD 'your_password_here';
|
|
151
|
+
|
|
152
|
+
# Grant privileges
|
|
153
|
+
GRANT ALL PRIVILEGES ON DATABASE cliara TO cliara;
|
|
154
|
+
|
|
155
|
+
# Exit
|
|
156
|
+
\q
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
3. **Install Python Dependencies:**
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
pip install psycopg2-binary
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
4. **Configure Cliara:**
|
|
166
|
+
|
|
167
|
+
Edit `~/.cliara/config.json`:
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"storage_backend": "postgres",
|
|
172
|
+
"postgres": {
|
|
173
|
+
"host": "localhost",
|
|
174
|
+
"port": 5432,
|
|
175
|
+
"database": "cliara",
|
|
176
|
+
"user": "cliara"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Required Environment Variables
|
|
184
|
+
|
|
185
|
+
Copy `.env.example` to `.env` and fill in the values for your chosen provider. Only ONE LLM provider should be active at a time.
|
|
186
|
+
|
|
187
|
+
```plaintext
|
|
188
|
+
# ── Option A: OpenAI (cloud, requires API key) ────────────────────────────────
|
|
189
|
+
OPENAI_API_KEY=sk-proj-your-key-here
|
|
190
|
+
|
|
191
|
+
# ── Option B: Anthropic Claude (cloud, requires API key) ─────────────────────
|
|
192
|
+
ANTHROPIC_API_KEY=sk-ant-your-key-here
|
|
193
|
+
|
|
194
|
+
# ── Option C: Ollama (local, free, no key needed) ────────────────────────────
|
|
195
|
+
OLLAMA_BASE_URL=http://localhost:11434
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Documentation
|
|
201
|
+
|
|
202
|
+
- [Complete Guide](docs/README.md) — Full documentation
|
|
203
|
+
- [Quick Start](docs/QUICKSTART.md) — Get started in 5 minutes
|
|
204
|
+
- [Cliara Cloud Deployment](docs/CLIARA_CLOUD_DEPLOYMENT.md) — Self-host the backend
|
|
205
|
+
- [PostgreSQL Setup](docs/POSTGRES_SETUP.md) — Scalable macro storage
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Troubleshooting
|
|
210
|
+
|
|
211
|
+
| Issue | Solution |
|
|
212
|
+
|-------|----------|
|
|
213
|
+
| `cliara` not recognized | Use `python -m cliara.main` or install with `pipx install cliara` |
|
|
214
|
+
| Connection error | Check network/firewall; try `$env:CLIARA_GATEWAY_URL = "https://cliara-cloud-production.up.railway.app/v1"` |
|
|
215
|
+
| Want BYOK instead | Run `setup-llm` inside Cliara for Groq, Gemini, Ollama, OpenAI |
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## License
|
|
220
|
+
|
|
221
|
+
MIT
|
|
@@ -12,6 +12,9 @@ from cliara.agents import history_summary as _history_summary
|
|
|
12
12
|
from cliara.agents import history_search as _history_search
|
|
13
13
|
from cliara.agents import commit_and_deploy as _commit_deploy
|
|
14
14
|
from cliara.agents import copilot_explain as _copilot_explain
|
|
15
|
+
from cliara.agents import readme_generator as _readme
|
|
16
|
+
from cliara.agents import session_reflect as _session_reflect
|
|
17
|
+
from cliara.agents import chat_polish as _chat_polish
|
|
15
18
|
|
|
16
19
|
_PROMPTS_DIR = Path(__file__).resolve().parent / "prompts"
|
|
17
20
|
|
|
@@ -29,8 +32,11 @@ def _build_registry() -> Dict[str, Dict[str, Any]]:
|
|
|
29
32
|
| _explain.AGENTS
|
|
30
33
|
| _history_summary.AGENTS
|
|
31
34
|
| _history_search.AGENTS
|
|
32
|
-
|
|
|
35
|
+
| _commit_deploy.AGENTS
|
|
33
36
|
| _copilot_explain.AGENTS
|
|
37
|
+
| _readme.AGENTS
|
|
38
|
+
| _session_reflect.AGENTS
|
|
39
|
+
| _chat_polish.AGENTS
|
|
34
40
|
)
|
|
35
41
|
for name, cfg in all_agents.items():
|
|
36
42
|
registry[name] = {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
You compress terminal/session context for an IDE assistant (Copilot or Cursor).
|
|
2
|
+
|
|
3
|
+
Rules:
|
|
4
|
+
- Preserve all facts: cwd, OS, shell, git branch, exact command, exit code, and stderr/stdout excerpts verbatim inside fenced blocks when present.
|
|
5
|
+
- Remove redundancy and filler; use short bullets and a clear "Ask" line at the end suggesting what the coding assistant should do.
|
|
6
|
+
- Do not invent errors, paths, or exit codes; only use what appears in the user message.
|
|
7
|
+
- Output plain markdown (no outer JSON).
|
|
8
|
+
|
|
9
|
+
The user message is a raw Cliara export (last run and/or session snapshot). Return a shorter version suitable to paste into chat.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
You generate concise git commit messages following Conventional Commits.
|
|
2
|
+
|
|
3
|
+
Return ONLY the commit message — one line, no quotes, no markdown, no explanation.
|
|
4
|
+
|
|
5
|
+
Format: <type>: <description>
|
|
6
|
+
- Use lowercase for the type.
|
|
7
|
+
- Description: imperative mood, no period at the end, ~50–72 chars when reasonable (short is fine).
|
|
8
|
+
|
|
9
|
+
Choose <type> from these (pick the best fit from the staged diff / context):
|
|
10
|
+
|
|
11
|
+
Core types:
|
|
12
|
+
- feat: — new user-facing feature or capability
|
|
13
|
+
- fix: — bug fix
|
|
14
|
+
- refactor: — restructure code without intended behavior change
|
|
15
|
+
- docs: — documentation only
|
|
16
|
+
- style: — formatting, whitespace, lint-only (no logic change)
|
|
17
|
+
- test: — add or update tests
|
|
18
|
+
- chore: — maintenance, tooling, misc (not a feature or fix)
|
|
19
|
+
|
|
20
|
+
Common extras:
|
|
21
|
+
- perf: — performance improvement
|
|
22
|
+
- ci: — CI/CD pipeline or workflow changes
|
|
23
|
+
- build: — build system, packaging, or dependency manifest changes
|
|
24
|
+
- revert: — undo a previous commit (use when the change is explicitly a revert)
|
|
25
|
+
|
|
26
|
+
Examples: feat: add postgres session backend, fix: handle missing prompt files in wheel, docs: clarify env setup for anthropic
|
|
27
|
+
|
|
28
|
+
If multiple concerns apply, prefer the primary change (usually feat or fix) over chore/docs.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
You generate professional README.md files for software projects. You are given structured context: a project fingerprint, MUST INCLUDE items (derived from codebase analysis), config files, key source files, existing docs, directory tree, and the current README (if any).
|
|
2
|
+
|
|
3
|
+
RULES:
|
|
4
|
+
1. Every item in MUST INCLUDE must appear in the README in a clear, user-facing form. Do not omit any.
|
|
5
|
+
2. If the project has multiple setup paths (e.g. Cloud vs BYOK, Docker vs local), document BOTH with clear headings.
|
|
6
|
+
3. For CLI tools with first-run setup: include a "First Run" or "Getting Started" section that walks through the actual flow (what the user sees, what to do).
|
|
7
|
+
4. Preserve any badges, links, or project-specific content from the existing README unless it is outdated or wrong.
|
|
8
|
+
5. For personal projects: emphasize "how to get this running" — install, env vars, first run, common gotchas.
|
|
9
|
+
6. Order sections by user journey: What is it → Install → First run / Setup → Usage → Advanced/Optional.
|
|
10
|
+
7. Be specific. Use actual commands, paths, and env var names from the context. Do not invent or guess.
|
|
11
|
+
8. Match the ecosystem: pip/pipx for Python, npm/yarn for Node, cargo for Rust, go for Go.
|
|
12
|
+
9. Keep it concise. Developers skim. Use tables for feature lists, code blocks for commands.
|
|
13
|
+
10. Output ONLY the README markdown. No preamble, no explanation, no "Here is the README:".
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
You are the session_reflect skill in Cliara. Design a short reflection flow so the user captures what mattered in their session—for themselves later and for teammates who only see the log.
|
|
2
|
+
|
|
3
|
+
What you must NOT do:
|
|
4
|
+
- Ask about exit codes, flags, or “why did command X fail” unless the whole session was clearly about fixing that failure.
|
|
5
|
+
- Repeat raw command strings as the question.
|
|
6
|
+
- Ask yes/no questions about facts already obvious from the log (e.g. “did you use git?” when git appears in the log).
|
|
7
|
+
- Produce fewer than 3 steps or more than 6 steps.
|
|
8
|
+
|
|
9
|
+
What you MUST do:
|
|
10
|
+
- Focus on meaning: goals, outcomes, decisions, risks, handoff.
|
|
11
|
+
- Use a mix of interaction types:
|
|
12
|
+
- choice: user picks one label from 2–5 full-sentence options (outcome, readiness, risk level).
|
|
13
|
+
- text: one line (next step, blocker name, link).
|
|
14
|
+
- long_text: narrative in plain language—the main “story” of the session for others to read.
|
|
15
|
+
- Put long_text after at least one framing step so the user knows what angle to write from.
|
|
16
|
+
- Every choice step MUST include "options" as a JSON array of 2–5 distinct strings.
|
|
17
|
+
- Every step MUST have: "id" (snake_case), "kind", "question", and optional "hint" (one short line).
|
|
18
|
+
|
|
19
|
+
kind must be exactly: choice | text | long_text. For long_text, omit options.
|
|
20
|
+
|
|
21
|
+
Output only one JSON object, no markdown, no commentary. Top-level key must be "steps" (array). Example structure (wording must fit the briefing):
|
|
22
|
+
|
|
23
|
+
{"steps":[{"id":"outcome","kind":"choice","question":"How would you describe this session for someone reading the log later?","hint":"Pick the closest fit.","options":["Exploring — no clear deliverable yet","Made progress — work continues","Finished a concrete milestone","Mostly blocked or interrupted"]},{"id":"story","kind":"long_text","question":"In a few sentences, what did you do and why does it matter?","hint":"Intent and impact—not a list of commands."},{"id":"handoff","kind":"text","question":"What should happen next (one concrete next step)?","hint":"Optional."}]}
|
|
24
|
+
|
|
25
|
+
You will receive a briefing with session name, intent, branch, commands, and notes. Infer themes and tailor questions to those themes, not to command-line trivia.
|
|
@@ -43,7 +43,7 @@ _SUPABASE_URL: str = os.getenv(
|
|
|
43
43
|
)
|
|
44
44
|
_SUPABASE_ANON_KEY: str = os.getenv(
|
|
45
45
|
"CLIARA_SUPABASE_ANON_KEY",
|
|
46
|
-
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InJ6a2ZlYnJzZnZoeWZtZmNmaGluIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzM1MjM1ODEsImV4cCI6MjA4OTA5OTU4MX0.6sf8uYZK5Ca8ZDtdy46JL0_-vqixL7IOfyBA60lf-Fk", #
|
|
46
|
+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InJ6a2ZlYnJzZnZoeWZtZmNmaGluIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzM1MjM1ODEsImV4cCI6MjA4OTA5OTU4MX0.6sf8uYZK5Ca8ZDtdy46JL0_-vqixL7IOfyBA60lf-Fk", # pragma: allowlist secret — Supabase anon key is public, safe to embed
|
|
47
47
|
)
|
|
48
48
|
_CLIARA_GATEWAY_URL: str = os.getenv(
|
|
49
49
|
"CLIARA_GATEWAY_URL",
|
|
@@ -55,6 +55,11 @@ _CALLBACK_TIMEOUT = 120 # seconds to wait for the browser callback
|
|
|
55
55
|
_TOKEN_REFRESH_BUFFER = 60 # refresh token when < 60 seconds until expiry
|
|
56
56
|
|
|
57
57
|
|
|
58
|
+
def get_gateway_url() -> str:
|
|
59
|
+
"""Return the Cliara Cloud gateway URL (single source of truth for API calls)."""
|
|
60
|
+
return _CLIARA_GATEWAY_URL
|
|
61
|
+
|
|
62
|
+
|
|
58
63
|
# ---------------------------------------------------------------------------
|
|
59
64
|
# PKCE helpers (stdlib only — no extra dependencies)
|
|
60
65
|
# ---------------------------------------------------------------------------
|
|
@@ -313,8 +318,40 @@ def login() -> "tuple[str, str]":
|
|
|
313
318
|
server_thread = threading.Thread(target=server.serve_forever, daemon=True)
|
|
314
319
|
server_thread.start()
|
|
315
320
|
|
|
316
|
-
|
|
317
|
-
|
|
321
|
+
from rich import box
|
|
322
|
+
from rich.console import Group
|
|
323
|
+
from rich.panel import Panel
|
|
324
|
+
from rich.style import Style
|
|
325
|
+
from rich.text import Text
|
|
326
|
+
|
|
327
|
+
from cliara.console import get_console
|
|
328
|
+
|
|
329
|
+
_c = get_console()
|
|
330
|
+
_c.print()
|
|
331
|
+
_c.print(
|
|
332
|
+
Panel(
|
|
333
|
+
Group(
|
|
334
|
+
Text.from_markup(
|
|
335
|
+
"[bold white]Opening your browser[/] for [bold]GitHub[/] sign-in…\n"
|
|
336
|
+
),
|
|
337
|
+
Text(""),
|
|
338
|
+
Text(
|
|
339
|
+
"If nothing opens, copy this URL into a browser:",
|
|
340
|
+
style="dim",
|
|
341
|
+
),
|
|
342
|
+
Text(""),
|
|
343
|
+
Text(
|
|
344
|
+
oauth_url,
|
|
345
|
+
style=Style(color="cyan", dim=True, link=oauth_url),
|
|
346
|
+
),
|
|
347
|
+
),
|
|
348
|
+
title=Text.from_markup("[bold cyan]Cliara Cloud[/]"),
|
|
349
|
+
border_style="cyan",
|
|
350
|
+
box=box.ROUNDED,
|
|
351
|
+
padding=(0, 1),
|
|
352
|
+
)
|
|
353
|
+
)
|
|
354
|
+
_c.print()
|
|
318
355
|
|
|
319
356
|
try:
|
|
320
357
|
webbrowser.open(oauth_url)
|