lemonpie-cli 0.2.0b1__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.
Files changed (38) hide show
  1. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/.github/workflows/release.yml +3 -0
  2. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/.gitignore +1 -0
  3. lemonpie_cli-0.2.0rc2/.release-please/manifest.json +3 -0
  4. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/CHANGELOG.md +20 -0
  5. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/PKG-INFO +45 -51
  6. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/README.md +40 -50
  7. lemonpie_cli-0.2.0rc2/docs/ROADMAP.md +34 -0
  8. lemonpie_cli-0.2.0rc2/docs/design/code-completion.md +108 -0
  9. lemonpie_cli-0.2.0b1/docs/design/state-machine.md → lemonpie_cli-0.2.0rc2/docs/design/model-verification.md +3 -1
  10. lemonpie_cli-0.2.0rc2/docs/design/packaging.md +90 -0
  11. lemonpie_cli-0.2.0rc2/docs/usage/command-index.md +44 -0
  12. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/pyproject.toml +6 -0
  13. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/_version.py +2 -2
  14. lemonpie_cli-0.2.0rc2/src/lemonpie/cli/config_cmd.py +527 -0
  15. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/config.py +30 -4
  16. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/engine/ollama.py +2 -2
  17. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/main.py +13 -18
  18. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/paths.py +1 -0
  19. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/sessions/storage.py +6 -2
  20. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/time_utils.py +4 -3
  21. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/tests/conftest.py +2 -3
  22. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/tests/test_cli.py +10 -0
  23. lemonpie_cli-0.2.0rc2/tests/test_config_cmd.py +439 -0
  24. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/tests/test_sessions.py +0 -1
  25. lemonpie_cli-0.2.0b1/.release-please/manifest.json +0 -3
  26. lemonpie_cli-0.2.0b1/src/lemonpie/cli/config_cmd.py +0 -246
  27. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/.github/workflows/ci.yml +0 -0
  28. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/.release-please/config.json +0 -0
  29. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/LICENSE +0 -0
  30. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2/docs}/config.example.json +0 -0
  31. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/__init__.py +0 -0
  32. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/cli/__init__.py +0 -0
  33. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/cli/parser.py +0 -0
  34. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/cli/ui.py +0 -0
  35. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/engine/__init__.py +0 -0
  36. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/engine/models.py +0 -0
  37. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/src/lemonpie/sessions/__init__.py +0 -0
  38. {lemonpie_cli-0.2.0b1 → lemonpie_cli-0.2.0rc2}/uv.lock +0 -0
@@ -58,6 +58,9 @@ jobs:
58
58
  - name: Set up Python
59
59
  run: uv python install
60
60
 
61
+ - name: Run tests
62
+ run: uv run pytest
63
+
61
64
  - name: Build package artifacts
62
65
  run: uv build
63
66
 
@@ -30,3 +30,4 @@ Thumbs.db
30
30
 
31
31
  # Secrets & Environment Variables
32
32
  .env
