{"id":6263,"library":"textual-dev","title":"Textual Development Tools","description":"textual-dev is a Python library that provides command-line utilities and a development console to aid in building and debugging Textual TUI applications. It is released alongside the main Textual framework, which typically has a rapid release cadence, often weekly or bi-weekly for minor versions. The current version is 1.8.0.","status":"active","version":"1.8.0","language":"en","source_language":"en","source_url":"https://github.com/Textualize/textual-dev","tags":["textual","tui","cli","dev-tools","debugger","terminal-ui","developer-experience"],"install":[{"cmd":"pip install textual-dev","lang":"bash","label":"Install textual-dev"},{"cmd":"pip install textual textual-dev","lang":"bash","label":"Install Textual (framework) and dev tools"}],"dependencies":[{"reason":"textual-dev provides tools for Textual applications and requires Textual to function. It is highly recommended to install both together for development.","package":"textual","optional":false},{"reason":"Used for the devtools connection and serving applications in a browser.","package":"aiohttp","optional":true},{"reason":"Common dependency for building command-line interfaces.","package":"click","optional":true}],"imports":[],"quickstart":{"code":"import os\nfrom textual.app import App, ComposeResult\nfrom textual.widgets import Header, Footer, Static\n\n# --- Save this as my_app.py ---\nclass MyApp(App):\n    BINDINGS = [(\"d\", \"toggle_dark\", \"Toggle dark mode\")]\n\n    def compose(self) -> ComposeResult:\n        yield Header()\n        yield Static(\"Hello, Textual Devtools!\", id=\"hello\")\n        yield Footer()\n\n    def action_toggle_dark(self) -> None:\n        self.dark = not self.dark\n\nif __name__ == \"__main__\":\n    app = MyApp()\n    app.run()","lang":"python","description":"To use textual-dev, first save the provided Python code as `my_app.py`. Then, open *two separate terminal windows*. In the first terminal, start the Textual development console. In the second, run your application in development mode, enabling it to connect to the console. This setup allows you to see logs, debug information, and perform live editing tasks.\n\nTerminal 1:\n```bash\npip install textual textual-dev\ntextual console\n```\n\nTerminal 2:\n```bash\npython my_app.py --dev\n# or, if textual is installed in path:\n# textual run --dev my_app.py\n```"},"warnings":[{"fix":"`pip install textual textual-dev`","message":"The `textual[dev]` extra was refactored into a separate `textual-dev` package in Textual v0.29.0. Users upgrading from older Textual versions (prior to 0.29.0) must now explicitly install `textual-dev` in addition to `textual` to access the development tools.","severity":"breaking","affected_versions":"<0.29.0 (of textual)"},{"fix":"Refer to the Textual documentation and changelog for compatibility notes before upgrading major/minor versions of either `textual` or `textual-dev`.","message":"Textual, the core framework, has a rapid development cycle with frequent releases (often weekly or bi-weekly). While `textual-dev` aims to maintain compatibility, breaking changes in Textual's API can occasionally affect the functionality of the dev tools. Always check Textual's changelog for significant updates.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Replace `print()` calls with `self.log(\"Your message\")` or `self.app.log(\"Your message\")` within your Textual application classes. Configure Textual's logging for more control.","message":"While the `textual console` can display output from `print()` statements in your application, the recommended approach for logging and debugging in Textual is to use `app.log()` or the dedicated logging facilities provided by the `textual` framework. `print()` is generally discouraged for structured debugging output in Textual apps.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to `textual-dev` 1.8.0 or later for Python 3.14 compatibility: `pip install --upgrade textual-dev`.","message":"Recent releases of `textual-dev` (v1.8.0) explicitly add Python 3.14 compatibility. If you are using an older version of `textual-dev` or `textual` with Python 3.14, you may encounter unexpected issues or lack of support.","severity":"gotcha","affected_versions":"<1.8.0"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}