Skip to content

Latest commit

 

History

History
119 lines (92 loc) · 5.29 KB

File metadata and controls

119 lines (92 loc) · 5.29 KB

FAC CLI Requirements (EARS Format)

Overview

FAC CLI is a command-line interface for managing Founders and Coders training organisation operations. The system fetches data from various third-party sources (starting with Airtable) and displays formatted information in the terminal. Built incrementally with clear separation of concerns using functional programming principles.

Functional Requirements

FR-001: Command Routing

GIVEN the FAC CLI is installed and executable
WHEN a user runs ./fac.py <command> with a valid command
THEN the system SHALL route to the appropriate command handler
AND execute the requested functionality

FR-002: Gateway Recent Command (gr)

GIVEN valid Airtable credentials are configured
WHEN a user runs ./fac.py gr
THEN the system SHALL fetch data from the specified Airtable view
AND display formatted results in the terminal with custom column headers

FR-003: Airtable Data Fetching

GIVEN Airtable URL and credentials are provided
WHEN the gateway recent command is executed
THEN the system SHALL authenticate with Airtable API
AND retrieve specified columns from the configured view
AND handle API errors gracefully

FR-004: Data Processing

GIVEN raw data is fetched from Airtable
WHEN the data processing function is called
THEN the system SHALL transform the data for terminal display
AND apply custom column headers as specified
AND format data for optimal readability

FR-005: Terminal Display

GIVEN processed data is available
WHEN the display function is called
THEN the system SHALL render data in a clear tabular format
AND handle terminal width constraints appropriately
AND provide readable output for the specified columns

FR-006: Error Handling

GIVEN any operation fails (network, authentication, data processing)
WHEN an error occurs
THEN the system SHALL display a clear, actionable error message
AND exit gracefully without crashing
AND log error details for debugging

FR-007: Extensibility

GIVEN the CLI foundation is established
WHEN new commands need to be added
THEN the system SHALL support adding commands via new files
AND maintain clear separation between routing, fetching, processing, and display
AND allow new data sources to be added independently

Non-Functional Requirements

NFR-001: Performance

The system SHALL respond to commands within 2 seconds for normal Airtable API operations under typical network conditions.

NFR-002: Code Style

The system SHALL use functional programming patterns with terse, single-responsibility functions using single-word verb naming conventions.

NFR-003: Modularity

The system SHALL maintain clear separation of concerns with dedicated files for routing, data fetching, processing, and display functions.

NFR-004: Extensibility

The system SHALL support easy addition of new commands and data sources without modifying existing core functionality.

NFR-005: Security

The system SHALL handle API credentials securely without hardcoding sensitive information in source code.

NFR-006: Error Resilience

The system SHALL handle network failures, API errors, and malformed data gracefully without crashing.

Acceptance Criteria

  • ./fac.py gr command successfully fetches and displays Airtable data
  • Code follows functional programming and terse naming conventions
  • Clear separation between routing, fetching, processing, and display
  • Error handling provides clear feedback to users
  • Architecture supports easy addition of new commands
  • API credentials are handled securely
  • Test coverage > 90% for all components

Success Metrics

  • Gateway recent command executes successfully with valid Airtable data
  • Code architecture allows new commands to be added in under 30 minutes
  • Error messages are actionable and user-friendly
  • All tests pass with comprehensive coverage
  • Command responds within 2 seconds under normal conditions

Assumptions and Constraints

Assumptions

  • Users have Python 3.9+ installed
  • Network connectivity is available for API calls
  • Valid Airtable credentials and view URL are provided
  • Terminal supports standard text output formatting

Constraints

  • Technology stack: Python with functional programming style
  • File structure: fac.py (main), gr.py (gateway recent), separate files for data sources
  • API dependency: Airtable API availability and rate limits
  • Development approach: Incremental, one command at a time

Risk Assessment

Risk Impact Probability Mitigation
Airtable API changes High Medium Abstract API calls, version control integration
Network connectivity issues Medium Medium Implement timeout handling and offline error messages
API rate limiting Medium Low Implement rate limiting awareness and backoff strategy
Credential exposure High Low Use environment variables, secure credential handling
Architecture complexity growth Medium High Maintain strict separation of concerns, regular refactoring

This requirements document follows EARS format for clarity and testability. All requirements should be reviewed and approved before implementation begins.