{"slug": "introducing-polars-cli", "title": "Introducing Polars CLI", "summary": "Polars released the `polars` command-line tool, a compiled Rust binary that runs SQL directly on local and remote files through the Polars query engine with no Python interpreter required. The CLI is designed for agentic workloads, returning exit code 0 on successful queries and Rust-style errors with hints, such as suggesting LENGTH when a query uses the unsupported function 'len'. The initial release supports the same native local and remote files as Python Polars, with Delta Lake, Iceberg, Excel and database scanning planned for later releases; it installs via `uv tool install polars-cli` or GitHub releases.", "body_md": "Last months we have made a large leaps in SQL support in Polars. As we recognize that agentic workloads are becoming more dominant, we want to expose our engine to those workloads. LLM’s are great at SQL and we have a great engine that agents should benefit from. As SQL doesn’t require a host language (as opposed to DataFrames), it is perfectly suited for a CLI. So today we are releasing the `polars` command-line tool that runs SQL on files with the Polars query engine. No Python required, no server, just fast answers.\n\n## Polars CLI and design for agentic workloads\n\nBesides humans, CLI’s have become the defacto interface for agents. The `polars` CLI is designed with this purpose in mind. We want to reduce iterations, startup time and tokens. For this a few things are important:\n\n- Model iterations/ turns; Every iteration costs model time and execution time of Polars often dwarfs that, especially for local files.\n- Informative error messages (inspired by Rust); Errors point at the mistake and add a hint, such that the next iteration will lead to a correct query without needing to defer to documentation. And exa\n- Documentation is available in the CLI itself, under `--help` you can find working examples and function lists.\n- Successful queries are indicated immediately with an exit code 0. This means the agent doesn’t have to verify success.\n- No Python required on boot. The `polars` CLI is a compiled rust binary that has super fast boot times. Most queries we can execute without any Python callbacks and thus no Python interpreter penalty.\n\n## Examples\n\nLet’s go through a few examples. For query exploration we have discovery operations lile `“DESCRIBE”.\n\n``` bash\n$ polars --format csv -c \"DESCRIBE 'foods.csv'\"\ncolumn_name,column_type\ncategory,VARCHAR\ncalories,BIGINT\nfats_g,DOUBLE PRECISION\nsugars_g,BIGINT\n```\n\nAfter the schema of a file is known, we can immediately compute the summaries we are interested in.\n\n``` bash\n$ polars --format csv -c \"SELECT category, count(*) AS n, avg(calories) AS avg_calories FROM 'foods.csv' GROUP BY category ORDER BY n DESC, category\"\ncategory,n,avg_calories\nseafood,8,156.25\nfruit,7,58.57142857142857\nvegetables,7,27.428571428571427\nmeat,5,108.0\n```\n\nAnd if a query fails due to a syntax error, we give informative errors, so the agent can correct without deferring to documentation.\n\n``` bash\n$ polars --format csv -c \"SELECT LEN(category) FROM 'foods.csv'\"\nSQLInterfaceError: unsupported function 'len'\n --> <command>:1:8\n  |\n1 | SELECT LEN(category) FROM 'foods.csv'\n  |        ^^^^^^^^^^^^^\n  = hint: use LENGTH instead\n$ echo $?\n1\n```\n\n## Installation\n\nTo get started, you can download the `polars-cli` from pypi with `uv tool install polars-cli` or use one of our github releases \n\n## Last words\n\nThe initial release supports the native local and remote files that are supported by Python Polars. Next releases will include Delta Lake and Iceberg support as well as excel and scanning from databases. If you find any issue or want a feature, please contact us on github: [https://github.com/pola-rs/polars/](https://github.com/pola-rs/polars/).", "url": "https://wpnews.pro/news/introducing-polars-cli", "canonical_source": "https://pola.rs/posts/announcing-agentic-polars-cli/", "published_at": "2026-12-01 00:00:00+00:00", "updated_at": "2026-12-01 15:47:00.141546+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-infrastructure"], "entities": ["Polars", "polars-cli", "GitHub", "PyPI", "Delta Lake", "Iceberg"], "also_reported_by": [], "takeaway": "Agents can query files with the `polars` CLI's SQL engine without Python, relying on exit code 0 for success and hint-bearing errors like 'use LENGTH instead' to self-correct without reading docs.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/introducing-polars-cli", "markdown": "https://wpnews.pro/news/introducing-polars-cli.md", "text": "https://wpnews.pro/news/introducing-polars-cli.txt", "jsonld": "https://wpnews.pro/news/introducing-polars-cli.jsonld"}}