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.
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
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
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
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
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
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
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
The system SHALL respond to commands within 2 seconds for normal Airtable API operations under typical network conditions.
The system SHALL use functional programming patterns with terse, single-responsibility functions using single-word verb naming conventions.
The system SHALL maintain clear separation of concerns with dedicated files for routing, data fetching, processing, and display functions.
The system SHALL support easy addition of new commands and data sources without modifying existing core functionality.
The system SHALL handle API credentials securely without hardcoding sensitive information in source code.
The system SHALL handle network failures, API errors, and malformed data gracefully without crashing.
-
./fac.py grcommand 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
- 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
- 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
- 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 | 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.