Metadata-Version: 2.4
Name: jetquery
Version: 3.3.0
Summary: Command-line interface for jetQuery.io applications
Author: jetQuery.io team
License-Expression: MIT
Project-URL: Homepage, https://jetquery.io
Keywords: jetquery,deploy,cli,web
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
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 :: Internet :: WWW/HTTP
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28
Provides-Extra: browser
Requires-Dist: playwright>=1.40; extra == "browser"

# jetquery

Command-line interface for [jetQuery.io](https://jetquery.io) applications.

## Installation

```bash
pip install jetquery
```

## Usage

```
jetquery [--action <action>] --host <host> --appname <name> [options]
```

### Actions

| Action | Description |
|--------|-------------|
| `build` | Regenerate `index.html` from local JS/CSS files (no upload) |
| `deploy` | Package and upload all local assets to the server |
| `get` | Download the current application files from the server |
| `watch` | Serve locally with live-reload and API proxy (default action) |
| `getimage` | Save a 1920x1080 PNG screenshot of a deployed page (after JS rendering) |
| `gethtml` | Save the HTML of a deployed page after JS/DOM manipulation (`<script>` elements removed) |

### Options

| Option | Description |
|--------|-------------|
| `--host`, `-H` | Server hostname or URL (e.g. `app.host.com`) |
| `--appname`, `-n` | Application name on the server (use `www` for root) |
| `--token`, `-t` | Authentication token (or set via environment variable) |
| `--port`, `-p` | Local web server port for `watch` (default: `8080`) |
| `--days` | `deploy`: upload only files modified in the last N days |
| `--log [N]` | `watch`: save proxied JSON responses to `.jetquery/log/` |
| `--url` | `getimage`/`gethtml`: page path relative to the host root, or absolute URL (default `/`) |
| `--out` | `getimage`/`gethtml`: output file (default `.jetquery/yyyymmdd-hhmmss-<url path>.png` / `.html`, non-alphanumeric characters replaced with `-`) |
| `--full` | `getimage`/`gethtml`: resize the viewport height to fit the whole page content (max 20000 px) |

### Authentication

The token can be stored in an environment variable derived from the host name
(dots and hyphens replaced with underscores):

```bash
# Windows
setx app_host_com YOUR_TOKEN

# Linux / macOS
export app_host_com=YOUR_TOKEN
```

### Examples

```bash
jetquery --action deploy --host app.host.com --appname myapp
jetquery --action deploy --host app.host.com --appname myapp --days 3
jetquery --action watch  --host app.host.com --appname myapp
jetquery --action build  --host app.host.com --appname myapp
jetquery --action get    --host app.host.com --appname myapp
jetquery --action getimage --host app.host.com --appname www --url /srs/301-zamowienia-lista/view
jetquery --action gethtml  --host app.host.com --appname www --url /srs/301-zamowienia-lista/view
```

`getimage` / `gethtml` need Playwright with Chromium:

```bash
pip install jetquery[browser]
playwright install chromium
```

## Requirements

- Python 3.10+
- `requests`
