API UP CLI
The API UP CLI helps the development of APIs using the API UP web framework. When you create an Application in https://apiup.ai, it automatically creates a Git repository with the initial project structure and a working API.
- Clone the App's Git repository;
- Download and use the API UP CLI tool inside the root DIR of this Git repository.
CLI Download
on Linux
curl -L -o apiup https://github.com/API-Up/apiup-cli/releases/download/latest/apiup-linux-x64-latest ; chmod +x apiup
On macOS
curl -L -o apiup https://github.com/API-Up/apiup-cli/releases/download/latest/apiup-macos-arm64-latest ; chmod +x apiup
On Windows 10+
curl -L -o apiup https://github.com/API-Up/apiup-cli/releases/download/latest/apiup-windows-x64-latest.exe
Requirements
Getting started
$ apiup check # Check if the Env has the requirements to run the API
$ apiup models # Generate models from YAML schemas
$ apiup start # Start the API
$ apiup ping # Ping the API to check it is running
$ apiup create_admin # To create the first user and other admins
$ apiup admin # Open the Admin UI
$ apiup stop # Stop the Docker containers
Development
$ apiup models # Generate models from YAML schemas
$ apiup format # Format the source code
$ apiup lint # Format and Lint the source code
$ apiup compile # Check for syntax errors
$ apiup tests # Run unit tests
$ apiup coverage # Run test coverage
$ apiup build # Build the Docker image
$ apiup rebuild # Rebuild the Docker image (no cache)
$ apiup ci # Run all: format lint build tests
$ apiup info # Check the API resources
$ apiup db_changes # Check the differences between the current schema and the DB
$ apiup db_migrate # Update the database schema with the current one
$ apiup db_clean # Drop the dev database, for a fresh start
$ apiup python # Start the Python shell
Development Integration (optional)
# To use Git hooks for CI
$ pip install pre-commit
$ pre-commit install # to run CI before any Git commit
$ pre-commit uninstall # to remove the Git CI hooks
Operation
Next steps
- Add Python dependencies to the
requirements-app.txtfile - Customize your Docker image in
Dockerfile(keep the base image though) - Implement Commands and Tasks inside the apps' folder, in subfolders, like the
sampleapp