Skip to content

AryamanSharma14/-CLI-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple Server Manager (FastAPI + Typer CLI)

A minimal project to manage “servers” using:

  • FastAPI backend (in-memory CRUD)
  • Typer CLI that calls the API via HTTP
  • Clean, beginner-friendly code

Repository

What It Does

  • List all servers
  • Get server details by ID
  • Create a server
  • Update a server (only the fields passed)
  • Delete a server

Tech Stack

  • Python 3.10+
  • FastAPI
  • Uvicorn
  • Typer
  • requests

Project Structure

  • dummy_api.py — FastAPI app exposing CRUD endpoints
  • cli_app.py — Typer CLI that calls the API

Setup

1) Clone the repo

git clone https://github.com/d3vilal/-CLI-.git
cd -CLI-

2) Create and activate virtual environment

python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate

3) Install dependencies

pip install fastapi uvicorn typer requests

Run the API

uvicorn dummy_api:app --reload

Use the CLI

In another terminal (with the virtual environment activated):

python cli_app.py list
python cli_app.py info 1
python cli_app.py add --title "web" --team "dev" --cluster "mumbai" --plan "basic" --auto_increase_storage
python cli_app.py update 1 --title "web-updated" --plan "premium"
python cli_app.py delete 1

Default API URL in CLI

API = "http://127.0.0.1:8000"  # in cli_app.py

API Endpoints

Example Server JSON

{
  "id": 1,
  "title": "main_server",
  "team": "bird",
  "cluster": "mumbai",
  "plan": "basic",
  "auto_increase_storage": false
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages