Management CLI
A local-only CLI for inspecting and modifying rate limit overrides during development and debugging. Point it at a Redis/Valkey instance and operate on overrides without writing code.
Local use only
This tool is for local development and staging environments. It is not meant to run in production containers. If a Bender manifest is detected and the environment is prod, the CLI refuses to start.
python -m application_kit.manage <command> <action> [options]
Rate Limit Overrides
The ratelimit command provides CRUD operations on per-project and per-organization rate limit overrides stored in Redis/Valkey.
Note
The CLI connects to Redis via get_async_redis_instance("ratelimit"), which reads the connection from your Bender manifest. Make sure the ratelimit dependency is configured in your manifest.
Project Overrides
Set, inspect, and remove overrides for a specific project:
# Set an override (optional --ttl for auto-expiry)
python -m application_kit.manage ratelimit set \
--org-id 1 --project-id 2 --endpoint /api/v1/search \
--max-requests 500 --expiry 60 --ttl 3600
# Get current override
python -m application_kit.manage ratelimit get \
--org-id 1 --project-id 2 --endpoint /api/v1/search
# Delete an override
python -m application_kit.manage ratelimit delete \
--org-id 1 --project-id 2 --endpoint /api/v1/search
# List all overrides for a project
python -m application_kit.manage ratelimit list \
--org-id 1 --project-id 2
# Clear all overrides for a project
python -m application_kit.manage ratelimit clear \
--org-id 1 --project-id 2
Organization Overrides
Org overrides act as a fallback when no project-specific override exists. Each project still keeps its own counter.
# Set an org override
python -m application_kit.manage ratelimit set-org \
--org-id 1 --endpoint /api/v1/search \
--max-requests 1000 --expiry 60
# Get current org override
python -m application_kit.manage ratelimit get-org \
--org-id 1 --endpoint /api/v1/search
# Delete an org override
python -m application_kit.manage ratelimit delete-org \
--org-id 1 --endpoint /api/v1/search
# List all overrides for an org
python -m application_kit.manage ratelimit list-org \
--org-id 1
# Clear all overrides for an org
python -m application_kit.manage ratelimit clear-org \
--org-id 1
Key Suffix
Use --suffix to target element-based rate limit overrides. The suffix is appended to the endpoint pattern to form the full key, matching how apply_element_rate_limit appends /elements to the rate limit key.
# Set an element-based override
python -m application_kit.manage ratelimit set \
--org-id 1 --project-id 2 --endpoint /api/v1/search \
--suffix /elements --max-requests 10000 --expiry 60
# Get the element-based override
python -m application_kit.manage ratelimit get \
--org-id 1 --project-id 2 --endpoint /api/v1/search \
--suffix /elements
Output
| Action | Output |
|---|---|
set / set-org |
Confirmation line |
get / get-org |
max_requests=N expiry=N or "No override found" |
delete / delete-org |
"Deleted" or "Not found" |
list / list-org |
One line per override: endpoint max_requests=N expiry=N |
clear / clear-org |
Count of deleted overrides |
Override Priority
The rate limiter resolves limits in this order:
- Project override — per-project, per-endpoint
- Org override — per-org, per-endpoint (fallback)
- Defaults — from the
ProjectRateLimiterconfiguration