Metadata-Version: 2.4
Name: terse-cli
Version: 0.1.1
Summary: Python CLI for scaffolding and managing Terse projects.
Project-URL: Homepage, https://useterse.ai
Author: Terse
Keywords: agents,ai,automation,cli,terse
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.11
Requires-Dist: click>=8.3.1
Requires-Dist: httpx>=0.28.1
Requires-Dist: jinja2>=3.1.6
Requires-Dist: pathspec>=1.0.4
Requires-Dist: python-dotenv>=1.2.2
Requires-Dist: questionary>=2.1.1
Requires-Dist: rich>=14.3.3
Requires-Dist: terse-sdk<0.2.0,>=0.1.0
Description-Content-Type: text/markdown

# terse-cli

Python CLI for scaffolding, generating, testing, and deploying [Terse](https://useterse.ai) jobs.

## Installation

```bash
python -m pip install terse-cli
```

The CLI installs the published `terse-sdk` automatically.

## Requirements

- Python `>=3.11`
- [`uv`](https://docs.astral.sh/uv/) for working with scaffolded projects

The CLI itself can be installed with `pip`, but the generated project scaffold uses `uv sync` and `uv run`.

## Quick Start

```bash
terse init my-terse-job
cd my-terse-job
uv sync
terse test
```

If you connect integrations later, regenerate the project helpers:

```bash
terse generate
```

## Commands

- `terse init [PROJECT_NAME]`
- `terse generate`
- `terse integrate`
- `terse run [JOB_NAME] --event ... --event-file ...`
- `terse test [JOB_NAME]`
- `terse deploy`

## Supported Generated Helpers

The current Python codegen surface is intentionally small:

- `Schedule.cron(...)`
- `Attio.skill(...)`
- `Snowflake.skill(...)`
- deterministic wrappers on `agent.tools.attio` and `agent.tools.snowflake`

`terse generate` writes these helpers into `src/terse_generated.py` inside your project.

For example, after generating Snowflake helpers and registering `skills=[Snowflake.skill()]`, a job can call:

```python
from terse_sdk import CronJobInputEvent
from terse_generated import TerseAgent

def handle(event: CronJobInputEvent, agent: TerseAgent) -> None:
    result = agent.tools.snowflake.execute_query(query="select current_date()")
    print(result.rowCount)
```

## Environment Variables

- `TERSE_API_KEY`: required for `terse generate`, `terse deploy`, and any agent/tool calls made by your job
- `TERSE_BACKEND_URL`: optional backend override for local development
- `TERSE_FRONTEND_URL`: optional frontend override for local development

## Typical Workflow

```bash
terse init my-terse-job
cd my-terse-job
uv sync
terse test
terse deploy
```

To run a job against a serialized event:

```bash
terse run --event '{"integrationType":"cron_job","eventType":"manual","formattedContent":"Manual trigger","debugLog":"Manual trigger"}'
```

## Source

- Homepage: [useterse.ai](https://useterse.ai)
- Repository: [github.com/TerseAI/Terse](https://github.com/TerseAI/Terse)
- Issues: [github.com/TerseAI/Terse/issues](https://github.com/TerseAI/Terse/issues)

## Development

If you are working on the CLI itself from the monorepo:

```bash
npm run python:setup
npm run python:check
npm run python:build
```
