Metadata-Version: 2.4
Name: ngen-argoapi
Version: 0.1.9
Summary: ArgoCD API management CLI and wrapper package
Author: ngen-argoapi contributors
License-Expression: MIT
Project-URL: Homepage, https://github.com/mamatnurahmat/ngen-argoapi
Project-URL: Repository, https://github.com/mamatnurahmat/ngen-argoapi
Project-URL: Issues, https://github.com/mamatnurahmat/ngen-argoapi/issues
Keywords: cli,wrapper,command,argocd,api,gitops
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.23.0
Requires-Dist: python-dotenv>=0.20.0
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn>=0.20.0
Dynamic: license-file

# ngen-argoapi

ArgoCD API management CLI and wrapper package.
Designed to simplify ArgoCD interactions and CI/CD integration.

## Installation

```bash
pip install ngen-argoapi
```

## Usage

### Login

Login to your ArgoCD instance. This will save your credentials securely (insecure mode by default for internal instances).

```bash
argoapi login
```

### Application Management

List all applications with sync/health status:
```bash
argoapi app list
```

Get application details (JSON output):
```bash
argoapi app get <application-name>
```

Show diff for out-of-sync resources:
```bash
argoapi app diff <application-name>
argoapi app diff <application-name> --compact
argoapi app diff <application-name> --inline
```

Refresh an application:
```bash
argoapi app refresh <application-name>
argoapi app refresh <application-name> --hard
```

### Server Mode

Start the ArgoAPI server with Swagger UI:

```bash
argoapi server
argoapi server --host 0.0.0.0 --port 8899
```

API endpoints available at:
- **Swagger UI**: `http://localhost:8899/docs`
- **ReDoc**: `http://localhost:8899/redoc`
- **Health Check**: `http://localhost:8899/health`


### Health Check Endpoint

The `/health` endpoint returns:

```json
{
  "status": "healthy",
  "version": "0.1.8",
  "timestamp": "2024-12-25T10:30:00.000000Z",
  "service": "argoapi",
  "argocd_connected": true,
  "token": {
    "valid": true,
    "username": "admin",
    "error": null
  }
}
```

**Status values:**
- `healthy`: ArgoCD connected and token valid
- `degraded`: ArgoCD connected but token invalid/expired


## Environment Variables

| Variable | Description |
|----------|-------------|
| `ARGOAPI_VERSION` | Override version reported by API (optional) |

## Features

- **Insecure by Default**: Automatically handles SSL verification for internal ArgoCD instances.
- **Token Management**: Auto-renews or manages session tokens.
- **Easy CLI**: Simple command structure.
- **Diff Support**: View resource differences in compact or inline format.
- **Server Mode**: REST API with Swagger documentation.
- **Health Check**: Kubernetes-ready health check endpoint.

