Metadata-Version: 2.4
Name: nao-core
Version: 0.0.40
Summary: nao Core is your analytics context builder with the best chat interface.
Project-URL: Homepage, https://getnao.io
Project-URL: Repository, https://github.com/naolabs/chat
Author: nao Labs
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: ai,analytics,chat
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: anthropic>=0.76.0
Requires-Dist: apscheduler>=3.10.0
Requires-Dist: cryptography>=46.0.3
Requires-Dist: cyclopts>=4.4.4
Requires-Dist: dotenv>=0.9.9
Requires-Dist: fastapi>=0.128.0
Requires-Dist: google-genai>=1.61.0
Requires-Dist: ibis-framework[bigquery,databricks,duckdb,postgres,snowflake]>=9.0.0
Requires-Dist: jinja2>=3.1.0
Requires-Dist: mistralai>=1.11.1
Requires-Dist: notion-client>=2.7.0
Requires-Dist: notion2md>=2.9.0
Requires-Dist: openai>=1.0.0
Requires-Dist: posthog>=7.8.0
Requires-Dist: pydantic>=2.10.0
Requires-Dist: pytest>=9.0.2
Requires-Dist: python-dotenv>=1.2.1
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: questionary>=2.1.0
Requires-Dist: rich>=14.0.0
Requires-Dist: uvicorn>=0.40.0
Provides-Extra: dev
Requires-Dist: pytest-cov; extra == 'dev'
Description-Content-Type: text/markdown

# nao CLI

Command-line interface for nao chat.

## Installation

```bash
pip install nao-core
```

## Usage

```bash
nao --help
Usage: nao COMMAND

╭─ Commands ────────────────────────────────────────────────────────────────╮
│ chat         Start the nao chat UI.                                       │
│ init         Initialize a new nao project.                                │
│ --help (-h)  Display this message and exit.                               │
│ --version    Display application version.                                 │
╰───────────────────────────────────────────────────────────────────────────╯
```

### Initialize a new nao project

```bash
nao init
```

This will create a new nao project in the current directory. It will prompt you for a project name and ask you if you want to set up an LLM configuration.

### Start the nao chat UI

```bash
nao chat
```

This will start the nao chat UI. It will open the chat interface in your browser at `http://localhost:5005`.

### BigQuery service account permissions

When you connect BigQuery during `nao init`, the service account used by `credentials_path`/ADC must be able to list datasets and run read-only queries to generate docs. Grant the account:

- Project: `roles/bigquery.jobUser` (or `roles/bigquery.user`) so the CLI can submit queries
- Each dataset you sync: `roles/bigquery.dataViewer` (or higher) to read tables

The combination above mirrors the typical "BigQuery User" setup and is sufficient for nao's metadata and preview pulls.

## Development

### Building the package

```bash
cd cli
python build.py --help
Usage: build.py [OPTIONS]

Build and package nao-core CLI.

╭─ Commands ────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help (-h)  Display this message and exit.                                                               │
│ --version    Display application version.                                                                 │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Parameters ──────────────────────────────────────────────────────────────────────────────────────────────╮
│ --force -f --no-force              Force rebuild the server binary [default: False]                       │
│ --skip-server -s --no-skip-server  Skip server build, only build Python package [default: False]          │
│ --bump                             Bump version before building (patch, minor, major) [choices: patch,    │
│                                    minor, major]                                                          │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

This will:
1. Build the frontend with Vite
2. Compile the backend with Bun into a standalone binary
3. Bundle everything into a Python wheel in `dist/`

Options:
- `--force` / `-f`: Force rebuild the server binary
- `--skip-server`: Skip server build, only build Python package
- `--bump`: Bump version before building (patch, minor, major)

### Installing for development

```bash
cd cli
pip install -e .
```

### Publishing to PyPI

```bash
# Build first
python build.py

# Publish
uv publish dist/*
```

## Architecture

```
nao chat (CLI command)
    ↓ spawns
nao-chat-server (Bun-compiled binary)
    ↓ serves
Backend API + Frontend Static Files
    ↓
Browser at http://localhost:5005
```
