Rulepython
Devscripts Rule
Writing Devscripts
Import from devscripts.bootstrap:
"""Description of the script.
Usage:
uv run python -m devscripts.my_script [args]
"""
from devscripts.bootstrap import env, letta, gel
def main() -> None:
project_id = env('LETTA_PROJECT_ID')
agents = letta.agents.list()
users = gel.query('select User { telegram_id }')
if __name__ == '__main__':
main()
Bootstrap API
env(key, default=None)- get env varletta- sync Letta clientgel- sync Gel client
Key Rules
- Sync clients only (no async/await)
- Import from
devscripts.bootstrap, NOTletta_bot.config - Use
env()for env vars, NOTCONFIG - Include usage docstring at top
- Use argparse for CLI args
Note: devscripts are excluded from mypy and type annotation checks (see pyproject.toml)