kbws-forge-cli
Scaffolding CLI for the kbws-forge-runtime agent framework. Generate a production-shaped FastAPI agent service in seconds — layered architecture, authentication, multi-environment config, persistent logging, model middlewares, structured output and a full test suite, out of the box.
Install
pip install kbws-forge-cli
Requires Python ≥ 3.13 and uv.
Usage
Run forge init and answer the prompts (Vite-style interactive picker):
forge init
✔ Project name: … my-agent
✔ Select a template: › service-agent
Or pass everything explicitly for non-interactive/scripted use:
forge init my-agent # name given, template picked interactively
forge init my-agent -t base-agent # fully non-interactive
Then start developing:
cd my-agent
uv sync # installs kbws-forge-runtime from PyPI
uv run uvicorn app.main:app --reload # dev server
uv run pytest # tests (fake models, no cost)
Templates
| Template | Description |
|---|---|
service-agent (default) |
Full layered service: business aggregation (agents/) + technical layering (app/), global exception handling, unified {code, info, data} responses, API-key auth, multi-environment config, persistent JSON logging, request-id tracing, model-middleware and structured-output examples, unit/API/integration tests |
base-agent |
Minimal FastAPI Hello World for a quick start |
New templates placed in the CLI's templates/ directory appear in the
interactive picker automatically.
Generated project
forge init my-service produces:
my-service/
├── agents/ # business units: one directory per agent
│ ├── <module_name>/ # main agent
│ │ ├── agent.py # exports `agent`; middleware example
│ │ ├── prompts.py # composable Prompt components (code-first)
│ │ └── tools.py # this agent's tools
│ └── extract/ # structured-output example (output_schema)
│ ├── agent.py # pydantic schema -> Agent(output_schema=...)
│ └── prompts.py
├── app/ # technical layering
│ ├── main.py # create_app() + lifespan (load_agents)
│ ├── core/ # config / errors / response / security / logging
│ ├── api/v1/ # agents / sessions / chat / chat_stream / health
│ ├── schemas/ # request & response models
│ ├── services/ # chat orchestration
│ └── providers/ # LLM factory
├── tests/ # unit / api / integration (real-provider gated)
├── scripts/run.sh
└── .env.example # multi-env config template
Endpoints: GET /api/v1/health · GET /api/v1/agents · POST /api/v1/sessions ·
POST /api/v1/chat (supports variables, returns parsed for structured
output) · POST /api/v1/chat_stream (SSE), all behind X-API-Key / Bearer
auth except health.
Development
uv sync
uv run pytest packages/forge-cli/tests
License
MIT License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kbws_forge_cli-1.0.0.tar.gz.
File metadata
- Download URL: kbws_forge_cli-1.0.0.tar.gz
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58679814274f28b4eb0cd759d451b837a5b041edd6904914dc33a0bf55743f7c
|
|
| MD5 |
dae78fe46883d4bfefa6679f090aa4c2
|
|
| BLAKE2b-256 |
f7035b03433095511ec702824b9b18508043cdd15380f5ab6f33187d357bf1ae
|
File details
Details for the file kbws_forge_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: kbws_forge_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 42.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcb6d2c8c2a0735690dd9f7c386d7b752c229b38ead345bdb8e09a401c6e5bef
|
|
| MD5 |
2bef32a841ea8081a0764063d6a07322
|
|
| BLAKE2b-256 |
d413c0b474750ac0a3ed6e6fc22473d4f987325acc2f68a027929acd4062de9f
|