mobile version styled -ready for new version 2.0.1

This commit is contained in:
2025-10-22 18:37:08 +06:00
parent 344f763bb4
commit e37599d3ef
28 changed files with 4998 additions and 2224 deletions

View File

@@ -48,8 +48,10 @@ Clipboard support requires `xclip` or `xsel`.
- `LCG_RESULT_HISTORY` (default `$(LCG_RESULT_FOLDER)/lcg_history.json`) — JSON history path
- `LCG_PROMPT_FOLDER` (default `~/.config/lcg/gpt_sys_prompts`) — folder for system prompts
- `LCG_PROMPT_ID` (default `1`) — default system prompt ID
- `LCG_BROWSER_PATH` — custom browser executable path for `--browser` flag
- `LCG_JWT_TOKEN` — JWT token for proxy provider
- `LCG_NO_HISTORY` — if `1`/`true`, disables history writes for the process
- `LCG_ALLOW_EXECUTION` — if `1`/`true`, enables command execution via `(e)` action menu
- `LCG_SERVER_PORT` (default `8080`), `LCG_SERVER_HOST` (default `localhost`) — HTTP server settings
## Flags
@@ -72,7 +74,9 @@ Clipboard support requires `xclip` or `xsel`.
- `history list` — list history from JSON
- `history view <index>` — view by index
- `history delete <index>` — delete by index (re-numbering)
- `serve-result` — start HTTP server to browse saved results (`--port`, `--host`)
- `serve` — start HTTP server to browse saved results (`--port`, `--host`, `--browser`)
- `/run` — web interface for executing requests
- `/execute` — API endpoint for programmatic access via curl
## Saving results
@@ -95,4 +99,64 @@ Files are saved to `LCG_RESULT_FOLDER` (default `~/.config/lcg/gpt_results`).
- On new request, if the same command exists, you will be prompted to view or overwrite.
- Showing from history does not call the API; the standard action menu is shown.
## Browser Integration
The `serve` command supports automatic browser opening:
```bash
# Start server and open browser automatically
lcg serve --browser
# Use custom browser
export LCG_BROWSER_PATH="/usr/bin/firefox"
lcg serve --browser
# Start on custom host/port with browser
lcg serve --host 0.0.0.0 --port 9000 --browser
```
Supported browsers (in priority order):
- Yandex Browser (`yandex-browser`, `yandex-browser-stable`)
- Mozilla Firefox (`firefox`, `firefox-esr`)
- Google Chrome (`google-chrome`, `google-chrome-stable`)
- Chromium (`chromium`, `chromium-browser`)
## API Access
The `serve` command provides both a web interface and REST API:
**Web Interface:**
- Browse results at `http://localhost:8080/`
- Execute requests at `http://localhost:8080/run`
- Manage prompts at `http://localhost:8080/prompts`
- View history at `http://localhost:8080/history`
**REST API:**
```bash
# Start server
lcg serve
# Make API request
curl -X POST http://localhost:8080/execute \
-H "Content-Type: application/json" \
-d '{"prompt": "create directory test", "verbose": "vv"}'
```
**Response:**
```json
{
"success": true,
"command": "mkdir test",
"explanation": "The mkdir command creates a new directory...",
"model": "hf.co/yandex/YandexGPT-5-Lite-8B-instruct-GGUF:Q4_K_M",
"elapsed": 1.23
}
```
For complete API documentation, see `API_GUIDE.md`.
For full guide in Russian, see `USAGE_GUIDE.md`.