isort CLI
The CLI sorts and groups Python imports so agents can prepare consistent changes with an inspectable diff before applying them.
- 6,966 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The CLI rewrites imports in selected files; recursive execution can affect several project directories.
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/isortDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The CLI rewrites imports in selected files; recursive execution can affect several project directories.
This is third-party code. Review the repository files before installing.
What it does
Wrapping, indentation and import groups are defined in isort configuration. An agent applies those rules to selected Python files, and users inspect differences through `--diff` before writing. Keeping import ordering in a separate change makes functional edits easier to review. The CLI supports repeatable pre-review cleanup, editor integrations and pre-commit. Its rules should be aligned with other formatters used in the project.
Who it is for. Python code reviewers separating import-order cleanup from an agent’s functional edits.
Good fit when
- Agent-added imports do not follow the project’s ordering rules.
- A developer separates formatting from a functional change before review.
- Several Python files use inconsistent import groups.
- The team adds a local import check to `pre-commit` before creating a commit.
Not a fit when
- You need one tool to format all Python syntax.
- You expect automatic removal of every unused project dependency.
- Import reordering would be accepted without reviewing or testing behavior.
Example request
Show the import-sorting diff only for changed Python files, keeping it separate from functional edits.Limitations
The current isort requires Python 3.11 or newer to run, although formatted code may target another language version. It focuses on imports and does not replace whole-file formatting or program tests. The `--atomic` mode checks syntax before writing and is off by default because Python versions may differ. Recursive runs include nested files, so scope the directory and inspect proposed changes through `--diff` first.
How to disable. Remove isort from scripts or editor settings. Restore already applied import edits from a saved file or Git version.
FAQ
How do I inspect changes without writing?
Use `isort mypythonfile.py --diff`.
Can I process several files?
Yes. Pass their paths as separate arguments.
How do I process a directory?
Pass the directory path. For example, `isort .` processes the current directory recursively.
What does `--atomic` check?
isort checks syntax before writing changes. Test program behavior separately.
Does isort integrate with editors?
Yes. Separate plugins are available for several editors.
Discussion
No questions or reviews yet.
Related
CLI toolsTach is a Python CLI that checks imports separately from the running application, so architecture rules can run in CI.
A CLI turns Git changes into a guided code walkthrough with questions and explanations written by your existing agent
typos is a spelling-check CLI with a preview diff, so users can review project names before writing corrections.
Refurb analyzes Python code and suggests focused improvements with rule identifiers, explanations and target-version awareness.
A CLI opens diffs and documents in a terminal so a person can annotate lines and pass feedback to a coding agent
A CLI that opens a local git diff in the browser like GitHub's Files changed tab; comments copy out as prompts for an agent
README in short
Multiline import options and Black compatibility guidance are available. Pre-commit support integrates the CLI into project checks.