Command Line Interface
Relevant source files
The following files were used as context for generating this wiki page:
The Command Line Interface (CLI) for flext-target-oracle-oic serves as the primary entry point for executing the Singer target. It bridges the shell environment with the underlying FlextTargetOracleOicService, enabling data synchronization between Singer-compliant taps and Oracle Integration Cloud (OIC).
The CLI is designed as a minimal facade that leverages a service-based architecture. It provides standard command-line scripts registered via Python entry points, ensuring compatibility with ETL orchestrators like Meltano and manual execution via terminal.
Sources: src/flext_target_oracle_oic/cli.py:1-25, pyproject.toml:98-100
Architecture and Entry Points
The CLI architecture follows a tiered approach where a thin wrapper class delegates execution to a specialized service layer. The primary interface is defined in cli.py, while the executable scripts are configured in the project metadata.
Executable Scripts
The project exposes two canonical command-line aliases that point to the same underlying logic:
flext-target-oracle-oictarget-oracle-oic
These scripts trigger the main function located in the target module, which serves as the core lifecycle manager for the Singer target.
Sources: pyproject.toml:98-100, src/flext_target_oracle_oic/cli.py:22-24
CLI Facade Structure
The FlextTargetOracleOicCli class acts as the facade for the package. It contains a run method that initializes the FlextTargetOracleOicService and invokes its cli_main method. This separation ensures that the CLI logic remains decoupled from the core synchronization engine.
The diagram above illustrates the call sequence from the user command to the core target implementation.
Sources: src/flext_target_oracle_oic/cli.py:11-20, tests/unit/test_cli_entrypoint.py:14-17
Components and Logic
CLI Wrapper Class
The FlextTargetOracleOicCli class provides the execution context.
| Component | Type | Description |
|---|---|---|
run(args) | Class Method | Accepts optional string sequence of arguments and delegates to the service facade. |
main() | Function | The standard entry point function used by the pyproject console scripts. |
Sources: src/flext_target_oracle_oic/cli.py:11-24
Initialization and Validation
Before processing records, the CLI environment (via the target's setup phase) validates the provided configuration. This includes ensuring required OIC credentials and URLs are present in the environment or configuration file.
The flow shows how the CLI triggers internal validation logic during the initial target setup.
Sources: src/flext_target_oracle_oic/utilities.py:23-31, src/flext_target_oracle_oic/target.py:73-75
Technical Implementation Details
The CLI is built upon several key classes that manage the transition from command-line arguments to data processing:
- FlextTargetOracleOic: The core Singer target class that manages sinks for different OIC streams (Connections, Integrations, Packages, Lookups).
- FlextTargetOracleOicService: (Referenced via
cli.py) The service that orchestrates the CLI lifecycle. - FlextTargetOracleOicCli: The facade providing the
runmethod.
Integration with Singer SDK
The target implements the FlextMeltanoTargetAbstractions, which provides standard Singer CLI behavior, such as reading from stdin and reporting state.
Sources: src/flext_target_oracle_oic/target.py:58-62, src/flext_target_oracle_oic/cli.py:18
Conclusion
The Command Line Interface for flext-target-oracle-oic provides a standardized and robust entry point for Oracle Integration Cloud data loading. By utilizing a facade pattern and delegating to a service runtime, it maintains high testability and clean separation of concerns, ensuring that the target can be reliably invoked by both human operators and automated pipelines.
Sources: src/flext_target_oracle_oic/cli.py:1-25, tests/unit/test_cli_entrypoint.py:1-18