lemonpie-cli 0.1.1__tar.gz → 0.2.0a3__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.1.1/.github/workflows/publish.yml → lemonpie_cli-0.2.0a3/.github/workflows/ci.yml +3 -2
- lemonpie_cli-0.2.0a3/.github/workflows/release.yml +64 -0
- {lemonpie_cli-0.1.1 → lemonpie_cli-0.2.0a3}/.gitignore +2 -5
- lemonpie_cli-0.2.0a3/.release-please/config.json +14 -0
- lemonpie_cli-0.2.0a3/.release-please/manifest.json +3 -0
- lemonpie_cli-0.2.0a3/CHANGELOG.md +35 -0
- {lemonpie_cli-0.1.1 → lemonpie_cli-0.2.0a3}/PKG-INFO +39 -22
- {lemonpie_cli-0.1.1 → lemonpie_cli-0.2.0a3}/README.md +144 -129
- {lemonpie_cli-0.1.1 → lemonpie_cli-0.2.0a3}/pyproject.toml +9 -7
- {lemonpie_cli-0.1.1 → lemonpie_cli-0.2.0a3/src}/lemonpie/_version.py +2 -2
- lemonpie_cli-0.2.0a3/src/lemonpie/cli/__init__.py +0 -0
- lemonpie_cli-0.1.1/lemonpie/lm_config.py → lemonpie_cli-0.2.0a3/src/lemonpie/cli/config_cmd.py +2 -2
- lemonpie_cli-0.1.1/lemonpie/cli_utils.py → lemonpie_cli-0.2.0a3/src/lemonpie/cli/parser.py +1 -21
- lemonpie_cli-0.1.1/lemonpie/spinner.py → lemonpie_cli-0.2.0a3/src/lemonpie/cli/ui.py +31 -3
- lemonpie_cli-0.2.0a3/src/lemonpie/engine/__init__.py +0 -0
- lemonpie_cli-0.1.1/lemonpie/model_utils.py → lemonpie_cli-0.2.0a3/src/lemonpie/engine/models.py +29 -30
- lemonpie_cli-0.2.0a3/src/lemonpie/engine/ollama.py +49 -0
- lemonpie_cli-0.1.1/lemonpie/lm.py → lemonpie_cli-0.2.0a3/src/lemonpie/main.py +41 -73
- lemonpie_cli-0.2.0a3/src/lemonpie/paths.py +26 -0
- lemonpie_cli-0.2.0a3/src/lemonpie/sessions/__init__.py +0 -0
- lemonpie_cli-0.1.1/lemonpie/session_utils.py → lemonpie_cli-0.2.0a3/src/lemonpie/sessions/storage.py +1 -2
- lemonpie_cli-0.2.0a3/uv.lock +256 -0
- lemonpie_cli-0.1.1/.github/workflows/release.yml +0 -33
- lemonpie_cli-0.1.1/lemonpie/paths.py +0 -20
- lemonpie_cli-0.1.1/sessions/.gitkeep +0 -1
- lemonpie_cli-0.1.1/uv.lock +0 -548
- {lemonpie_cli-0.1.1 → lemonpie_cli-0.2.0a3}/LICENSE +0 -0
- {lemonpie_cli-0.1.1 → lemonpie_cli-0.2.0a3}/config.example.json +0 -0
- {lemonpie_cli-0.1.1 → lemonpie_cli-0.2.0a3}/docs/design/state-machine.md +0 -0
- {lemonpie_cli-0.1.1 → lemonpie_cli-0.2.0a3/src}/lemonpie/__init__.py +0 -0
- {lemonpie_cli-0.1.1 → lemonpie_cli-0.2.0a3/src}/lemonpie/config.py +0 -0
- {lemonpie_cli-0.1.1 → lemonpie_cli-0.2.0a3/src}/lemonpie/time_utils.py +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Release & Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
release-please:
|
|
15
|
+
name: Manage Release PR & Tags
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
outputs:
|
|
18
|
+
release_created: ${{ steps.release.outputs.releases_created }}
|
|
19
|
+
tag_name: ${{ steps.release.outputs.tag_name }}
|
|
20
|
+
steps:
|
|
21
|
+
- uses: googleapis/release-please-action@v4
|
|
22
|
+
id: release
|
|
23
|
+
with:
|
|
24
|
+
config-file: .release-please/config.json
|
|
25
|
+
manifest-file: .release-please/manifest.json
|
|
26
|
+
|
|
27
|
+
pypi-publish:
|
|
28
|
+
name: Build and publish to PyPI
|
|
29
|
+
needs: release-please
|
|
30
|
+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
environment: pypi
|
|
33
|
+
permissions:
|
|
34
|
+
id-token: write # Required for Trusted Publisher OIDC authentication
|
|
35
|
+
|
|
36
|
+
steps:
|
|
37
|
+
- name: Check out repository
|
|
38
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
39
|
+
with:
|
|
40
|
+
fetch-depth: 0 # Required for hatch-vcs to inspect git history & tags
|
|
41
|
+
|
|
42
|
+
- name: Verify tag is reachable from main
|
|
43
|
+
run: |
|
|
44
|
+
git fetch origin main
|
|
45
|
+
if git merge-base --is-ancestor "${{ github.sha }}" origin/main; then
|
|
46
|
+
echo "Commit ${{ github.sha }} is on main. Proceeding."
|
|
47
|
+
else
|
|
48
|
+
echo "::error::Commit ${{ github.sha }} is not reachable from origin/main. Refusing to publish."
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
- name: Install uv
|
|
53
|
+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
|
54
|
+
with:
|
|
55
|
+
version: "0.12.17"
|
|
56
|
+
|
|
57
|
+
- name: Set up Python
|
|
58
|
+
run: uv python install
|
|
59
|
+
|
|
60
|
+
- name: Build package artifacts
|
|
61
|
+
run: uv build
|
|
62
|
+
|
|
63
|
+
- name: Publish to PyPI
|
|
64
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"release-type": "python",
|
|
3
|
+
"packages": {
|
|
4
|
+
".": {
|
|
5
|
+
"package-name": "lemonpie-cli",
|
|
6
|
+
"changelog-path": "CHANGELOG.md",
|
|
7
|
+
"bump-minor-pre-major": true,
|
|
8
|
+
"bump-patch-for-minor-pre-major": true,
|
|
9
|
+
"prerelease": true,
|
|
10
|
+
"versioning": "prerelease",
|
|
11
|
+
"include-component-in-tag": false
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.2.0-alpha.3](https://github.com/famousStratum/LemonPie/compare/v0.2.0-alpha.2...v0.2.0-alpha.3) (2026-09-21)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* resolve tuple/dict mismatch in model alias lookup and dead code in session loading ([#23](https://github.com/famousStratum/LemonPie/issues/23)) ([65152bf](https://github.com/famousStratum/LemonPie/commit/65152bf9d6df0d91addad5aa72f73145383b99d9))
|
|
9
|
+
|
|
10
|
+
## [0.2.0-alpha.2](https://github.com/famousStratum/LemonPie/compare/lemonpie-cli-v0.2.0-alpha.1...lemonpie-cli-v0.2.0-alpha.2) (2026-09-21)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **cli:** enhance error handling, model defaults, timeouts, and connection status ([9147dc0](https://github.com/famousStratum/LemonPie/commit/9147dc0293065f0b2227ac8f36cdacf0502ca7c4))
|
|
16
|
+
* **cli:** improve connection error handling, timeouts, and documentation ([83e2659](https://github.com/famousStratum/LemonPie/commit/83e2659182717d82feb28be4b85d14e85679d751))
|
|
17
|
+
* **paths:** Depend on platformdirs for config/session paths; bump requires-python to >=3.11 ([6fbf8e9](https://github.com/famousStratum/LemonPie/commit/6fbf8e92d27cbec20c57f404aecf99940329b238))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **build:** explicitly specify hatchling wheel package directory ([705980a](https://github.com/famousStratum/LemonPie/commit/705980a9eda1672829119db0fcd2aab4a9c04101))
|
|
23
|
+
* **build:** specify hatchling package target ([b759f2d](https://github.com/famousStratum/LemonPie/commit/b759f2d086bccb7b39d456844d1bb7403410e8d4))
|
|
24
|
+
* **cli:** import missing resolve_session in main entrypoint ([f5c4c5a](https://github.com/famousStratum/LemonPie/commit/f5c4c5ae1cc7ade21ba41eb92a9ecc640a7fe969))
|
|
25
|
+
* **cli:** reorder main entrypoint control flow and fix argument handling ([3a182d2](https://github.com/famousStratum/LemonPie/commit/3a182d2485af36f8a98a28cb41459f968fc9f4d4))
|
|
26
|
+
* **cli:** reorder main entrypoint control flow and resolve model assignment ([ad944f9](https://github.com/famousStratum/LemonPie/commit/ad944f93e2661eb3f2cc1abfe6cdeedc04f6ee86))
|
|
27
|
+
* **cli:** resolve NameError in main entrypoint ([532d661](https://github.com/famousStratum/LemonPie/commit/532d6617ff589de5f5def690e6390b1341517f84))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Documentation
|
|
31
|
+
|
|
32
|
+
* Add roadmap section to README and initial state-machine design doc ([fa9b000](https://github.com/famousStratum/LemonPie/commit/fa9b0009aaca85cbcd3e5a6f1e1c6c4d3bc40196))
|
|
33
|
+
* update README for src/ layout and platformdirs ([a15cde2](https://github.com/famousStratum/LemonPie/commit/a15cde25a08c49d11366bc64c31aa80da9590838))
|
|
34
|
+
* update README.md ([cf7a046](https://github.com/famousStratum/LemonPie/commit/cf7a0468474cc6bb47dbf33148a6b18d11b44fdf))
|
|
35
|
+
* update roadmap in README.md ([d0a3316](https://github.com/famousStratum/LemonPie/commit/d0a33167361efd400682f54780aaf3fff738e41d))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: lemonpie-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0a3
|
|
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,8 +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
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Requires-Dist: httpx
|
|
12
13
|
Requires-Dist: ollama
|
|
14
|
+
Requires-Dist: platformdirs
|
|
13
15
|
Description-Content-Type: text/markdown
|
|
14
16
|
|
|
15
17
|
# LemonPie
|
|
@@ -25,8 +27,8 @@ LemonPie is a compact CLI for interacting with an Ollama server. It manages chat
|
|
|
25
27
|
|
|
26
28
|
## ✨ Features
|
|
27
29
|
- Start and manage chat sessions with Ollama models
|
|
28
|
-
- Persist session history
|
|
29
|
-
- Configure host, default model, and aliases via
|
|
30
|
+
- Persist session history in your OS's standard user data directory
|
|
31
|
+
- Configure host, default model, and aliases via a config file in your OS's standard user config directory
|
|
30
32
|
- Add, remove, and list models with aliases (`lmConfig`)
|
|
31
33
|
- Switch models mid‑session with confirmation
|
|
32
34
|
- Atomic writes for safety (tmp + replace)
|
|
@@ -38,25 +40,41 @@ LemonPie is a compact CLI for interacting with an Ollama server. It manages chat
|
|
|
38
40
|
## 📂 Project Structure
|
|
39
41
|
|
|
40
42
|
```text
|
|
41
|
-
|
|
42
|
-
├──
|
|
43
|
-
│
|
|
44
|
-
│
|
|
45
|
-
│
|
|
46
|
-
│
|
|
47
|
-
│
|
|
48
|
-
│
|
|
49
|
-
├──
|
|
50
|
-
├──
|
|
51
|
-
├──
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
LemonPie/
|
|
44
|
+
├── src/
|
|
45
|
+
│ └── lemonpie/ # Core package namespace
|
|
46
|
+
│ ├── main.py # CLI session manager (entrypoints: lm, lemonpie)
|
|
47
|
+
│ ├── config.py # Configuration logic & I/O
|
|
48
|
+
│ ├── 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
|
+
│ ├── time_utils.py # Timestamp helpers
|
|
54
|
+
│ └── cli/
|
|
55
|
+
│ └── config_cmd.py # Config manager (entrypoint: lmConfig)
|
|
56
|
+
├── config.example.json # Configuration template
|
|
57
|
+
├── pyproject.toml # Package & build configuration
|
|
58
|
+
├── README.md # Project overview
|
|
59
|
+
├── LICENSE # GPLv3 license
|
|
60
|
+
└── .gitignore
|
|
55
61
|
```
|
|
56
62
|
|
|
57
63
|
---
|
|
58
64
|
|
|
59
|
-
## ⚙️ Configuration
|
|
65
|
+
## ⚙️ Configuration
|
|
66
|
+
|
|
67
|
+
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
|
+
|
|
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\` |
|
|
73
|
+
|
|
74
|
+
Both are overridable via environment variables — `LEMONPIE_CONFIG_DIR` and `LEMONPIE_SESSIONS_DIR` — useful for testing or running in a container.
|
|
75
|
+
|
|
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.
|
|
77
|
+
|
|
60
78
|
### Example structure:
|
|
61
79
|
```json
|
|
62
80
|
{
|
|
@@ -77,7 +95,7 @@ models: list of objects with alias (nullable) and name
|
|
|
77
95
|
|
|
78
96
|
## 🚀 Usage
|
|
79
97
|
|
|
80
|
-
### lm
|
|
98
|
+
### `lm` / `lemonpie`
|
|
81
99
|
- Start a new session \
|
|
82
100
|
`lm -n "Hello"`
|
|
83
101
|
|
|
@@ -96,7 +114,7 @@ models: list of objects with alias (nullable) and name
|
|
|
96
114
|
- Switch model in current session\
|
|
97
115
|
`lm -m qwen2.5-coder:3b`
|
|
98
116
|
|
|
99
|
-
### lmConfig
|
|
117
|
+
### `lmConfig`
|
|
100
118
|
- Manage models with lmConfig\
|
|
101
119
|
`lmConfig --add-model qwen qwen2.5-coder:3b`\
|
|
102
120
|
`lmConfig --list-models`\
|
|
@@ -140,4 +158,3 @@ This project is licensed under the **GNU General Public License v3.0** (**GPLv3*
|
|
|
140
158
|
|
|
141
159
|
|
|
142
160
|
---
|
|
143
|
-
|
|
@@ -1,129 +1,144 @@
|
|
|
1
|
-
# LemonPie
|
|
2
|
-
|
|
3
|
-
**The ultra‑lightweight Ollama session manager for terminal workflows**
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
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
|
-
---
|
|
11
|
-
|
|
12
|
-
## ✨ Features
|
|
13
|
-
- Start and manage chat sessions with Ollama models
|
|
14
|
-
- Persist session history
|
|
15
|
-
- Configure host, default model, and aliases via
|
|
16
|
-
- Add, remove, and list models with aliases (`lmConfig`)
|
|
17
|
-
- Switch models mid‑session with confirmation
|
|
18
|
-
- Atomic writes for safety (tmp + replace)
|
|
19
|
-
- Streaming responses from Ollama for real‑time output
|
|
20
|
-
- Graceful handling of Ctrl‑C interrupts
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## 📂 Project Structure
|
|
25
|
-
|
|
26
|
-
```text
|
|
27
|
-
|
|
28
|
-
├──
|
|
29
|
-
│
|
|
30
|
-
│
|
|
31
|
-
│
|
|
32
|
-
│
|
|
33
|
-
│
|
|
34
|
-
│
|
|
35
|
-
├──
|
|
36
|
-
├──
|
|
37
|
-
├──
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
`
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
1
|
+
# LemonPie
|
|
2
|
+
|
|
3
|
+
**The ultra‑lightweight Ollama session manager for terminal workflows**
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
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
|
+
---
|
|
11
|
+
|
|
12
|
+
## ✨ Features
|
|
13
|
+
- Start and manage chat sessions with Ollama models
|
|
14
|
+
- Persist session history in your OS's standard user data directory
|
|
15
|
+
- Configure host, default model, and aliases via a config file in your OS's standard user config directory
|
|
16
|
+
- Add, remove, and list models with aliases (`lmConfig`)
|
|
17
|
+
- Switch models mid‑session with confirmation
|
|
18
|
+
- Atomic writes for safety (tmp + replace)
|
|
19
|
+
- Streaming responses from Ollama for real‑time output
|
|
20
|
+
- Graceful handling of Ctrl‑C interrupts
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 📂 Project Structure
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
LemonPie/
|
|
28
|
+
├── src/
|
|
29
|
+
│ └── lemonpie/ # Core package namespace
|
|
30
|
+
│ ├── main.py # CLI session manager (entrypoints: lm, lemonpie)
|
|
31
|
+
│ ├── config.py # Configuration logic & I/O
|
|
32
|
+
│ ├── 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
|
+
│ ├── time_utils.py # Timestamp helpers
|
|
38
|
+
│ └── cli/
|
|
39
|
+
│ └── config_cmd.py # Config manager (entrypoint: lmConfig)
|
|
40
|
+
├── config.example.json # Configuration template
|
|
41
|
+
├── pyproject.toml # Package & build configuration
|
|
42
|
+
├── README.md # Project overview
|
|
43
|
+
├── LICENSE # GPLv3 license
|
|
44
|
+
└── .gitignore
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## ⚙️ Configuration
|
|
50
|
+
|
|
51
|
+
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
|
+
|
|
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\` |
|
|
57
|
+
|
|
58
|
+
Both are overridable via environment variables — `LEMONPIE_CONFIG_DIR` and `LEMONPIE_SESSIONS_DIR` — useful for testing or running in a container.
|
|
59
|
+
|
|
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.
|
|
61
|
+
|
|
62
|
+
### Example structure:
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"server": "http://127.0.0.1:11434",
|
|
66
|
+
"default": "qwen2.5-coder:3b",
|
|
67
|
+
"models": [
|
|
68
|
+
{ "alias": "qwen", "name": "qwen2.5-coder:3b" },
|
|
69
|
+
{ "alias": null, "name": "qwen2.5-coder:1.5b-base" }
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
server: Ollama host URL\
|
|
74
|
+
default: canonical model name (full identifier)\
|
|
75
|
+
models: list of objects with alias (nullable) and name
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 🚀 Usage
|
|
81
|
+
|
|
82
|
+
### `lm` / `lemonpie`
|
|
83
|
+
- Start a new session \
|
|
84
|
+
`lm -n "Hello"`
|
|
85
|
+
|
|
86
|
+
- Start with a specific model\
|
|
87
|
+
`lm -n -m qwen "Hello"`
|
|
88
|
+
|
|
89
|
+
- Send a prompt to the current session\
|
|
90
|
+
`lm "Tell me about git add"`
|
|
91
|
+
|
|
92
|
+
- List sessions\
|
|
93
|
+
`lm -l`
|
|
94
|
+
|
|
95
|
+
- Print current session history\
|
|
96
|
+
`lm -p`
|
|
97
|
+
|
|
98
|
+
- Switch model in current session\
|
|
99
|
+
`lm -m qwen2.5-coder:3b`
|
|
100
|
+
|
|
101
|
+
### `lmConfig`
|
|
102
|
+
- Manage models with lmConfig\
|
|
103
|
+
`lmConfig --add-model qwen qwen2.5-coder:3b`\
|
|
104
|
+
`lmConfig --list-models`\
|
|
105
|
+
`lmConfig --remove-model qwen`
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
## 🗺 Roadmap
|
|
109
|
+
|
|
110
|
+
Planned features and improvements:
|
|
111
|
+
|
|
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
|
+
|
|
130
|
+
- 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)
|
|
134
|
+
- Future schema validation for config/session files
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 📜 License
|
|
140
|
+
|
|
141
|
+
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
|
+
---
|
|
@@ -11,10 +11,12 @@ authors = [
|
|
|
11
11
|
]
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
license = "GPL-3.0-or-later"
|
|
14
|
-
requires-python = ">=3.
|
|
14
|
+
requires-python = ">=3.11"
|
|
15
15
|
|
|
16
16
|
dependencies = [
|
|
17
|
-
"ollama"
|
|
17
|
+
"ollama",
|
|
18
|
+
"httpx",
|
|
19
|
+
"platformdirs"
|
|
18
20
|
]
|
|
19
21
|
|
|
20
22
|
[project.urls]
|
|
@@ -23,15 +25,15 @@ repository = "https://github.com/famousStratum/LemonPie"
|
|
|
23
25
|
issues = "https://github.com/famousStratum/LemonPie/issues"
|
|
24
26
|
|
|
25
27
|
[project.scripts]
|
|
26
|
-
lm = "lemonpie.
|
|
27
|
-
lemonpie = "lemonpie.
|
|
28
|
-
lmConfig = "lemonpie.
|
|
28
|
+
lm = "lemonpie.main:main"
|
|
29
|
+
lemonpie = "lemonpie.main:main"
|
|
30
|
+
lmConfig = "lemonpie.cli.config_cmd:main"
|
|
29
31
|
|
|
30
32
|
[tool.hatch.version]
|
|
31
33
|
source = "vcs"
|
|
32
34
|
|
|
33
35
|
[tool.hatch.build.hooks.vcs]
|
|
34
|
-
version-file = "lemonpie/_version.py"
|
|
36
|
+
version-file = "src/lemonpie/_version.py"
|
|
35
37
|
|
|
36
38
|
[tool.hatch.build.targets.wheel]
|
|
37
|
-
packages = ["lemonpie"]
|
|
39
|
+
packages = ["src/lemonpie"]
|
|
@@ -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.
|
|
22
|
-
__version_tuple__ = version_tuple = (0,
|
|
21
|
+
__version__ = version = '0.2.0a3'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 2, 0, 'a3')
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
File without changes
|
lemonpie_cli-0.1.1/lemonpie/lm_config.py → lemonpie_cli-0.2.0a3/src/lemonpie/cli/config_cmd.py
RENAMED
|
@@ -15,8 +15,8 @@ import argparse, json, os, sys
|
|
|
15
15
|
from urllib.parse import urlparse
|
|
16
16
|
|
|
17
17
|
from lemonpie.paths import CONFIG_FILE
|
|
18
|
-
from lemonpie.
|
|
19
|
-
from lemonpie.
|
|
18
|
+
from lemonpie.cli.ui import confirm
|
|
19
|
+
from lemonpie.engine.models import (
|
|
20
20
|
find_by_alias,
|
|
21
21
|
find_by_name,
|
|
22
22
|
)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
|
|
3
|
-
from lemonpie.session_utils import list_sessions, read_current
|
|
4
|
-
|
|
5
3
|
try:
|
|
6
4
|
from lemonpie._version import __version__
|
|
7
5
|
except ImportError:
|
|
8
6
|
__version__ = "0.0.0.dev0"
|
|
9
7
|
|
|
8
|
+
|
|
10
9
|
def build_parser():
|
|
11
10
|
parser = argparse.ArgumentParser(prog="lm", description="Run LemonPie with a given model or prompt")
|
|
12
11
|
parser.add_argument("-v", "--version", action="version", version=f"%(prog)s {__version__}")
|
|
@@ -21,22 +20,3 @@ def build_parser():
|
|
|
21
20
|
parser.add_argument("--delete-all", action="store_true", help="Delete all stored sessions")
|
|
22
21
|
parser.add_argument("prompt", nargs="*", help="Prompt text")
|
|
23
22
|
return parser
|
|
24
|
-
|
|
25
|
-
def confirm(prompt):
|
|
26
|
-
ans = input(f"{prompt} (y/N): ").strip().lower()
|
|
27
|
-
return ans in ("y", "yes")
|
|
28
|
-
|
|
29
|
-
def print_session(session):
|
|
30
|
-
print(f"Session {session['id']} — {session.get('title') or '<no title>'}")
|
|
31
|
-
for turn in session["history"]:
|
|
32
|
-
role = turn["role"]
|
|
33
|
-
content = turn["content"]
|
|
34
|
-
print(f"{role} [{turn.get('ts','')}] : {content}")
|
|
35
|
-
|
|
36
|
-
def print_sessions_list():
|
|
37
|
-
sessions = list_sessions()
|
|
38
|
-
if not sessions:
|
|
39
|
-
print("No sessions found.")
|
|
40
|
-
return
|
|
41
|
-
for sid, title, created, updated, is_current in sessions:
|
|
42
|
-
print(f"{is_current} {sid} {title} created: {created}, updated: {updated}")
|