Metadata-Version: 2.4
Name: losna-cli
Version: 0.1.3
Summary: Losna CLI AI agent assistant
Project-URL: Homepage, https://github.com/snui1s/losna-cli
Project-URL: Repository, https://github.com/snui1s/losna-cli
Project-URL: Issues, https://github.com/snui1s/losna-cli/issues
Requires-Python: >=3.10
Requires-Dist: openrouter>=0.11.0
Requires-Dist: prompt-toolkit>=3.0.0
Requires-Dist: requests
Requires-Dist: rich>=10.0.0
Requires-Dist: yfinance>=1.5.0
Description-Content-Type: text/markdown

# Losna CLI

An advanced, terminal-based AI developer assistant designed to interface with OpenRouter APIs. Losna CLI streamlines complex workspace orchestration, code generation, diagnostics, and testing with a clean, light-weight terminal interface.

## Features

- **Interactive Shell:** Seamless conversational loop powered by OpenRouter models (defaults to Deepseek V4 Flash) with auto-suggestions, slash command autocompletion, and visual feedback.
- **Web Search Integration:** Optional, dynamic web search powered by Tavily. Prompts for API keys only when the search tool is requested.
- **Dynamic Task Execution:** Executes operations, tests, and file modifications safely through integrated agent tools.
- **Memory Compaction:** Automatically compresses conversational context to optimize token usage and maintain long-term memory constraints.
- **Local Persistence:** Encapsulates chat logs, sessions, and long-term memory in a local SQLite database.

## Installation & Execution

### Method 1: Using uv (Recommended & Fastest)

Running Losna CLI via `uvx` is the recommended method. It automatically manages Python, dependencies, and environment isolation without modifying your system's global state.

```bash
uvx losna-cli
```

*Note: If you do not have `uv` installed, you can install it instantly via `pip install uv` or visit [astral.sh/uv](https://astral.sh/uv).*

### Method 2: Standard pip Installation

Install Losna CLI directly from PyPI:

```bash
pip install losna-cli
```

Then start the interactive session:

```bash
losna
```

#### Troubleshooting command not found:
If your operating system returns an error stating that `losna` is not recognized, it means the Python `Scripts` directory is not configured in your OS `PATH` environment variable. You can bypass this by executing the package module directly using Python:

```bash
python -m main
# or if main module structure is registered:
python -c "import main; main.main()"
```

## Setup

Upon the first execution, Losna CLI will guide you through the setup process:

1. **OpenRouter API Key:** Required for core operations.
2. **Web Search Configuration:** Asks if you would like to enable the optional web search feature. If enabled, it will request your Tavily API key.

Your configuration keys are stored securely in your user home directory (`~/.losnarc`).

## Usage

Start the interactive session using your preferred execution method above (e.g. `uvx losna-cli` or `losna`).

### Slash Commands

- `/help` - Displays the help menu listing all commands.
- `/sessions` - Lists all active chat sessions and their IDs.
- `/new <title>` - Starts a new chat session with a custom title.
- `/switch <id>` - Switches to another chat session by its ID.
- `/search <query>` - Executes an agent-guided web search.
- `/exit` or `/quit` - Closes the active session.

## License

This project is licensed under the ISC License.
