Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Generated by scripts/github/sync_workflows.py - DO NOT EDIT
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: All CI quality gate steps (check, test, validate) are set to continue-on-error: true, which means this CI pipeline can never fail — it will always report green regardless of broken tests, type errors, lint violations, or security findings. This effectively disables CI as a quality gate.

If this is intentional for bootstrapping, consider adding a tracking issue or TODO comment with a target date/milestone to re-enable enforcement. At minimum, consider keeping make test as a hard failure so regressions are caught.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yml, line 60:

<comment>All CI quality gate steps (`check`, `test`, `validate`) are set to `continue-on-error: true`, which means this CI pipeline can never fail — it will always report green regardless of broken tests, type errors, lint violations, or security findings. This effectively disables CI as a quality gate.

If this is intentional for bootstrapping, consider adding a tracking issue or TODO comment with a target date/milestone to re-enable enforcement. At minimum, consider keeping `make test` as a hard failure so regressions are caught.</comment>

<file context>
@@ -56,11 +56,14 @@ jobs:
 
-      - name: Check
+      - name: Check (advisory)
+        continue-on-error: true
         run: make check
 
</file context>
Fix with Cubic

name: CI

on:
pull_request:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read

jobs:
ci:
name: ci
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5

- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: "3.13"

- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a
with:
virtualenvs-create: false
installer-parallel: true

- name: Setup (advisory)
continue-on-error: true
run: make setup

- name: Check (advisory)
continue-on-error: true
run: make check

- name: Test (advisory)
continue-on-error: true
run: make test

- name: Validate (advisory)
continue-on-error: true
run: make validate
146 changes: 17 additions & 129 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,139 +1,27 @@
# flext-cli
# FLEXT CLI

<!-- TOC START -->
Framework de linha de comando para construir interfaces operacionais padronizadas no portfolio FLEXT.

- [🚀 Key Features](#-key-features)
- [📦 Installation](#-installation)
- [🛠️ Usage](#-usage)
- [Basic CLI Application](#basic-cli-application)
- [File Operations](#file-operations)
- [Interactive Prompts](#interactive-prompts)
- [Tables and Formatting](#tables-and-formatting)
- [🏗️ Architecture](#-architecture)
- [🤝 Contributing](#-contributing)
- [📄 License](#-license)
Descricao oficial atual: "FLEXT CLI - Developer Command Line Interface".

<!-- TOC END -->
## O que este projeto entrega

[![Python 3.13+](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
- Define estrutura de comandos, opcoes e validacoes de uso.
- Padroniza experiencia em terminal para equipes tecnicas.
- Acelera criacao de CLIs consistentes entre projetos.

**flext-cli** is the foundational command-line interface library for the FLEXT ecosystem. It provides robust CLI primitives, abstracting underlying libraries like Click and Rich to ensure consistent interaction patterns, strict type safety, and seamless integration with `flext-core`.
## Contexto operacional

**Reviewed**: 2026-02-17 | **Version**: 0.10.0-dev
- Entrada: comandos e parametros do operador.
- Saida: execucao de rotinas com retorno padrao.
- Dependencias: flext-core e modulos de dominio chamados pela CLI.

Part of the [FLEXT](https://github.com/flext-sh/flext) ecosystem.
## Estado atual e risco de adocao

## 🚀 Key Features
- Qualidade: **Alpha**
- Uso recomendado: **Nao produtivo**
- Nivel de estabilidade: em maturacao funcional e tecnica, sujeito a mudancas de contrato sem garantia de retrocompatibilidade.

- **Robust CLI Framework**: Typesafe abstractions over `Click` and `Rich` for building complex commands.
- **File Operations**: Comprehensive support for reading and writing JSON, YAML, and CSV files with Pydantic validation.
- **Rich Output**: Pre-configured formatters and table styling powered by `Rich` and `Tabulate`.
- **Interactive Prompts**: Safe, validated user input handling for text, confirmations, and choices.
- **Configuration Management**: Strong configuration with Pydantic models and environment variable support.
- **Authentication Flow**: Built-in support for secure credential management and `flext-auth` integration.
- **Railway Oriented**: All operations return `FlextResult[T]` for predictable error handling.
## Diretriz para uso nesta fase

## 📦 Installation

To install `flext-cli`:

```bash
pip install flext-cli
```

Or with Poetry:

```bash
poetry add flext-cli
```

## 🛠️ Usage

### Basic CLI Application

Create type-safe CLI commands with minimal boilerplate.

```python
from flext_cli import FlextCli, FlextResult as r

cli = FlextCli()

@cli.command()
def greet(name: str):
cli.formatters.print(f"Hello, {name}!", style="green bold")

if __name__ == "__main__":
cli.run()
```

### File Operations

Safely read and write structured data files.

```python
from flext_cli import FlextCli

cli = FlextCli()

# Write JSON
data = {"app": "myapp", "version": "1.0.0"}
cli.file_tools.write_json_file("config.json", data)

# Read JSON
result = cli.file_tools.read_json_file("config.json")
if result.is_success:
config = result.unwrap()
cli.formatters.print(f"Config loaded: {config}")
```

### Interactive Prompts

Securely collect user input with validation.

```python
from flext_cli import FlextCli

cli = FlextCli()

if cli.prompts.confirm("Do you want to continue?", default=True).unwrap():
username = cli.prompts.prompt_text("Username:").unwrap()
cli.formatters.print(f"Welcome back, {username}!")
```

### Tables and Formatting

Display data beautifully using `Tabulate` and `Rich`.

```python
from flext_cli import FlextCli

cli = FlextCli()

users = [
{"name": "Alice", "role": "Admin"},
{"name": "Bob", "role": "User"},
]

cli.output.format_data(
data={"users": users},
format_type="table"
).map(lambda table: cli.formatters.print(table))
```

## 🏗️ Architecture

`flext-cli` abstracts direct dependencies (Click, Rich) into clean service layers, ensuring that your CLI logic remains decoupled from specific libraries. It strictly adheres to FLEXT architectural patterns:

- **Models**: Pydantic models for strictly typed data structures.
- **Services**: All functionality is exposed via `FlextService` implementations.
- **Results**: Every operation returns a `FlextResult`, enforcing explicit error handling.

## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guide](docs/development.md) for details on setting up your environment and submitting pull requests.

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Aplicar este projeto somente em desenvolvimento, prova de conceito e homologacao controlada, com expectativa de ajustes frequentes ate maturidade de release.
65 changes: 32 additions & 33 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading