Skip to content

Terminal and CLI Commands

Framefox integrates an interactive terminal that allows you to perform common operations and automate development tasks.

The Framefox interactive terminal gives you access to a set of commands to manage your application:

Terminal window
framefox

This opens the interactive terminal which displays the list of available commands:

🦊 Framefox Framework CLI
Swift, smart, and a bit foxy
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Options ┃ Description ┃
┑━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
β”‚ --install-completion β”‚ Install completion for the current shell β”‚
β”‚ --show-completion β”‚ Show completion for the current shell β”‚
β”‚ -a, --all, list β”‚ Show detailed list of all commands β”‚
β”‚ -h, -help β”‚ Show command help message β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Command Group ┃ Description ┃
┑━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
β”‚ cache β”‚ Cache operations like clearing cache files and directories. β”‚
β”‚ create β”‚ Create various resources like entities or CRUD operations. β”‚
β”‚ database β”‚ Database operations like creating or migrating databases. β”‚
β”‚ debug β”‚ Debug operations like checking routes or testing security. β”‚
β”‚ mock β”‚ Mock operations like generating or loading mock data. β”‚
β”‚ server β”‚ Server operations like starting or stopping the server. β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Run 'framefox COMMAND --help' for specific command group details
Example: 'framefox run' or 'framefox create controller'
  1. Create a new Framefox project

    Terminal window
    framefox init
  2. Let the command run

    The command builds the initial project structure and creates the necessary configuration files.

  3. Navigate to your project

    Terminal window
    cd my-project

This command will build the initial project structure and create the necessary configuration files:

  • Directorymy-project/
    • Directorysrc/
      • Directorycontrollers/ User application controllers
        • …
      • Directoryentity/ Database entities (models)
        • …
      • Directoryrepository/ Custom repository classes
        • …
    • Directoryconfig/ Application configuration
      • application.yaml Main application configuration
      • debug.yaml Debug configuration
      • mail.yaml Email configuration
      • orm.yaml ORM configuration
      • parameter.yaml Application parameters
      • security.yaml Security configuration
      • services.yaml Services configuration
      • tasks.yaml Tasks configuration
    • Directorypublic/ Static assets
      • …
    • Directorymigrations/ Database migrations
      • …
    • Directorytemplates/ Jinja2 templates
      • …
    • Directoryvar/ Variable data (logs, cache)
      • …
    • .env Environment variables
    • requirements.txt Python dependencies
    • main.py Application entry point
  1. Start the server

    Terminal window
    framefox run
  2. Access your application

    Open your browser and navigate to http://localhost:8000

Available server options:

Server Configuration

  • --port: Specify the port (8000 by default)
  • --help: Show help message
  1. List available commands

    Terminal window
    framefox create

    This displays the available creation commands:

    🦊 Framefox Framework CLI
    Swift, smart, and a bit foxy
    CREATE COMMANDS
    Create various resources like entities or CRUD operations.
    ┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
    ┃ Command ┃ Description ┃
    ┑━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
    β”‚ auth β”‚ Create a new authenticator β”‚
    β”‚ controller β”‚ Create a simple controller and view. β”‚
    β”‚ crud β”‚ Create a CRUD controller for the given entity name. β”‚
    β”‚ entity β”‚ Create a new entity β”‚
    β”‚ env β”‚ Generate a new .env file with secure default values β”‚
    β”‚ hash β”‚ Create a hashed password and display the result β”‚
    β”‚ register β”‚ Create the register controller and view β”‚
    β”‚ user β”‚ Create a user entity for the authentication. β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    Run 'framefox create COMMAND --help' for specific command details
  2. Create your first controller

    Terminal window
    framefox create controller
  3. Follow the interactive prompt

    What is the name of the controller ?(snake_case)
    Controller name: home
    Controller created successfully: src/controller/home_controller.py
    View created successfully: templates/home/index.html
Terminal window
framefox create auth # Create a new authenticator
framefox create controller # Create a simple controller and view
framefox create crud # Create a CRUD controller for an entity
framefox create entity # Create a new entity
framefox create env # Generate a new .env file with secure defaults
framefox create hash # Create a hashed password
framefox create register # Create the register controller and view
framefox create user # Create a user entity for authentication

The CLI provides comprehensive database management commands:

Terminal window
framefox database create-migration # Create new migration file
framefox database upgrade # Apply pending migrations
framefox database downgrade # Rollback migrations

Clear application cache when needed:

Terminal window
framefox cache clear # Clear all cache
framefox cache clear --type=routes # Clear specific cache type

Development debugging utilities:

Terminal window
framefox debug router # List all registered routes
framefox debug config # Display configuration values

Generate test data for development:

Terminal window
framefox mock generate # Generate sample data
framefox mock load # Load predefined fixtures