Metadata-Version: 2.4
Name: edza-cli
Version: 0.1.0
Summary: Standalone EDZA CLI for launching local commands with centrally managed environment access.
Project-URL: Homepage, https://envault.edza.ai
Project-URL: Issues, https://envault.edza.ai
Project-URL: Documentation, https://envault.edza.ai
Author: EDZA
License: MIT
Keywords: cli,developer-tools,edza,environment,secrets
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Utilities
Requires-Python: >=3.12
Requires-Dist: httpx<1.0.0,>=0.28.0
Requires-Dist: keyring<26.0.0,>=25.0.0
Requires-Dist: platformdirs<5.0.0,>=4.3.0
Requires-Dist: pydantic-settings<3.0.0,>=2.7.0
Requires-Dist: rich<14.0.0,>=13.9.0
Requires-Dist: typer<1.0.0,>=0.15.1
Provides-Extra: dev
Requires-Dist: build<2.0.0,>=1.2.2; extra == 'dev'
Requires-Dist: pyinstaller<7.0.0,>=6.11.0; extra == 'dev'
Requires-Dist: twine<6.0.0,>=5.1.1; extra == 'dev'
Description-Content-Type: text/markdown

# EDZA CLI

This is the standalone EDZA CLI project that you can ship to teammates without bundling the admin/server codebase.

## Install From PyPI

```bash
python3 -m pip install --user edza-cli
```

Then use:

```bash
edza --version
edza login
```

## What It Does

- Opens browser-based Google login against the EDZA server
- Stores the returned session token locally
- Lists apps and active access
- Creates access requests
- Launches commands like Python and Node processes with just-in-time env injection

## Install For Development

```bash
cd cli
python3 -m pip install --user --break-system-packages -e ".[dev]"
```

## One-Line Installer

Host `scripts/bootstrap.sh` somewhere public, then users can install with:

```bash
curl -fsSL https://downloads.edza.in/install.sh | bash
```

How it works:

- tries to download the correct prebuilt zip for Linux or macOS
- installs the `edza` binary into `~/.local/bin`
- falls back to `pip install --user edza-cli` if no binary URL is configured

Useful installer env vars:

- `EDZA_DOWNLOAD_BASE_URL=https://downloads.edza.in/cli`
- `EDZA_CLI_VERSION=0.1.0`
- `EDZA_INSTALL_MODE=auto`
- `EDZA_INSTALL_MODE=binary`
- `EDZA_INSTALL_MODE=pip`
- `EDZA_PIP_PACKAGE=edza-cli`

Example with explicit binary host:

```bash
curl -fsSL https://downloads.edza.in/install.sh | EDZA_DOWNLOAD_BASE_URL=https://downloads.edza.in/cli bash
```

Example forcing pip fallback:

```bash
curl -fsSL https://downloads.edza.in/install.sh | EDZA_INSTALL_MODE=pip bash
```

## Build A Shareable Terminal Binary

Build the standalone `edza` binary:

```bash
cd cli
python3 -m pip install --user --break-system-packages -e ".[dev]"
PYTHONPATH=src python3 scripts/build.py
```

This creates:

- `dist/edza` on Linux and macOS, or `dist/edza.exe` on Windows
- a zip release archive in `dist/release/`
- a matching `.sha256` checksum file
- Windows zips include `install.cmd` and `install.ps1`

Install it into your terminal:

macOS/Linux:

```bash
cd cli
./scripts/install.sh
```

Windows PowerShell:

```powershell
cd cli
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1
```

Windows Command Prompt:

```bat
cd cli
scripts\install.cmd
```

Both install scripts can also install directly from a release zip:

macOS/Linux:

```bash
./scripts/install.sh ./dist/release/edza-0.1.0-linux-x64.zip
```

Windows PowerShell:

```powershell
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 .\dist\release\edza-0.1.0-windows-x64.zip
```

Windows Command Prompt:

```bat
scripts\install.cmd .\dist\release\edza-0.1.0-windows-x64.zip
```

For shipped Windows builds, the user flow is:

1. Download `edza-0.1.0-windows-x64.zip`
2. Extract it
3. Double-click `install.cmd`
4. Open a new terminal and run `edza`

## Optional CLI Config

Copy `.env.example` to `.env` if you want defaults on your machine.

- `EDZA_SERVER_URL`
- `EDZA_CALLBACK_HOST`
- `EDZA_CALLBACK_PORT`
- `EDZA_CALLBACK_TIMEOUT_SECONDS`
- `EDZA_CONFIG_DIR`

## Usage

Login:

```bash
edza login --server https://envault.edza.ai
```

List apps and current access:

```bash
edza apps list
edza access list
```

Request access:

```bash
edza request create api dev --duration 8h --reason "Need local debug access"
```

Run a Python app:

```bash
edza run api dev -- python -m uvicorn app.main:app --port 8000 --reload
```

Run a Node app:

```bash
edza run backend dev -- npm run dev
```

Logout:

```bash
edza logout
```

## Quick Terminal Check

After install, these should work from any terminal:

```bash
edza --version
edza --help
edza login
```

## Publish To PyPI

Build the package files:

```bash
cd cli
python3 -m pip install --user build twine
python3 -m build
python3 -m twine check dist/*
```

Upload to TestPyPI first:

```bash
python3 -m twine upload --repository testpypi dist/*
```

Then upload to PyPI:

```bash
python3 -m twine upload dist/*
```

Notes:

- you need a PyPI account and API token
- if `edza-cli` is already taken on PyPI, change `name` in `pyproject.toml` before publishing
- users can then install with `python3 -m pip install --user edza-cli`
