Metadata-Version: 2.4
Name: intent-hub-cli
Version: 0.1.4
Summary: Lightweight CLI and SDK for remote Intent Hub APIs
License-Expression: MIT
Project-URL: Homepage, https://github.com/free4inno/intent-hub
Project-URL: Repository, https://github.com/free4inno/intent-hub
Project-URL: Documentation, https://github.com/free4inno/intent-hub/blob/main/intent-hub-cli/README.md
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
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: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31.0
Provides-Extra: dev
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"

# intent-hub-cli

Lightweight CLI and Python SDK for remote Intent Hub deployments.

## Install

If you want to use the published CLI or Python SDK, install the released package:

```bash
pip install intent-hub-cli==0.1.0
```

Editable install for package development:

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

Build and install a wheel:

```bash
cd intent-hub-cli
python -m pip install -U build
python -m build
pip install dist/intent_hub_cli-0.1.0-py3-none-any.whl
```

This produces:

- `dist/intent_hub_cli-0.1.0-py3-none-any.whl`
- `dist/intent_hub_cli-0.1.0.tar.gz`

After publishing:

```bash
pip install intent-hub-cli==0.1.0
```

## Publishing

Release validation:

```bash
cd intent-hub-cli
python -m pip install -e .[dev]
pytest tests -q
python -m build
python -m twine check dist/*
```

Manual upload to PyPI:

```bash
python -m twine upload -u __token__ -p <PYPI_TOKEN> dist/*
```

Manual upload to TestPyPI:

```bash
python -m twine upload \
  --repository-url https://test.pypi.org/legacy/ \
  -u __token__ \
  -p <TEST_PYPI_TOKEN> \
  dist/*
```

See `PUBLISH.md` for the full release flow. The repository also contains the GitHub Actions workflow for tag-based publishing.

## Usage

### CLI

```bash
intent-hub login --endpoint https://api.example.com --code <access_code>
intent-hub whoami
intent-hub route "help me organize a wiki"
intent-hub route "help me organize a wiki" --json
intent-hub route --dispatch "help me organize a wiki"
intent-hub route --dispatch "help me organize a wiki" --json
intent-hub skills scan --source-path ./skills
intent-hub skills scan --source-path D:/skills --source-label team-skills
intent-hub sync
intent-hub sync --force-full --json
intent-hub sync --route-ids 12,15 --json
```

`intenthub` is available as an alias.

### Python SDK

```python
from intent_hub_cli import IntentHubClient

client = IntentHubClient(
    endpoint="https://api.example.com",
    access_code="ih_live_team_alpha_xxx",
)

print(client.whoami())
print(client.route("help me organize a wiki"))
print(client.dispatch("help me organize a wiki"))
print(client.reindex())
print(client.sync_routes([12, 15]))
scan_result = client.skills_scan_uploaded(
    source_id=None,
    source_label="team-skills",
    client_path_hint="./skills",
    skills=[
        {
            "relative_path": "wiki-builder/SKILL.md",
            "content": "# wiki-builder\n...",
        }
    ],
)
print(scan_result)
```

## Configuration

The CLI stores credentials at `~/.intent-hub/config.json`:

```json
{
  "endpoint": "https://api.example.com",
  "access_code": "ih_live_team_alpha_xxx"
}
```

## Notes

- Dependency footprint is intentionally small: `requests>=2.31.0`
- This package does not ship backend dependencies such as Flask or Qdrant client
- Use this package for remote access; use `intent-hub-backend` when you are running or developing the server itself
- Skill scanning runs against the user's local directories and uploads `SKILL.md` content to the backend
- `skills scan` directly associates newly discovered skills with route entities; there is no separate `skills apply` step
- `sync` triggers backend index synchronization for all routes or selected route ids
