Metadata-Version: 2.3
Name: sparkai-code-engine
Version: 0.0.1rc0
Summary: SparkAI Code Engine CLI and MCP bridge (`sparkle`).
Author: SparkAI
Requires-Dist: cryptography>=45.0.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: keyring>=25.6.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# `sparkle`

`sparkle` is the local CLI and MCP bridge for Code Engine.

Current implementation includes:

- Packaging for PyPI distribution as `sparkai-code-engine`.
- `sparkle init` endpoint bootstrap and OAuth login flow.
- Context profiles for multiple accounts/environments.
- OAuth login with Keycloak (PKCE) and token import fallback.
- Local credential persistence with refresh-token reauth support.
- Workspace registration from local git repo paths with repo auto-binding.
- Local overlay indexing with saved-file freshness tracking.
- Sync batch upload/commit flow to backend.
- Retrieval command that merges local overlay candidates with `/v1/search/code`.
- MCP stdio server exposing `codebase-retrieval`.

Install from PyPI:

```bash
uv tool install sparkai-code-engine
```

Basic bootstrap:

```bash
sparkle init
sparkle context list
sparkle set context default
sparkle --context staging whoami
```

Common runtime commands:

```bash
sparkle workspace add /path/to/repo --sync
sparkle retrieve --directory-path /path/to/repo --query "where is keycloak auth"
sparkle mcp --auto-workspace
sparkle --mcp --mcp-auto-workspace
```

MCP behavior:

- When endpoint preflight succeeds, `tools/list` exposes `codebase-retrieval`.
- When endpoint preflight fails (for example off VPN), MCP remains alive but
  returns an empty tool list for that session.
