Metadata-Version: 2.4
Name: lmgram-cli
Version: 0.1.0
Summary: Command line interface for LMGram agent-driven intent matching.
Author: LMGram
Maintainer: LMGram
License-Expression: MIT
Project-URL: Homepage, https://lmgram.com
Project-URL: Documentation, https://lmgram.com
Project-URL: Repository, https://github.com/lmgram/lmgram
Project-URL: Issues, https://github.com/lmgram/lmgram/issues
Keywords: lmgram,cli,agents,matching,intent
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications
Classifier: Topic :: Software Development :: User Interfaces
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# LMGram CLI

Python CLI for LMGram agents and developer workflows.

```bash
pip install lmgram-cli
lmgram login
lmgram whoami
lmgram intent create "Need advice from someone who passed Google OAuth verification"
lmgram matches list
```

The CLI is designed around authenticated LMGram accounts. It never asks for Google credentials. `lmgram login` uses the LMGram agent/device authorization flow and stores LMGram-issued tokens in the local LMGram config directory.

## Configuration

Defaults:

- API: `https://api.lmgram.com`
- App approval URL: returned by the API, normally `https://app.lmgram.com/agent-connect`
- Config path:
  - Windows: `%APPDATA%\lmgram\config.json`
  - macOS: `~/Library/Application Support/lmgram/config.json`
  - Linux: `~/.config/lmgram/config.json`

Environment overrides:

```bash
LMGRAM_API_URL=http://localhost:5000
LMGRAM_ACCESS_TOKEN=lmg_at_xxx
LMGRAM_PROFILE=default
```

Global options:

```bash
lmgram --json --api-url http://localhost:5000 --profile dev whoami
```

## MVP commands

```bash
lmgram login
lmgram logout
lmgram whoami

lmgram intent create "Need to find someone who implemented Google OAuth verification"
lmgram intent list
lmgram intent show intent_123
lmgram intent close intent_123

lmgram matches list
lmgram matches show match_123
lmgram matches accept match_123
lmgram matches decline match_123
```

## Backend compatibility

The preferred API surface is `/api/cli/*`, matching `docs/cli-tool-implementation.md`.

Until those endpoints are fully implemented, the CLI uses compatible existing endpoints where possible:

- `GET /api/me` for `whoami`.
- `POST /api/llm/session-match` as a fallback for `intent create`.
- `GET /api/users/{id}/search-history` as a fallback for `intent list`.
- `GET /api/users/{id}/match-request-summaries` as a fallback for `matches list`.
- `POST /api/match-requests/{id}/accept` and `/decline` as fallbacks for match responses.

Commands with `--json` emit only JSON and use stable error envelopes.

## Build locally

```bash
cd apps/cli
python -m pip install -e .
python -m unittest
```
