Metadata-Version: 2.4
Name: cornerstones-client
Version: 0.1.4
Summary: Public-safe Cornerstones client CLI for managed market context access
Author: Xiaolei Lu
Project-URL: Homepage, https://www.usecornerstones.com/
Project-URL: Documentation, https://www.usecornerstones.com/docs/beta-overview
Project-URL: Changelog, https://www.usecornerstones.com/docs/cli-guide
Keywords: cornerstones,market-data,agent,cli,finance
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.28.0
Requires-Dist: python-dotenv>=1.0.0
Provides-Extra: dev
Requires-Dist: build>=1.2.2; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: twine>=5.1.0; extra == "dev"

# Cornerstones Client

Public-safe CLI for the managed Cornerstones product.

## What it does

`cornerstones-client` gives downstream operators and agents a compact local client for:

- storing the managed product portal URL and API URL separately
- storing an issued product API key locally
- starting a limited anonymous browser-compatible trial against the hosted portal
- minting and caching a short-lived discovery trial token
- reading public-safe discovery surfaces such as `guide` and `changelog`
- verifying a real authenticated API key against `/v1/status`

## Current command surface

```bash
python -m pip install cornerstones-client
cornerstones-client trial start
cornerstones-client guide
cornerstones-client auth login --api-key <issued-api-key>
cornerstones-client verify
cornerstones-client fx quote --symbol EURUSD
cornerstones-client fx bars --symbol EURUSD --timeframe 1h --count 50
cornerstones-client fx indicators --symbol USDJPY --timeframe H1 --bars 200
cornerstones-client context fx --symbol XAUUSD
cornerstones-client evidence feed --asset XAUUSD --limit 5
cornerstones-client context gold --symbol XAUUSD
cornerstones-client context stocks --symbol AAPL
```

Defaults are hosted and user-safe:

- portal: `https://www.usecornerstones.com`
- API: `https://api.usecornerstones.com`

Local operators can still override for development:

```bash
cornerstones-client auth set-base-url --base-url http://127.0.0.1:3001
cornerstones-client auth set-api-base-url --api-base-url http://127.0.0.1:8100
```

## Install

`cornerstones-client` is now live on PyPI.

Install from PyPI:

```bash
python -m pip install cornerstones-client
```

Development/source install still works when you need local edits:

```bash
python -m pip install .
```

For machine-checkable local release readiness on a packaging host:

```bash
python scripts/verify_release_readiness.py
```

That preflight verifies:

- `pytest -q`
- local `build` + `twine check`
- clean-venv wheel smoke install
- current PyPI/TestPyPI package presence
- current GitHub publish-secret presence

Human-side first-publication runbook:

- `docs/release/first-publication-runbook.md`

For local packaging verification by hand:

```bash
python -m build
python -m pip install dist/cornerstones_client-0.1.1-py3-none-any.whl
cornerstones-client --help
```

## Trial and auth notes

- `guide` and `changelog` automatically request a short-lived discovery token if no full API key is present yet.
- `verify` is intentionally stricter and requires a real issued API key.
- Trial and discovery surfaces are limited-scope onboarding helpers, not a claim that every authenticated surface is available anonymously.

## Config

The client stores local state in the user config directory as `cornerstones-client/config.json`.

Stored fields currently include:

- `portal_base_url`
- `api_base_url`
- `api_key`
- `trial_cookie`
- `trial_token`

## Status

This package is a public-safe client surface under active productization and is now published on PyPI.
Current focus is truthful onboarding, stable discovery flows, and keeping package-side docs aligned with the managed Cornerstones product truth.

Recent managed-product truth now reflected upstream through discovery and changelog surfaces includes:

- signed trial-backed discovery access for bounded `guide` / `changelog` flows
- objective rolling correlation evidence in cross-asset context
- continued hardening around bounded stocks and options workflows

The client is intentionally thin: many managed-service feature additions should flow through server-owned discovery and changelog surfaces without requiring a package code change.

## Repository automation

This repo now includes GitHub Actions workflows for:

- CI verification on push and pull request
- package build + metadata checks
- smoke install of built wheel
- manual or release-driven publish workflow for TestPyPI and PyPI releases
