lemonpie-cli 0.2.0rc1__tar.gz → 0.2.0rc2__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.
- lemonpie_cli-0.2.0rc2/.release-please/manifest.json +3 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/CHANGELOG.md +13 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/PKG-INFO +27 -45
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/README.md +26 -44
- lemonpie_cli-0.2.0rc2/docs/ROADMAP.md +34 -0
- lemonpie_cli-0.2.0rc2/docs/design/code-completion.md +108 -0
- lemonpie_cli-0.2.0rc1/docs/design/state-machine.md → lemonpie_cli-0.2.0rc2/docs/design/model-verification.md +3 -1
- lemonpie_cli-0.2.0rc2/docs/design/packaging.md +90 -0
- lemonpie_cli-0.2.0rc2/docs/usage/command-index.md +44 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/_version.py +2 -2
- lemonpie_cli-0.2.0rc2/src/lemonpie/cli/config_cmd.py +527 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/config.py +30 -4
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/engine/ollama.py +2 -2
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/main.py +13 -18
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/paths.py +1 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/sessions/storage.py +6 -2
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/time_utils.py +4 -3
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/tests/conftest.py +2 -3
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/tests/test_cli.py +10 -0
- lemonpie_cli-0.2.0rc2/tests/test_config_cmd.py +439 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/tests/test_sessions.py +0 -1
- lemonpie_cli-0.2.0rc1/.release-please/manifest.json +0 -3
- lemonpie_cli-0.2.0rc1/src/lemonpie/cli/config_cmd.py +0 -246
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/.github/workflows/ci.yml +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/.github/workflows/release.yml +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/.gitignore +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/.release-please/config.json +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/LICENSE +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/docs/config.example.json +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/pyproject.toml +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/__init__.py +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/cli/__init__.py +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/cli/parser.py +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/cli/ui.py +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/engine/__init__.py +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/engine/models.py +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/sessions/__init__.py +0 -0
- {lemonpie_cli-0.2.0rc1 → lemonpie_cli-0.2.0rc2}/uv.lock +0 -0
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.0-rc2](https://github.com/famousStratum/LemonPie/compare/v0.2.0-rc1...v0.2.0-rc2) (2026-11-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* lmConfig --init — interactive setup wizard ([#37](https://github.com/famousStratum/LemonPie/issues/37)) ([a9cc56d](https://github.com/famousStratum/LemonPie/commit/a9cc56db38ee17735fbdd6d607a34cd06e352372))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Documentation
|
|
12
|
+
|
|
13
|
+
* reflect lmConfig --init in README and /docs ([#38](https://github.com/famousStratum/LemonPie/issues/38)) ([b1d0bd9](https://github.com/famousStratum/LemonPie/commit/b1d0bd95f1e96be12a4dea24ef79a5711deebdf1))
|
|
14
|
+
* split roadmap into design docs and add command reference ([#34](https://github.com/famousStratum/LemonPie/issues/34)) ([a382aac](https://github.com/famousStratum/LemonPie/commit/a382aac6d480963fce7f4486926e315a51741aaf))
|
|
15
|
+
|
|
3
16
|
## [0.2.0-rc1](https://github.com/famousStratum/LemonPie/compare/v0.2.0-beta.1...v0.2.0-rc1) (2026-09-22)
|
|
4
17
|
|
|
5
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: lemonpie-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.0rc2
|
|
4
4
|
Summary: LemonPie — A lightweight Ollama client for terminal users
|
|
5
5
|
Project-URL: homepage, https://versicode.com/lemonpie
|
|
6
6
|
Project-URL: repository, https://github.com/famousStratum/LemonPie
|
|
@@ -20,27 +20,28 @@ Description-Content-Type: text/markdown
|
|
|
20
20
|
|
|
21
21
|
# LemonPie
|
|
22
22
|
|
|
23
|
-
**LemonPie — A lightweight Ollama client for terminal users**
|
|
24
|
-
|
|
25
|
-

|
|
26
23
|

|
|
27
24
|

|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
**LemonPie — A lightweight Ollama client for terminal users**
|
|
28
28
|
|
|
29
29
|
LemonPie is a compact CLI for interacting with an Ollama server. It manages chat sessions and persists history locally, designed to be tiny and portable — ideal for lightweight systems and terminal users, but usable anywhere with Python and network access.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
|
|
33
33
|
## ✨ Features
|
|
34
34
|
- Start and manage chat sessions with Ollama models
|
|
35
35
|
- Persist session history in your OS's standard user data directory
|
|
36
36
|
- Configure host, default model, and aliases via a config file in your OS's standard user config directory
|
|
37
|
+
- Interactive setup wizard (`lmConfig --init`) for first-time configuration — verifies server reachability and lists available models for selection
|
|
37
38
|
- Add, remove, and list models with aliases (`lmConfig`)
|
|
38
39
|
- Switch models mid‑session with confirmation
|
|
39
40
|
- Atomic writes for safety (tmp + replace)
|
|
40
41
|
- Streaming responses from Ollama for real‑time output
|
|
41
42
|
- Graceful handling of Ctrl‑C interrupts
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
|
|
44
45
|
|
|
45
46
|
## 📂 Project Structure
|
|
46
47
|
|
|
@@ -64,7 +65,7 @@ LemonPie/
|
|
|
64
65
|
├── tests/ # pytest suite
|
|
65
66
|
├── docs/
|
|
66
67
|
│ ├── config.example.json # Configuration template
|
|
67
|
-
│ └── design/ # Design docs (
|
|
68
|
+
│ └── design/ # Design docs (model-verification.md, etc.)
|
|
68
69
|
├── .github/workflows/ # CI & release pipelines
|
|
69
70
|
├── pyproject.toml # Package & build configuration
|
|
70
71
|
├── README.md # Project overview
|
|
@@ -72,20 +73,20 @@ LemonPie/
|
|
|
72
73
|
└── .gitignore
|
|
73
74
|
```
|
|
74
75
|
|
|
75
|
-
---
|
|
76
|
-
|
|
77
76
|
## ⚙️ Configuration
|
|
78
77
|
|
|
79
78
|
LemonPie keeps its config file and session history in your OS's standard user directories (via [`platformdirs`](https://pypi.org/project/platformdirs/)) — not in the project folder:
|
|
80
79
|
|
|
81
|
-
|
|
|
82
|
-
|
|
83
|
-
|
|
|
84
|
-
|
|
|
80
|
+
| OS | Config Path | Sessions Path |
|
|
81
|
+
|----------|--------------------------------------------|-----------------------------------------------------------|
|
|
82
|
+
| Linux | `~/.config/lemonpie/` | `~/.local/share/lemonpie/sessions/` |
|
|
83
|
+
| macOS | `~/Library/Application Support/lemonpie/` | `~/Library/Application Support/lemonpie/sessions/` |
|
|
84
|
+
| Windows | `%LOCALAPPDATA%\lemonpie\` | `%LOCALAPPDATA%\lemonpie\sessions\` |
|
|
85
|
+
|
|
85
86
|
|
|
86
87
|
Both are overridable via environment variables — `LEMONPIE_CONFIG_DIR` and `LEMONPIE_SESSIONS_DIR` — useful for testing or running in a container.
|
|
87
88
|
|
|
88
|
-
`docs/config.example.json` is a template. `lmConfig`
|
|
89
|
+
`docs/config.example.json` is a template. Run `lmConfig --init` to set up your config interactively — it verifies server reachability, lists installed models for selection, and writes the file for you. `lmConfig` also auto-creates a minimal config on first use if you prefer to configure manually.
|
|
89
90
|
|
|
90
91
|
### Example structure:
|
|
91
92
|
```json
|
|
@@ -102,11 +103,7 @@ server: Ollama host URL\
|
|
|
102
103
|
default: canonical model name (full identifier)\
|
|
103
104
|
models: list of objects with alias (nullable) and name
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
106
|
## 🚀 Usage
|
|
109
|
-
|
|
110
107
|
### `lm` / `lemonpie`
|
|
111
108
|
- Start a new session \
|
|
112
109
|
`lm -n "Hello"`
|
|
@@ -127,46 +124,31 @@ models: list of objects with alias (nullable) and name
|
|
|
127
124
|
`lm -m qwen2.5-coder:3b`
|
|
128
125
|
|
|
129
126
|
### `lmConfig`
|
|
130
|
-
-
|
|
127
|
+
- First-time setup\
|
|
128
|
+
`lmConfig --init`
|
|
129
|
+
|
|
130
|
+
- First-time setup (skip server verification)\
|
|
131
|
+
`lmConfig --init --force`
|
|
132
|
+
|
|
133
|
+
- Manage models\
|
|
131
134
|
`lmConfig --add-model qwen qwen2.5-coder:3b`\
|
|
132
135
|
`lmConfig --list-models`\
|
|
133
136
|
`lmConfig --remove-model qwen`
|
|
134
137
|
|
|
138
|
+
👉 Full [command reference](docs/usage/command-index.md).
|
|
135
139
|
|
|
136
140
|
## 🗺 Roadmap
|
|
137
141
|
|
|
138
142
|
Planned features and improvements:
|
|
139
143
|
|
|
140
|
-
-
|
|
141
|
-
|
|
142
|
-
- Prompts for Ollama server IP:port
|
|
143
|
-
- Verifies server reachability
|
|
144
|
-
- Lists available models if server responds
|
|
145
|
-
- Allows user to select models to add
|
|
146
|
-
- Handles cases where no models are found (with guidance to Ollama docs)
|
|
147
|
-
- Supports `--force` to override verification or alias conflicts
|
|
148
|
-
|
|
149
|
-
- Model verification state machine
|
|
150
|
-
Planned logic for `lmConfig --add-model`:
|
|
151
|
-
- Check server reachability
|
|
152
|
-
- Verify if model is installed
|
|
153
|
-
- Offer to pull missing models
|
|
154
|
-
- Handle pull success/failure and user choice
|
|
155
|
-
- Respect `--force` for overriding conflicts or skipping checks
|
|
156
|
-
*(See docs/design/state-machine.md for full diagram once published)*
|
|
157
|
-
|
|
144
|
+
- Code completion (autocomplete)
|
|
145
|
+
- Model verification state machine
|
|
158
146
|
- Enhanced error handling and user feedback
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
- Packaging for Debian (`.deb` via apt)
|
|
147
|
+
- Cross‑platform packaging (apt, winget, Homebrew)
|
|
162
148
|
- Future schema validation for config/session files
|
|
163
149
|
|
|
164
|
-
|
|
165
|
-
---
|
|
150
|
+
👉 See the full [roadmap](docs/ROADMAP.md) for details.
|
|
166
151
|
|
|
167
152
|
## 📜 License
|
|
168
153
|
|
|
169
154
|
This project is licensed under the **GNU General Public License v3.0** (**GPLv3**).You may redistribute and/or modify it under the terms of the GPL as published by the Free Software Foundation.See the [**license**](LICENSE) file for details.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
---
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
# LemonPie
|
|
2
2
|
|
|
3
|
-
**LemonPie — A lightweight Ollama client for terminal users**
|
|
4
|
-
|
|
5
|
-

|
|
6
3
|

|
|
7
4
|

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
**LemonPie — A lightweight Ollama client for terminal users**
|
|
8
8
|
|
|
9
9
|
LemonPie is a compact CLI for interacting with an Ollama server. It manages chat sessions and persists history locally, designed to be tiny and portable — ideal for lightweight systems and terminal users, but usable anywhere with Python and network access.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
|
|
13
13
|
## ✨ Features
|
|
14
14
|
- Start and manage chat sessions with Ollama models
|
|
15
15
|
- Persist session history in your OS's standard user data directory
|
|
16
16
|
- Configure host, default model, and aliases via a config file in your OS's standard user config directory
|
|
17
|
+
- Interactive setup wizard (`lmConfig --init`) for first-time configuration — verifies server reachability and lists available models for selection
|
|
17
18
|
- Add, remove, and list models with aliases (`lmConfig`)
|
|
18
19
|
- Switch models mid‑session with confirmation
|
|
19
20
|
- Atomic writes for safety (tmp + replace)
|
|
20
21
|
- Streaming responses from Ollama for real‑time output
|
|
21
22
|
- Graceful handling of Ctrl‑C interrupts
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
|
|
24
25
|
|
|
25
26
|
## 📂 Project Structure
|
|
26
27
|
|
|
@@ -44,7 +45,7 @@ LemonPie/
|
|
|
44
45
|
├── tests/ # pytest suite
|
|
45
46
|
├── docs/
|
|
46
47
|
│ ├── config.example.json # Configuration template
|
|
47
|
-
│ └── design/ # Design docs (
|
|
48
|
+
│ └── design/ # Design docs (model-verification.md, etc.)
|
|
48
49
|
├── .github/workflows/ # CI & release pipelines
|
|
49
50
|
├── pyproject.toml # Package & build configuration
|
|
50
51
|
├── README.md # Project overview
|
|
@@ -52,20 +53,20 @@ LemonPie/
|
|
|
52
53
|
└── .gitignore
|
|
53
54
|
```
|
|
54
55
|
|
|
55
|
-
---
|
|
56
|
-
|
|
57
56
|
## ⚙️ Configuration
|
|
58
57
|
|
|
59
58
|
LemonPie keeps its config file and session history in your OS's standard user directories (via [`platformdirs`](https://pypi.org/project/platformdirs/)) — not in the project folder:
|
|
60
59
|
|
|
61
|
-
|
|
|
62
|
-
|
|
63
|
-
|
|
|
64
|
-
|
|
|
60
|
+
| OS | Config Path | Sessions Path |
|
|
61
|
+
|----------|--------------------------------------------|-----------------------------------------------------------|
|
|
62
|
+
| Linux | `~/.config/lemonpie/` | `~/.local/share/lemonpie/sessions/` |
|
|
63
|
+
| macOS | `~/Library/Application Support/lemonpie/` | `~/Library/Application Support/lemonpie/sessions/` |
|
|
64
|
+
| Windows | `%LOCALAPPDATA%\lemonpie\` | `%LOCALAPPDATA%\lemonpie\sessions\` |
|
|
65
|
+
|
|
65
66
|
|
|
66
67
|
Both are overridable via environment variables — `LEMONPIE_CONFIG_DIR` and `LEMONPIE_SESSIONS_DIR` — useful for testing or running in a container.
|
|
67
68
|
|
|
68
|
-
`docs/config.example.json` is a template. `lmConfig`
|
|
69
|
+
`docs/config.example.json` is a template. Run `lmConfig --init` to set up your config interactively — it verifies server reachability, lists installed models for selection, and writes the file for you. `lmConfig` also auto-creates a minimal config on first use if you prefer to configure manually.
|
|
69
70
|
|
|
70
71
|
### Example structure:
|
|
71
72
|
```json
|
|
@@ -82,11 +83,7 @@ server: Ollama host URL\
|
|
|
82
83
|
default: canonical model name (full identifier)\
|
|
83
84
|
models: list of objects with alias (nullable) and name
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
86
|
## 🚀 Usage
|
|
89
|
-
|
|
90
87
|
### `lm` / `lemonpie`
|
|
91
88
|
- Start a new session \
|
|
92
89
|
`lm -n "Hello"`
|
|
@@ -107,46 +104,31 @@ models: list of objects with alias (nullable) and name
|
|
|
107
104
|
`lm -m qwen2.5-coder:3b`
|
|
108
105
|
|
|
109
106
|
### `lmConfig`
|
|
110
|
-
-
|
|
107
|
+
- First-time setup\
|
|
108
|
+
`lmConfig --init`
|
|
109
|
+
|
|
110
|
+
- First-time setup (skip server verification)\
|
|
111
|
+
`lmConfig --init --force`
|
|
112
|
+
|
|
113
|
+
- Manage models\
|
|
111
114
|
`lmConfig --add-model qwen qwen2.5-coder:3b`\
|
|
112
115
|
`lmConfig --list-models`\
|
|
113
116
|
`lmConfig --remove-model qwen`
|
|
114
117
|
|
|
118
|
+
👉 Full [command reference](docs/usage/command-index.md).
|
|
115
119
|
|
|
116
120
|
## 🗺 Roadmap
|
|
117
121
|
|
|
118
122
|
Planned features and improvements:
|
|
119
123
|
|
|
120
|
-
-
|
|
121
|
-
|
|
122
|
-
- Prompts for Ollama server IP:port
|
|
123
|
-
- Verifies server reachability
|
|
124
|
-
- Lists available models if server responds
|
|
125
|
-
- Allows user to select models to add
|
|
126
|
-
- Handles cases where no models are found (with guidance to Ollama docs)
|
|
127
|
-
- Supports `--force` to override verification or alias conflicts
|
|
128
|
-
|
|
129
|
-
- Model verification state machine
|
|
130
|
-
Planned logic for `lmConfig --add-model`:
|
|
131
|
-
- Check server reachability
|
|
132
|
-
- Verify if model is installed
|
|
133
|
-
- Offer to pull missing models
|
|
134
|
-
- Handle pull success/failure and user choice
|
|
135
|
-
- Respect `--force` for overriding conflicts or skipping checks
|
|
136
|
-
*(See docs/design/state-machine.md for full diagram once published)*
|
|
137
|
-
|
|
124
|
+
- Code completion (autocomplete)
|
|
125
|
+
- Model verification state machine
|
|
138
126
|
- Enhanced error handling and user feedback
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
- Packaging for Debian (`.deb` via apt)
|
|
127
|
+
- Cross‑platform packaging (apt, winget, Homebrew)
|
|
142
128
|
- Future schema validation for config/session files
|
|
143
129
|
|
|
144
|
-
|
|
145
|
-
---
|
|
130
|
+
👉 See the full [roadmap](docs/ROADMAP.md) for details.
|
|
146
131
|
|
|
147
132
|
## 📜 License
|
|
148
133
|
|
|
149
134
|
This project is licensed under the **GNU General Public License v3.0** (**GPLv3**).You may redistribute and/or modify it under the terms of the GPL as published by the Free Software Foundation.See the [**license**](LICENSE) file for details.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
---
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# 🗺 Roadmap
|
|
2
|
+
|
|
3
|
+
Planned features and improvements
|
|
4
|
+
|
|
5
|
+
## Model verification state machine
|
|
6
|
+
Planned logic for `lmConfig --add-model`:
|
|
7
|
+
- Check server reachability
|
|
8
|
+
- Verify if model is installed
|
|
9
|
+
- Offer to pull missing models
|
|
10
|
+
- Handle pull success/failure and user choice
|
|
11
|
+
- Respect `--force` for overriding conflicts or skipping checks
|
|
12
|
+
|
|
13
|
+
<sub>*See* docs/design/[model-verification.md](design/model-verification.md) *for full diagram once published*</sub>
|
|
14
|
+
|
|
15
|
+
## Cross‑platform packaging
|
|
16
|
+
- **Debian/Ubuntu**: `.deb` builds distributed via `apt` repository.
|
|
17
|
+
- **Windows**: package published to **winget** (Windows Package Manager).
|
|
18
|
+
- **macOS**: formula for **Homebrew** (brew install lemonpie).
|
|
19
|
+
- Ensure versioning consistency across all package managers.
|
|
20
|
+
- Automate builds with CI/CD pipelines (GitHub Actions, etc.).
|
|
21
|
+
- Provide signed binaries for security and trust.
|
|
22
|
+
|
|
23
|
+
## Code completion (autocomplete)
|
|
24
|
+
- **Native CLI code completion** that behaves like an IDE autocomplete but works from the LemonPie CLI:
|
|
25
|
+
`lm -n "<prefix>" --autocomplete` or an interactive REPL mode.
|
|
26
|
+
- The system must be able to **force the model to return only code** when autocomplete is selected and let users set a default autocomplete model via `lmConfig`.
|
|
27
|
+
|
|
28
|
+
<sub>*See* docs/design/[code-completion.md](design/code-completion.md) *for brainstorming and design notes.* </sub>
|
|
29
|
+
|
|
30
|
+
## Enhanced error handling and user feedback
|
|
31
|
+
- Graceful handling of server errors (HTTP codes, non‑JSON responses)
|
|
32
|
+
|
|
33
|
+
## Future schema validation
|
|
34
|
+
- Config/session file validation
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
**Status:** Draft
|
|
2
|
+
|
|
3
|
+
### Implementation plan (high level)
|
|
4
|
+
|
|
5
|
+
#### Goal
|
|
6
|
+
**Native CLI code completion** that behaves like an IDE autocomplete but works from the LemonPie CLI:
|
|
7
|
+
`lm -n "<prefix>" --autocomplete` or an interactive REPL mode.
|
|
8
|
+
The system must be able to **force the model to return only code** when autocomplete is selected and let users set a default autocomplete model via `lmConfig`.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
#### Prompt and role enforcement
|
|
13
|
+
- **Define an autocomplete role** in config (system instruction) that explicitly instructs the model to output only code and no explanations.
|
|
14
|
+
|
|
15
|
+
**Example system instruction (store in config roles):**
|
|
16
|
+
```
|
|
17
|
+
You are a code autocomplete engine.
|
|
18
|
+
Only output valid code tokens that continue the given prefix.
|
|
19
|
+
Do not include explanations, commentary, or markdown.
|
|
20
|
+
If you cannot produce code, output an empty string.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
- When `--autocomplete` is used, LemonPie selects this role automatically and sends it as the system message so the model is constrained.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
#### Model selection and config
|
|
29
|
+
- **Add a `default_autocomplete_model`** field to `config.json` or `config.yaml`.
|
|
30
|
+
|
|
31
|
+
**lmConfig commands:**
|
|
32
|
+
- `lmConfig --set-default-autocomplete <model>` to set the default.
|
|
33
|
+
- `lmConfig --add-model` and the existing state machine should verify the model is available on the Ollama server.
|
|
34
|
+
|
|
35
|
+
**Behavior:** If `--model` is passed on the CLI it overrides the default; otherwise use `default_autocomplete_model`.
|
|
36
|
+
|
|
37
|
+
**Example config snippet**
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"default_autocomplete_model": "smollm:360m",
|
|
41
|
+
"roles": {
|
|
42
|
+
"autocomplete": {
|
|
43
|
+
"system": "You are a code autocomplete engine. Only output valid code tokens..."
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### CLI UX and examples
|
|
50
|
+
- **One-shot completion**
|
|
51
|
+
|
|
52
|
+
lm -n "def build_client(server_host, timeout):\n return " --autocomplete
|
|
53
|
+
|
|
54
|
+
Output: code continuation only.
|
|
55
|
+
|
|
56
|
+
- **REPL mode**
|
|
57
|
+
|
|
58
|
+
lm --repl --autocomplete
|
|
59
|
+
|
|
60
|
+
Press Enter to request completion for the current line or selection.
|
|
61
|
+
|
|
62
|
+
- **Flags**
|
|
63
|
+
- `--autocomplete` selects role and output filtering.
|
|
64
|
+
- `--model <name>` overrides default autocomplete model.
|
|
65
|
+
- `--stream` enables token streaming for low-latency incremental display.
|
|
66
|
+
|
|
67
|
+
#### Output filtering and validation
|
|
68
|
+
- **Primary enforcement**: rely on the system role to make the model return code-only.
|
|
69
|
+
- **Secondary enforcement**: post-process model output:
|
|
70
|
+
- **Syntactic sanity checks**: quick heuristics (starts with `def`, `class`, `{`, `[` or valid indentation for Python).
|
|
71
|
+
- **Strip leading natural language**: if output begins with non-code tokens, discard or retry.
|
|
72
|
+
- **Retry policy**: up to N retries with a stricter system prompt or different temperature.
|
|
73
|
+
- **Fail-safe**: if model repeatedly returns non-code, return an empty completion and a short machine-readable error code (not a human explanation) so callers can handle it.
|
|
74
|
+
|
|
75
|
+
#### Streaming, latency, and model sizing
|
|
76
|
+
- **Tradeoffs**:
|
|
77
|
+
- **Small models**: low latency, good for interactive typing; may be less accurate.
|
|
78
|
+
- **Large models**: better completions, higher latency.
|
|
79
|
+
|
|
80
|
+
- **Suggested defaults**:
|
|
81
|
+
- Use a small/medium autocomplete model for interactive mode (e.g., `smollm:360m`).
|
|
82
|
+
- Allow power users to set a larger model for batch completions.
|
|
83
|
+
|
|
84
|
+
**Table of tradeoffs**
|
|
85
|
+
|
|
86
|
+
| **Model Class** | **Latency** | **Accuracy** | **Use Case** |
|
|
87
|
+
|-----------------|-------------|--------------|--------------|
|
|
88
|
+
| Small (<=500M) | Low | Medium | Interactive REPL, quick suggestions |
|
|
89
|
+
| Medium (500M–3B)| Medium | Good | Most users, balanced |
|
|
90
|
+
| Large (>3B) | High | High | Offline batch completions, complex code |
|
|
91
|
+
|
|
92
|
+
#### State machine and retries
|
|
93
|
+
- Reuse the state-machine style from [model-verification.md](docs/design/model-verification.md) and add a small state machine for completion requests:
|
|
94
|
+
- **Start** → model reachable? → yes: send request; no: fallback to local cache or error.
|
|
95
|
+
- **Receive output** → passes code filter? → yes: return; no: retry with stricter prompt or different model → if still fail, return empty completion with error code.
|
|
96
|
+
- Document retry limits and backoff in `code-completion.md`.
|
|
97
|
+
|
|
98
|
+
#### Testing and rollout
|
|
99
|
+
- **Unit tests** for:
|
|
100
|
+
- Role selection when `--autocomplete` is used.
|
|
101
|
+
- Output filtering heuristics.
|
|
102
|
+
- `lmConfig` default model setting and verification.
|
|
103
|
+
|
|
104
|
+
- **Integration tests**:
|
|
105
|
+
- Simulate streaming completions.
|
|
106
|
+
- Measure latency and retry behavior.
|
|
107
|
+
|
|
108
|
+
- **Beta flag**: ship behind `--experimental-autocomplete` initially to gather feedback.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
# Model Verification
|
|
1
|
+
# Model Verification
|
|
2
|
+
|
|
3
|
+
**Status:** Ready
|
|
2
4
|
|
|
3
5
|
This document outlines the planned state machine for `lmConfig --add-model`.
|
|
4
6
|
It defines how LemonPie should handle server reachability, model installation, and user choices when adding models.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# 📦 Cross‑Platform Packaging
|
|
2
|
+
|
|
3
|
+
**Status:** Brainstorm
|
|
4
|
+
|
|
5
|
+
This document outlines ideas and plans for distributing LemonPie across major operating systems.
|
|
6
|
+
It is intended as a **whiteboard for brainstorming** CI/CD flows, signing, and repo hosting — not a finalized implementation plan.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🎯 Goals
|
|
11
|
+
- Provide native installation methods for Linux, Windows, and macOS.
|
|
12
|
+
- Ensure versioning consistency across package managers.
|
|
13
|
+
- Automate builds and publishing via CI/CD pipelines.
|
|
14
|
+
- Deliver signed binaries for security and trust.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 🐧 Debian / Ubuntu (APT)
|
|
18
|
+
- Build `.deb` packages using `dpkg-buildpackage` or `debhelper`.
|
|
19
|
+
- Host packages in a PPA or custom apt repository.
|
|
20
|
+
- Automate publishing with GitHub Actions.
|
|
21
|
+
- Consider dependency handling (Python, Ollama client).
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## 🪟 Windows (winget)
|
|
25
|
+
- Create manifest YAML for LemonPie.
|
|
26
|
+
- Submit package to the winget community repository.
|
|
27
|
+
- Support silent install for automation.
|
|
28
|
+
- Ensure installer includes path setup for `lm`.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## 🍎 macOS (Homebrew)
|
|
32
|
+
- Write a Homebrew formula pointing to GitHub releases.
|
|
33
|
+
- Support `brew install lemonpie`.
|
|
34
|
+
- Handle dependencies (Python, Ollama client).
|
|
35
|
+
- Automate formula updates via CI/CD.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 🔄 CI/CD Flow
|
|
39
|
+
- Use GitHub Actions (or similar) to:
|
|
40
|
+
- Build `.deb`, `.msi/.exe`, and `.tar.gz` artifacts.
|
|
41
|
+
- Sign binaries for each OS.
|
|
42
|
+
- Publish tagged releases to GitHub.
|
|
43
|
+
- Trigger package manager updates (apt repo, winget manifest, Homebrew formula).
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
Tag release (GitHub)
|
|
48
|
+
│
|
|
49
|
+
▼
|
|
50
|
+
Build artifacts
|
|
51
|
+
(.deb, .msi/.exe, .tar.gz)
|
|
52
|
+
│
|
|
53
|
+
▼
|
|
54
|
+
Sign binaries?
|
|
55
|
+
/ \
|
|
56
|
+
NO YES
|
|
57
|
+
│ │
|
|
58
|
+
│ Publish to GitHub
|
|
59
|
+
│ │
|
|
60
|
+
│ ▼
|
|
61
|
+
│ Update package managers
|
|
62
|
+
│ (apt repo, winget, Homebrew)
|
|
63
|
+
│ │
|
|
64
|
+
│ ▼
|
|
65
|
+
│ Notify contributors
|
|
66
|
+
│
|
|
67
|
+
▼
|
|
68
|
+
Abort
|
|
69
|
+
"signing required"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## 🔐 Signing and Security
|
|
74
|
+
- GPG signing for `.deb` packages.
|
|
75
|
+
- Code signing certificates for Windows executables.
|
|
76
|
+
- Notarization for macOS binaries.
|
|
77
|
+
- Document verification steps for contributors.
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
## 📝 Brainstorm Notes
|
|
81
|
+
- Should we unify version numbers across all package managers?
|
|
82
|
+
- How to handle nightly builds vs stable releases?
|
|
83
|
+
- Should LemonPie provide portable binaries (zip/tar) in addition to package manager installs?
|
|
84
|
+
- Explore containerized distribution (Docker image) as an alternative.
|
|
85
|
+
|
|
86
|
+
## 📌 Next Steps
|
|
87
|
+
- Draft initial `.deb` build script.
|
|
88
|
+
- Experiment with winget manifest submission.
|
|
89
|
+
- Write a prototype Homebrew formula.
|
|
90
|
+
- Document signing requirements for each OS.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# 📖 Command & Flag Index
|
|
2
|
+
|
|
3
|
+
Quick reference for LemonPie CLI commands and flags.
|
|
4
|
+
Useful for both **users** (cheat sheet) and **developers** (tracking CLI surface area).
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## lmConfig
|
|
9
|
+
Manage LemonPie configuration (`config.json`).
|
|
10
|
+
|
|
11
|
+
- `--init` — Interactive setup wizard: prompt for server URL, verify reachability, list and select installed models, optionally set a default
|
|
12
|
+
- `--init --force` — Same as `--init` but skip server verification
|
|
13
|
+
- `--host <url>` — Set Ollama host URL (`http(s)://host:port`)
|
|
14
|
+
- `--default-model <name>` — Set default model using alias or full name (must exist in models)
|
|
15
|
+
- `--add-model <alias> <model>` — Add model mapping: alias → model_full_name
|
|
16
|
+
- `--remove-model <identifier>` — Remove a model mapping by alias or full name
|
|
17
|
+
- `--list-models` — List configured model aliases and names
|
|
18
|
+
- `--show` — Print full `config.json`
|
|
19
|
+
- `--force` — Force overwrite when adding a model; skip server verification when used with `--init`
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## lm
|
|
24
|
+
Run LemonPie with a given model or prompt.
|
|
25
|
+
|
|
26
|
+
- `-v, --version` — Show version
|
|
27
|
+
- `-m, --model <name>` — Model alias or full name
|
|
28
|
+
- `-n, --new` — Start a new chat session
|
|
29
|
+
- `-s, --session <id>` — Load an existing session by ID
|
|
30
|
+
- `-l, --list` — List chat sessions
|
|
31
|
+
- `-d, --delete <id>` — Delete a session by ID
|
|
32
|
+
- `-t, --title <text>` — Set or update session title
|
|
33
|
+
- `-c, --close` — Close current session
|
|
34
|
+
- `-p, --print` — Print current session history
|
|
35
|
+
- `--delete-all` — Delete all stored sessions
|
|
36
|
+
- `prompt` — Prompt text (positional argument)
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Notes
|
|
41
|
+
- Flags can be combined with prompts, e.g.:
|
|
42
|
+
`lm -m smollm:360m -n "Hello world"`
|
|
43
|
+
- `--force` applies to `lmConfig --add-model` (overwrite alias conflicts) and `lmConfig --init` (skip server verification).
|
|
44
|
+
- Future flags will be added here as they are introduced.
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.2.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 2, 0, '
|
|
21
|
+
__version__ = version = '0.2.0rc2'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 2, 0, 'rc2')
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|