33
+ .test-env/
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.2.0-rc2"
3
+ }
@@ -1,5 +1,25 @@
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
+
16
+ ## [0.2.0-rc1](https://github.com/famousStratum/LemonPie/compare/v0.2.0-beta.1...v0.2.0-rc1) (2026-09-22)
17
+
18
+
19
+ ### Miscellaneous Chores
20
+
21
+ * ignore .test-env/ ([#32](https://github.com/famousStratum/LemonPie/issues/32)) ([3045077](https://github.com/famousStratum/LemonPie/commit/30450770de3441e5e4e078c5151abd9763d5098f))
22
+
3
23
  ## [0.2.0-beta.1](https://github.com/famousStratum/LemonPie/compare/v0.2.0-alpha.3...v0.2.0-beta.1) (2026-09-22)
4
24
 
5
25
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lemonpie-cli
3
- Version: 0.2.0b1
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
@@ -8,6 +8,10 @@ Project-URL: issues, https://github.com/famousStratum/LemonPie/issues
8
8
  Author-email: famousStratum <info@versicode.com>
9
9
  License-Expression: GPL-3.0-or-later
10
10
  License-File: LICENSE
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
11
15
  Requires-Python: >=3.11
12
16
  Requires-Dist: httpx
13
17
  Requires-Dist: ollama
@@ -16,26 +20,28 @@ Description-Content-Type: text/markdown
16
20
 
17
21
  # LemonPie
18
22
 
19
- **The ultra‑lightweight Ollama session manager for terminal workflows**
20
-
21
- ![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FfamousStratum%2FLemonPie%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)
23
+ ![PyPI Version](https://img.shields.io/pypi/v/lemonpie-cli)
22
24
  ![GitHub License](https://img.shields.io/github/license/famousstratum/lemonpie)
25
+ ![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FfamousStratum%2FLemonPie%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)
26
+
27
+ **LemonPie — A lightweight Ollama client for terminal users**
23
28
 
24
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.
25
30
 
26
- ---
31
+
27
32
 
28
33
  ## ✨ Features
29
34
  - Start and manage chat sessions with Ollama models
30
35
  - Persist session history in your OS's standard user data directory
31
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
32
38
  - Add, remove, and list models with aliases (`lmConfig`)
33
39
  - Switch models mid‑session with confirmation
34
40
  - Atomic writes for safety (tmp + replace)
35
41
  - Streaming responses from Ollama for real‑time output
36
42
  - Graceful handling of Ctrl‑C interrupts
37
43
 
38
- ---
44
+
39
45
 
40
46
  ## 📂 Project Structure
41
47
 
@@ -46,34 +52,41 @@ LemonPie/
46
52
  │ ├── main.py # CLI session manager (entrypoints: lm, lemonpie)
47
53
  │ ├── config.py # Configuration logic & I/O
48
54
  │ ├── paths.py # OS-appropriate config/data directory resolution
49
- │ ├── model_utils.py # Model finding & resolution
50
- │ ├── cli_utils.py # Terminal helpers & confirmation
51
- │ ├── session_utils.py # Session persistence
52
- │ ├── spinner.py # Status spinner
53
55
  │ ├── time_utils.py # Timestamp helpers
54
- │ └── cli/
55
- │ └── config_cmd.py # Config manager (entrypoint: lmConfig)
56
- ├── config.example.json # Configuration template
56
+ │ ├── cli/
57
+ │ │ ├── parser.py # Argument parsing (lm)
58
+ │ │ ├── ui.py # Terminal helpers & confirmation
59
+ │ │ └── config_cmd.py # Config manager (entrypoint: lmConfig)
60
+ │ ├── engine/
61
+ │ │ ├── models.py # Model finding & resolution
62
+ │ │ └── ollama.py # Ollama client interaction
63
+ │ └── sessions/
64
+ │ └── storage.py # Session persistence
65
+ ├── tests/ # pytest suite
66
+ ├── docs/
67
+ │ ├── config.example.json # Configuration template
68
+ │ └── design/ # Design docs (model-verification.md, etc.)
69
+ ├── .github/workflows/ # CI & release pipelines
57
70
  ├── pyproject.toml # Package & build configuration
58
71
  ├── README.md # Project overview
59
72
  ├── LICENSE # GPLv3 license
60
73
  └── .gitignore
61
74
  ```
62
75
 
63
- ---
64
-
65
76
  ## ⚙️ Configuration
66
77
 
67
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:
68
79
 
69
- | | Linux | macOS | Windows |
70
- |------------|---------------------------------|----------------------------------------------|------------------------------|
71
- | Config | `~/.config/lemonpie/` | `~/Library/Application Support/lemonpie/` | `%LOCALAPPDATA%\lemonpie\` |
72
- | Sessions | `~/.local/share/lemonpie/sessions/` | `~/Library/Application Support/lemonpie/sessions/` | `%LOCALAPPDATA%\lemonpie\sessions\` |
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
+
73
86
 
74
87
  Both are overridable via environment variables — `LEMONPIE_CONFIG_DIR` and `LEMONPIE_SESSIONS_DIR` — useful for testing or running in a container.
75
88
 
76
- `config.example.json` at the repo root is a template. `lmConfig` will create your real config file on first use if one doesn't exist yet.
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.
77
90
 
78
91
  ### Example structure:
79
92
  ```json
@@ -90,11 +103,7 @@ server: Ollama host URL\
90
103
  default: canonical model name (full identifier)\
91
104
  models: list of objects with alias (nullable) and name
92
105
 
93
-
94
- ---
95
-
96
106
  ## 🚀 Usage
97
-
98
107
  ### `lm` / `lemonpie`
99
108
  - Start a new session \
100
109
  `lm -n "Hello"`
@@ -115,46 +124,31 @@ models: list of objects with alias (nullable) and name
115
124
  `lm -m qwen2.5-coder:3b`
116
125
 
117
126
  ### `lmConfig`
118
- - Manage models with lmConfig\
127
+ - First-time setup\
128
+ `lmConfig --init`
129
+
130
+ - First-time setup (skip server verification)\
131
+ `lmConfig --init --force`
132
+
133
+ - Manage models\
119
134
  `lmConfig --add-model qwen qwen2.5-coder:3b`\
120
135
  `lmConfig --list-models`\
121
136
  `lmConfig --remove-model qwen`
122
137
 
138
+ 👉 Full [command reference](docs/usage/command-index.md).
123
139
 
124
140
  ## 🗺 Roadmap
125
141
 
126
142
  Planned features and improvements:
127
143
 
128
- - `lmConfig --init`
129
- Interactive setup command that:
130
- - Prompts for Ollama server IP:port
131
- - Verifies server reachability
132
- - Lists available models if server responds
133
- - Allows user to select models to add
134
- - Handles cases where no models are found (with guidance to Ollama docs)
135
- - Supports `--force` to override verification or alias conflicts
136
-
137
- - Model verification state machine
138
- Planned logic for `lmConfig --add-model`:
139
- - Check server reachability
140
- - Verify if model is installed
141
- - Offer to pull missing models
142
- - Handle pull success/failure and user choice
143
- - Respect `--force` for overriding conflicts or skipping checks
144
- *(See docs/design/state-machine.md for full diagram once published)*
145
-
144
+ - Code completion (autocomplete)
145
+ - Model verification state machine
146
146
  - Enhanced error handling and user feedback
147
- - Graceful handling of server errors (HTTP codes, non‑JSON responses)
148
-
149
- - Packaging for Debian (`.deb` via apt)
147
+ - Cross‑platform packaging (apt, winget, Homebrew)
150
148
  - Future schema validation for config/session files
151
149
 
152
-
153
- ---
150
+ 👉 See the full [roadmap](docs/ROADMAP.md) for details.
154
151
 
155
152
  ## 📜 License
156
153
 
157
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.
158
-
159
-
160
- ---
@@ -1,25 +1,27 @@
1
1
  # LemonPie
2
2
 
3
- **The ultra‑lightweight Ollama session manager for terminal workflows**
4
-
5
- ![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FfamousStratum%2FLemonPie%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)
3
+ ![PyPI Version](https://img.shields.io/pypi/v/lemonpie-cli)
6
4
  ![GitHub License](https://img.shields.io/github/license/famousstratum/lemonpie)
5
+ ![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FfamousStratum%2FLemonPie%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)
6
+
7
+ **LemonPie — A lightweight Ollama client for terminal users**
7
8
 
8
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.
9
10
 
10
- ---
11
+
11
12
 
12
13
  ## ✨ Features
13
14
  - Start and manage chat sessions with Ollama models
14
15
  - Persist session history in your OS's standard user data directory
15
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
16
18
  - Add, remove, and list models with aliases (`lmConfig`)
17
19
  - Switch models mid‑session with confirmation
18
20
  - Atomic writes for safety (tmp + replace)
19
21
  - Streaming responses from Ollama for real‑time output
20
22
  - Graceful handling of Ctrl‑C interrupts
21
23
 
22
- ---
24
+
23
25
 
24
26
  ## 📂 Project Structure
25
27
 
@@ -30,34 +32,41 @@ LemonPie/
30
32
  │ ├── main.py # CLI session manager (entrypoints: lm, lemonpie)
31
33
  │ ├── config.py # Configuration logic & I/O
32
34
  │ ├── paths.py # OS-appropriate config/data directory resolution
33
- │ ├── model_utils.py # Model finding & resolution
34
- │ ├── cli_utils.py # Terminal helpers & confirmation
35
- │ ├── session_utils.py # Session persistence
36
- │ ├── spinner.py # Status spinner
37
35
  │ ├── time_utils.py # Timestamp helpers
38
- │ └── cli/
39
- │ └── config_cmd.py # Config manager (entrypoint: lmConfig)
40
- ├── config.example.json # Configuration template
36
+ │ ├── cli/
37
+ │ │ ├── parser.py # Argument parsing (lm)
38
+ │ │ ├── ui.py # Terminal helpers & confirmation
39
+ │ │ └── config_cmd.py # Config manager (entrypoint: lmConfig)
40
+ │ ├── engine/
41
+ │ │ ├── models.py # Model finding & resolution
42
+ │ │ └── ollama.py # Ollama client interaction
43
+ │ └── sessions/
44
+ │ └── storage.py # Session persistence
45
+ ├── tests/ # pytest suite
46
+ ├── docs/
47
+ │ ├── config.example.json # Configuration template
48
+ │ └── design/ # Design docs (model-verification.md, etc.)
49
+ ├── .github/workflows/ # CI & release pipelines
41
50
  ├── pyproject.toml # Package & build configuration
42
51
  ├── README.md # Project overview
43
52
  ├── LICENSE # GPLv3 license
44
53
  └── .gitignore
45
54
  ```
46
55
 
47
- ---
48
-
49
56
  ## ⚙️ Configuration
50
57
 
51
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:
52
59
 
53
- | | Linux | macOS | Windows |
54
- |------------|---------------------------------|----------------------------------------------|------------------------------|
55
- | Config | `~/.config/lemonpie/` | `~/Library/Application Support/lemonpie/` | `%LOCALAPPDATA%\lemonpie\` |
56
- | Sessions | `~/.local/share/lemonpie/sessions/` | `~/Library/Application Support/lemonpie/sessions/` | `%LOCALAPPDATA%\lemonpie\sessions\` |
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
+
57
66
 
58
67
  Both are overridable via environment variables — `LEMONPIE_CONFIG_DIR` and `LEMONPIE_SESSIONS_DIR` — useful for testing or running in a container.
59
68
 
60
- `config.example.json` at the repo root is a template. `lmConfig` will create your real config file on first use if one doesn't exist yet.
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.
61
70
 
62
71
  ### Example structure:
63
72
  ```json
@@ -74,11 +83,7 @@ server: Ollama host URL\
74
83
  default: canonical model name (full identifier)\
75
84
  models: list of objects with alias (nullable) and name
76
85
 
77
-
78
- ---
79
-
80
86
  ## 🚀 Usage
81
-
82
87
  ### `lm` / `lemonpie`
83
88
  - Start a new session \
84
89
  `lm -n "Hello"`
@@ -99,46 +104,31 @@ models: list of objects with alias (nullable) and name
99
104
  `lm -m qwen2.5-coder:3b`
100
105
 
101
106
  ### `lmConfig`
102
- - Manage models with lmConfig\
107
+ - First-time setup\
108
+ `lmConfig --init`
109
+
110
+ - First-time setup (skip server verification)\
111
+ `lmConfig --init --force`
112
+
113
+ - Manage models\
103
114
  `lmConfig --add-model qwen qwen2.5-coder:3b`\
104
115
  `lmConfig --list-models`\
105
116
  `lmConfig --remove-model qwen`
106
117
 
118
+ 👉 Full [command reference](docs/usage/command-index.md).
107
119
 
108
120
  ## 🗺 Roadmap
109
121
 
110
122
  Planned features and improvements:
111
123
 
112
- - `lmConfig --init`
113
- Interactive setup command that:
114
- - Prompts for Ollama server IP:port
115
- - Verifies server reachability
116
- - Lists available models if server responds
117
- - Allows user to select models to add
118
- - Handles cases where no models are found (with guidance to Ollama docs)
119
- - Supports `--force` to override verification or alias conflicts
120
-
121
- - Model verification state machine
122
- Planned logic for `lmConfig --add-model`:
123
- - Check server reachability
124
- - Verify if model is installed
125
- - Offer to pull missing models
126
- - Handle pull success/failure and user choice
127
- - Respect `--force` for overriding conflicts or skipping checks
128
- *(See docs/design/state-machine.md for full diagram once published)*
129
-
124
+ - Code completion (autocomplete)
125
+ - Model verification state machine
130
126
  - Enhanced error handling and user feedback
131
- - Graceful handling of server errors (HTTP codes, non‑JSON responses)
132
-
133
- - Packaging for Debian (`.deb` via apt)
127
+ - Cross‑platform packaging (apt, winget, Homebrew)
134
128
  - Future schema validation for config/session files
135
129
 
136
-
137
- ---
130
+ 👉 See the full [roadmap](docs/ROADMAP.md) for details.
138
131
 
139
132
  ## 📜 License
140
133
 
141
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.
142
-
143
-
144
- ---
@@ -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 State Machine
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.