Metadata-Version: 2.4
Name: localagentcli
Version: 0.2.0
Summary: A production-grade, local-first AI CLI
Author: rainzhang05
License-Expression: MIT
Project-URL: Homepage, https://github.com/rainzhang05/LocalAgentCLI
Project-URL: Repository, https://github.com/rainzhang05/LocalAgentCLI
Project-URL: Issues, https://github.com/rainzhang05/LocalAgentCLI/issues
Project-URL: Changelog, https://github.com/rainzhang05/LocalAgentCLI/blob/main/CHANGELOG.md
Keywords: ai,agent,cli,llm,local models
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: prompt-toolkit>=3.0
Requires-Dist: rich>=13.0
Requires-Dist: click>=8.0
Requires-Dist: toml>=0.10
Requires-Dist: filelock>=3.12
Requires-Dist: httpx>=0.25
Requires-Dist: keyring>=24.0
Requires-Dist: huggingface-hub>=0.20
Provides-Extra: mlx
Requires-Dist: mlx>=0.5; extra == "mlx"
Requires-Dist: mlx-lm>=0.5; extra == "mlx"
Provides-Extra: gguf
Requires-Dist: llama-cpp-python>=0.2; extra == "gguf"
Provides-Extra: torch
Requires-Dist: torch>=2.0; extra == "torch"
Requires-Dist: transformers>=4.35; extra == "torch"
Requires-Dist: safetensors>=0.4; extra == "torch"
Provides-Extra: all
Requires-Dist: mlx>=0.5; extra == "all"
Requires-Dist: mlx-lm>=0.5; extra == "all"
Requires-Dist: llama-cpp-python>=0.2; extra == "all"
Requires-Dist: torch>=2.0; extra == "all"
Requires-Dist: transformers>=4.35; extra == "all"
Requires-Dist: safetensors>=0.4; extra == "all"
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: ruff>=0.1; extra == "dev"
Requires-Dist: mypy>=1.5; extra == "dev"
Requires-Dist: twine>=5.1; extra == "dev"
Requires-Dist: types-toml>=0.10; extra == "dev"
Dynamic: license-file

# LocalAgentCLI

LocalAgentCLI is a local-first AI command-line assistant with a persistent shell, chat and agent modes, remote and local model backends, tool execution, session restore, and a centralized safety layer.

## Features

- Interactive `localagentcli` shell with slash commands, history, tab completion, and streaming output
- Remote provider support for OpenAI-compatible, Anthropic, and generic REST APIs
- Local model support for MLX, GGUF, and safetensors backends
- Chat mode with context compaction, pinned instructions, and automatic repository-root `AGENTS.md` loading
- Agent mode with planning, tool execution, approvals, rollback, and undo support
- Persistent config, model registry, sessions, logs, and cache under `~/.localagent/`

## Installation

Recommended:

```bash
pipx install localagentcli
```

Development install:

```bash
git clone https://github.com/rainzhang05/LocalAgentCLI.git
cd LocalAgentCLI
pip install -e ".[dev]"
```

Optional backend extras can be installed manually:

```bash
pip install "localagentcli[mlx]"
pip install "localagentcli[gguf]"
pip install "localagentcli[torch]"
pip install "localagentcli[all]"
```

LocalAgentCLI also prompts to install missing backend dependencies automatically the first time you load a local model that needs them.

## Quick Start

Launch the shell:

```bash
localagentcli
```

`localagent` remains available as a compatibility alias.

On first launch the setup wizard creates `~/.localagent/config.toml`.

Common commands:

```text
/help
/status
/setup
/mode chat
/mode agent
/set
/models
/providers list
/session save my-work
/session load my-work
```

## Local and Remote Models

Remote providers:

- `/providers add`
- `/providers list`
- `/providers test <name>`

Local models:

- `/set` to choose the active local model or provider model interactively
- `/models` for the interactive Hugging Face picker (backend → family → live Hub-discovered model) with continuously refreshed download progress
- `/models install hf <repo>`
- `/models install url <url>`
- `/models list`
- `/models inspect <name[@version]>`

## Development

Run the required checks locally:

```bash
python -m pytest --cov=localagentcli --cov-fail-under=80
ruff check .
ruff format --check .
mypy localagentcli/
python -m build
python -m twine check dist/*
```

## Documentation

Project documentation lives in the repository:

- [Architecture](https://github.com/rainzhang05/LocalAgentCLI/blob/main/docs/architecture.md)
- [Current State](https://github.com/rainzhang05/LocalAgentCLI/blob/main/docs/current-state.md)
- [Roadmap](https://github.com/rainzhang05/LocalAgentCLI/blob/main/docs/roadmap.md)
- [Packaging and Release](https://github.com/rainzhang05/LocalAgentCLI/blob/main/docs/packaging-and-release.md)
