Metadata-Version: 2.4
Name: corclient
Version: 1.4.0
Summary: Internal CLI tool for microservices management, infrastructure administration and monitoring with AWS Cognito authentication
Author-email: Carlos Ferrer <cferrer@projectcor.com>
Maintainer-email: Carlos Ferrer <cferrer@projectcor.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/ProjectCORTeam/corcli
Project-URL: Documentation, https://github.com/ProjectCORTeam/corcli#readme
Project-URL: Repository, https://github.com/ProjectCORTeam/corcli.git
Project-URL: Bug Tracker, https://github.com/ProjectCORTeam/corcli/issues
Project-URL: Changelog, https://github.com/ProjectCORTeam/corcli/releases
Keywords: cli,microservices,infrastructure,devops,monitoring,aws,internal-tools
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: Information Technology
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Natural Language :: English
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.12
Requires-Dist: rich>=13
Requires-Dist: flask>=2.3
Requires-Dist: requests>=2.31
Requires-Dist: questionary>=2.0.0
Requires-Dist: packaging>=23.0
Provides-Extra: dev
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: types-requests>=2.31.0; extra == "dev"
Dynamic: license-file

# CoreCLI (`cor`)

[![PyPI](https://img.shields.io/pypi/v/corclient.svg)](https://pypi.org/project/corclient/)
[![Python](https://img.shields.io/pypi/pyversions/corclient.svg)](https://pypi.org/project/corclient/)

CLI interna (Project COR): autenticación Cognito (PKCE), API GraphQL y utilidades como reglas SSH en security groups.

**Requisitos:** Python 3.9+

---

## Instalación

```bash
pip install corclient
```

**Homebrew (macOS/Linux):**

```bash
brew tap ProjectCORTeam/corcli https://github.com/ProjectCORTeam/corcli.git
brew install corclient
```

**Actualizar:** `pip install -U corclient` o `brew update && brew upgrade corclient`

**Desarrollo:** `git clone … && cd corcli && pip install -e ".[dev]"`

---

## Autocompletado

```bash
cor --install-completion
```

(Reinicia la terminal o recarga tu `~/.zshrc` / `~/.bashrc`.)

---

## Login

Opcional — endpoint GraphQL (por defecto: `https://api.cor-dev.com/graphql`):

```bash
export COR_GRAPHQL_URL="https://api.cor-dev.com/graphql"
```

```bash
cor login          # navegador + PKCE; guarda tokens
cor whoami         # usuario, expiración, grupos Cognito
cor refresh        # refresco manual (el CLI también lo hace solo)
cor logout
```

Redirección custom: `cor login --app-redirect "myapp://callback"`

---

## SSH: actualizar tu IP en los security groups

Abre **TCP/22** en los SG etiquetados (por defecto tag `CORManagedSSH=corcli`) en las cuentas **main**, **prod** y **staging** definidas en el código.

```bash
cor ssh access-update
```

Por defecto usa tu **IPv4 pública** y como **descripción** de la regla el **email** de la sesión.

| Opción | Descripción |
|--------|-------------|
| `-y` / `--yes` | Sin confirmación (obligatorio sin TTY) |
| `-t` / `--tag` | Tag `clave=valor` (default: `CORManagedSSH=corcli`) |
| `-r` / `--region` | Región EC2 para todas las cuentas |
| `--ip` | IPv4 fija (`/32` opcional) — solo grupos Cognito autorizados |
| `-d` / `--description` | Texto de la regla en el SG — solo grupos autorizados |

Región por entorno (sin flag): `export COR_SSH_ACCESS_EC2_REGION=us-east-2`

**Nota:** `--ip` y `--description` están restringidos; si no tienes permiso, usa el flujo por defecto o contacta a administración.

---

## Repo y soporte

- Código: [github.com/ProjectCORTeam/corcli](https://github.com/ProjectCORTeam/corcli)
- Issues: [Issues](https://github.com/ProjectCORTeam/corcli/issues)
- Licencia: MIT

---

*Project COR Team*
