Metadata-Version: 2.4
Name: losna-cli
Version: 0.1.2
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

Install Losna CLI directly from PyPI:

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

Alternatively, run it instantly without global installation using `uv`:

```bash
uvx losna-cli
```

## 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:

```bash
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.
