Metadata-Version: 2.4
Name: bi-cli
Version: 0.1.4
Summary: Pacote BI - ferramentas de análise e visualização de dados
Author-email: Almir <almir@almirernanioconsultor.com.br>
License: MIT License
        
        Copyright (c) 2026 Almir Ernanio
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: bi,analytics,data
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
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
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: psutil
Dynamic: license-file

# bi-cli

Pacote de ferramentas de BI e monitoramento do sistema, acessível via linha de comando.

## Instalação

```bash
# Instalação via PyPI
pip install bi-cli

# Instalação em modo editable (recomendado para desenvolvimento)
pip install -e .
```

## Uso

### CLI

```bash
# Ajuda geral
bi --help
```

#### `bi system memoria` — Uso de memória RAM

```bash
bi system memoria              # memória RAM
bi system memoria --swap       # inclui informações de Swap
bi system memoria -s           # atalho para --swap
bi system memoria --top 5      # lista os 5 processos que mais consomem memória
bi system memoria -t 5         # atalho para --top
```

**Exemplo de saída — `bi system memoria --swap --top 3`:**

```
Total:      16.0 GB
Usado:       9.3 GB
Disponível:  6.7 GB
Uso:        58.1%

[Swap]
Total:       2.0 GB
Usado:       0.4 GB
Livre:       1.6 GB
Uso:        20.0%

[Top 3 processos por memória]
PID      Nome                           Memória (MB)
----------------------------------------------------
1234     chrome                              512.4
5678     python                              210.1
9012     code                                198.7
```

#### `bi system disco` — Uso de armazenamento

```bash
bi system disco                # todas as partições
bi system disco --alerta 80    # destaca partições com uso ≥ 80%
bi system disco -a 80          # atalho para --alerta
```

**Exemplo de saída — `bi system disco --alerta 80`:**

```
Partição             Total    Usado    Livre    Uso
--------------------------------------------------------
/                   500.0G   430.0G    70.0G   86.0% ⚠️  acima de 80%
/boot/efi             0.5G     0.1G     0.4G   20.0%
```

#### `bi docker status` — Lista containers

```bash
bi docker status
```

**Exemplo de saída:**

```
Nome                           Status       Portas
--------------------------------------------------------------------------
✅ meu_app                     Up 2 hours   0.0.0.0:8080->80/tcp
❌ banco_dados                 Exited (1)
```

#### `bi docker logs` — Logs de um container

```bash
bi docker logs -n <nome>                 # últimas 50 linhas (padrão)
bi docker logs -n <nome> --linhas 100    # últimas 100 linhas
bi docker logs -n <nome> -l 100         # atalho para --linhas
bi docker logs -n <nome> --realtime     # acompanha em tempo real
bi docker logs -n <nome> -r             # atalho para --realtime
```

#### `bi docker restart` — Reinicia um container

```bash
bi docker restart --nome <nome>
```

#### `bi docker parar` — Para um container

```bash
bi docker parar --nome <nome>
```

#### `bi docker iniciar` — Inicia um container parado

```bash
bi docker iniciar --nome <nome>
```

#### `bi docker exec` — Executa um comando dentro de um container

```bash
bi docker exec --nome <nome> <comando>

# Exemplos
bi docker exec --nome meu_app bash
bi docker exec --nome meu_app python manage.py migrate
```

### Módulo Python

```python
from bi import __version__

print(f"Versão: {__version__}")
```

## Licença

MIT License — Copyright (c) 2026 Almir Ernanio. Consulte o arquivo [LICENSE](LICENSE) para mais detalhes.

## Desenvolvimento

```bash
# Criar e ativar ambiente virtual
python -m venv .venv
source .venv/bin/activate   # Linux/macOS
# .venv\Scripts\activate    # Windows

# Instalar em modo editable
pip install -e .

# Executar testes
python -m pytest
```
