Metadata-Version: 2.4
Name: klickanalytics-cli
Version: 0.1.0
Summary: Official CLI for KlickAnalytics APIs
Author-email: KlickAnalytics <support@klickanalytics.com>
License: MIT
Project-URL: Homepage, https://www.klickanalytics.com
Project-URL: Documentation, https://www.klickanalytics.com/cli_documentation.php
Keywords: finance,stocks,cli,market-data,klickanalytics,agents,api
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31.0
Dynamic: license-file

# KlickAnalytics CLI

**Financial market intelligence from your terminal, scripts, and AI agents.**

KlickAnalytics CLI provides a simple way for developers, traders, researchers, and AI systems to access financial market data directly from the command line.

Instead of writing API requests manually, you can retrieve structured financial data instantly.

Example:

```bash
ka profile -s TSLA
ka quote -s NVDA
ka prices -s AAPL -sd 2025-01-01 -ed 2025-12-31
ka quantstats -s MSFT
```

---

# Why KlickAnalytics CLI?

Most financial API workflows involve unnecessary friction:

- writing HTTP request code
- building authentication headers
- managing JSON parsing
- creating repetitive scripts
- integrating APIs with agents or automation pipelines

KlickAnalytics CLI removes that friction by acting as a thin client that connects directly to the KlickAnalytics API platform.

Benefits:

- extremely simple command interface
- direct integration with your terminal
- easy automation via scripts
- agent-friendly JSON output
- server-driven command routing
- future commands added without updating the CLI

---

# Built for Developers and AI Agents

KlickAnalytics CLI is designed to integrate easily with modern development and automation workflows.

It works well with:

- local shell scripts
- Python pipelines
- research tools
- cron jobs
- AI agents
- OpenClaw-style systems
- MCP servers
- local developer tools
- automation pipelines

Because the CLI supports structured JSON output, agents can consume financial data without writing API wrappers.

Example:

```bash
ka --json quote -s MSFT
```

This allows AI tools or scripts to receive structured responses instantly.

---

# Installation

Install from PyPI:

```bash
pip install klickanalytics-cli
```

After installation, the `ka` command becomes available globally.

---

# Setting Your API Key

Create your account and generate your CLI API key in seconds.

## Steps

1. **Register a free account**

   👉 https://klickanalytics.com/signup

2. **Generate your API key**

   👉 https://klickanalytics.com/user_apis

3. **Export your API key**

```bash
export KLICKANALYTICS_CLI_API_KEY="your_api_key_here"
```

A fallback environment variable is also supported:

```bash
export KA_API_KEY="your_api_key_here"
```

---

# Basic Usage

Display help:

```bash
ka help
```

List commands:

```bash
ka commands
```

Retrieve symbol profile:

```bash
ka profile -s TSLA
```

Get latest quote:

```bash
ka quote -s TSLA
```

Retrieve historical prices:

```bash
ka prices -s TSLA -sd 2025-01-01 -ed 2025-12-31
```

---

# JSON Output

For scripts, automation, and AI workflows, you can request JSON output:

```bash
ka --json profile -s NVDA
```

Example output:

```json
{
  "symbol": "NVDA",
  "name": "NVIDIA Corporation",
  "sector": "Technology"
}
```

---

# Local Development

To connect the CLI to a local or staging API server:

```bash
export KA_DEV_ENDPOINT="http://127.0.0.1:8000/cli"
```

This allows you to test new commands or endpoints locally.

---

# Protocol Version

Optional protocol version override:

```bash
export KA_PROTO=v1
```

Or specify at runtime:

```bash
ka --version v2 profile -s TSLA
```

---

# Example Workflows

## Shell Automation

```bash
for s in AAPL MSFT NVDA TSLA
do
  ka quote -s $s
done
```

---

## Data Pipeline

```bash
ka --json prices -s NVDA > prices.json
```

---

## AI Agent Workflow

```bash
ka --json volatility -s NVDA -sd 2025-01-01 -ed 2025-12-31
```

The structured output can be consumed directly by:

- AI agents
- Python scripts
- automation workers
- research pipelines

---

# Environment Variables

| Variable | Description |
|---------|-------------|
| KLICKANALYTICS_CLI_API_KEY | API key for CLI authentication |
| KA_API_KEY | fallback API key |
| KA_DEV_ENDPOINT | optional local/staging API endpoint |
| KA_PROTO | protocol version override |

---

# Design Philosophy

The CLI intentionally stays lightweight.

The client does **not hardcode commands locally**. Instead:

- commands are forwarded to the server
- the server validates and routes them
- authentication is handled server-side
- new commands can be added without updating the CLI

This architecture keeps the CLI simple and future-proof.

---

# Development Install

Clone the repository:

```bash
git clone https://github.com/klickanalytics/klickanalytics-cli.git
cd klickanalytics-cli
```

Install locally:

```bash
pip install -e .
```

---

# Documentation

Full CLI documentation:

https://www.klickanalytics.com/cli_documentation

---

# License

MIT License
