{"id":19330415,"url":"https://github.com/tortoise/tortoise-cli","last_synced_at":"2025-10-19T00:18:25.310Z","repository":{"id":57476706,"uuid":"390398626","full_name":"tortoise/tortoise-cli","owner":"tortoise","description":"A cli tool for tortoise-orm, build on top of click and ptpython","archived":false,"fork":false,"pushed_at":"2023-03-15T00:56:28.000Z","size":103,"stargazers_count":21,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-11T21:40:34.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tortoise.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-28T15:20:28.000Z","updated_at":"2024-12-15T13:24:35.000Z","dependencies_parsed_at":"2022-09-12T14:32:45.049Z","dependency_job_id":null,"html_url":"https://github.com/tortoise/tortoise-cli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tortoise%2Ftortoise-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tortoise%2Ftortoise-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tortoise%2Ftortoise-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tortoise%2Ftortoise-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tortoise","download_url":"https://codeload.github.com/tortoise/tortoise-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235614120,"owners_count":19018401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T02:36:16.518Z","updated_at":"2025-10-07T09:32:00.392Z","avatar_url":"https://github.com/tortoise.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tortoise-cli\n\n[![image](https://img.shields.io/pypi/v/tortoise-cli.svg?style=flat)](https://pypi.python.org/pypi/tortoise-cli)\n[![image](https://img.shields.io/github/license/tortoise/tortoise-cli)](https://github.com/tortoise/tortoise-cli)\n[![image](https://github.com/tortoise/tortoise-cli/workflows/ci/badge.svg)](https://github.com/tortoise/tortoise-cli/actions?query=workflow:ci)\n\nA cli tool for tortoise-orm, build on top of asyncclick and ptpython.\n\n## Installation\n\nYou can just install from pypi.\n\n```shell\npip install tortoise-cli\n```\n\n## Quick Start\n\n```shell\n\u003e tortoise-cli -h                                                                                                                                                                 23:59:38\nUsage: tortoise-cli [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  -V, --version      Show the version and exit.\n  -c, --config TEXT  TortoiseORM config dictionary path, like\n                     settings.TORTOISE_ORM\n  --generate-schemas / --no-generate-schemas\n                     Whether generate schemas after TortoiseORM\n                     inited\n  -h, --help         Show this message and exit.\n\nCommands:\n  shell  Start an interactive shell.\n```\n\n## Usage\n\nFirst, you need make a TortoiseORM config object, assuming that in `settings.py`.\n\n```python\nTORTOISE_ORM = {\n    \"connections\": {\n        \"default\": \"sqlite://:memory:\",\n    },\n    \"apps\": {\n        \"models\": {\"models\": [\"examples.models\"], \"default_connection\": \"default\"},\n    },\n}\n```\n\n## Interactive shell\n\n![image](https://raw.githubusercontent.com/tortoise/tortoise-cli/main/images/shell.png)\n\nThen you can start an interactive shell for TortoiseORM.\n\n```shell\ntortoise-cli -c settings.TORTOISE_ORM shell\n```\n\nOr you can set config by set environment variable.\n\n```shell\nexport TORTOISE_ORM=settings.TORTOISE_ORM\n```\nOr you can set it in `pyproject.toml`.\n\n```toml\n[tool.aerich]\ntortoise_orm = \"my_module.TORTOISE_ORM\"\n```\n\nThen just run:\n\n```shell\ntortoise-cli shell\n```\n\n## License\n\nThis project is licensed under the\n[Apache-2.0](https://github.com/tortoise/tortoise-cli/blob/main/LICENSE) License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftortoise%2Ftortoise-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftortoise%2Ftortoise-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftortoise%2Ftortoise-cli/lists"}