Tach CLI
Tach is a Python CLI that checks imports separately from the running application, so architecture rules can run in CI.
- 2,861 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- Tach reads code and configuration and creates reports; running with `--web` sends configuration to an external service.
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/tachDetects 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.
- Tach reads code and configuration and creates reports; running with `--web` sends configuration to an external service.
This is third-party code. Review the repository files before installing.
What it does
Tach is a CLI that reads Python module boundaries and allowed dependencies from project configuration. Its CLI reports imports that violate those rules and can restrict cross-module use to public interfaces. Violations produce import locations and a nonzero exit code for CI and pre-commit, while additional commands visualize dependencies and report module usage.
Who it is for. Python monolith architects maintaining agreed module boundaries as a codebase grows.
Good fit when
- After refactoring, the team prevents new imports across internal module boundaries.
- A monolith is being split into parts with explicit allowed dependencies.
- Import cycles appear in the code, and you want them detected before application startup.
- Before moving a module, an architect examines its dependencies and consumers.
Not a fit when
- You expect architecture choices to be made automatically.
- The project contains no Python modules.
- You need runtime performance measurement.
Example request
Propose boundaries for three Python modules and report current violations. Do not use web visualization.Limitations
The team defines boundaries and allowed dependencies, so a clean result establishes configuration compliance rather than architectural correctness. Monorepos need explicit Python source roots. `tach show --web` sends tach.toml content to a remote visualizer; plain show creates a local graph. Incremental adoption leaves some modules unchecked, so document coverage before making results a required gate.
How to disable. Remove tach check from CI and hooks, then uninstall. Boundary configuration can remain as architecture documentation.
FAQ
How do I choose initial modules?
Run `tach init` and mark boundaries in the tree, starting with a subset if needed.
How do I enforce rules?
Run `tach check`; violations report import locations and a nonzero exit.
Can I generate a local graph?
Yes. `tach show` creates `tach_module_graph.dot`; `--web` uses a remote service.
How do I handle nested source roots?
Mark source roots with s during init and verify package coverage.
How do I find module consumers?
Run `tach report` on its path and review dependencies and usages.
Discussion
No questions or reviews yet.
Related
CLI toolsThe CLI manages Python projects, environments and package builds so agents can run repeatable repository-defined commands.
The CLI sorts and groups Python imports so agents can prepare consistent changes with an inspectable diff before applying them.
A CLI asks questions about a Git diff before push and uses a chosen model to assess how well the developer understands the change.
Refurb analyzes Python code and suggests focused improvements with rule identifiers, explanations and target-version awareness.
The tqdm command adds a progress indicator to line or byte streams so users can follow a long script prepared by an agent.
A CLI turns Git changes into a guided code walkthrough with questions and explanations written by your existing agent
README in short
Configuration supports monorepos and namespace packages. Source roots are marked separately so the CLI can locate imports below the repository root.