> ## Documentation Index
> Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IDE integration

> Set up stack-aware Dockerfile linting, formatting, and auto-fix in VS Code, JetBrains IDEs, and any LSP-compatible editor.

tally provides real-time diagnostics in your editor via a built-in Language Server Protocol (LSP) server. Official extensions are available for VS
Code and JetBrains IDEs. Any other editor that supports LSP can connect using `tally lsp --stdio`.

> [card] [VS Code](#vs-code)
>
> Install the official `wharflab.tally` extension from the Visual Studio Marketplace.

> [card] [JetBrains](#jetbrains-ides)
>
> Install Tally in PhpStorm, RubyMine, Rider, and other JetBrains IDEs.

> [card] [Generic LSP](#generic-lsp)
>
> Run `tally lsp --stdio` to connect any LSP-compatible editor.

***

## VS Code

Install the official extension from the Visual Studio Marketplace:

**Extension ID:** `wharflab.tally`

**[Install from Marketplace](https://marketplace.visualstudio.com/items?itemName=wharflab.tally)**

The extension provides:

* Real-time linting diagnostics as you type.
* Inline violation messages with rule codes and doc links.
* Squiggles and Problems panel integration.
* Picks up `.tally.toml` config files automatically from your workspace.

The extension uses `tally lsp --stdio` under the hood. Marketplace packages
include a platform-specific `tally` binary, which is used automatically when no
compatible project or environment installation is available.

***

## JetBrains IDEs

Install the official plugin from JetBrains Marketplace:

**Plugin ID:** `30255-tally`

**[Install from JetBrains Marketplace](https://plugins.jetbrains.com/plugin/30255-tally)**

The plugin works in IntelliJ-based IDEs including **PhpStorm**, **RubyMine**, Rider, IntelliJ IDEA, GoLand, PyCharm, and WebStorm.

It provides:

* Stack-aware Dockerfile diagnostics for PHP, Ruby, PowerShell, shell, and Windows containers.
* Modern BuildKit guidance for heredocs, cache mounts, multi-stage builds, and security.
* Safe quick fixes, rule documentation links, and Fix All on Save.
* Dockerfile and Containerfile formatting through **Reformat Code**.
* Automatic `.tally.toml` / `tally.toml` discovery and a bundled Tally binary.

> [tab] Stack-aware diagnostics
>
> ![PhpStorm showing Tally diagnostics for Composer production dependencies, OPcache, Xdebug, and package cache mounts](https://mintcdn.com/wharflab-tally-64/cEIYQUwk_UN06JWT/images/integrations/tally-phpstorm-diagnostics.png?fit=max\&auto=format\&n=cEIYQUwk_UN06JWT\&q=85\&s=9703c828020bf63c2a412c790f8806ec)
>
> Tally identifies Composer, OPcache, Xdebug, and package-cache issues in PhpStorm.

> [tab] Quick fixes
>
> ![PhpStorm intention menu showing Tally quick fixes and documentation actions for PHP Dockerfile rules](https://mintcdn.com/wharflab-tally-64/cEIYQUwk_UN06JWT/images/integrations/tally-phpstorm-quick-fixes.png?fit=max\&auto=format\&n=cEIYQUwk_UN06JWT\&q=85\&s=6169789a4f669e56cbbde9aef6bb04f9)
>
> Use Alt+Enter to apply a fix, suppress a rule, or open its documentation.

> [tab] RubyMine
>
> ![RubyMine showing Tally diagnostics for Bundler deployment mode, Rails asset compilation, health checks, and YJIT](https://mintcdn.com/wharflab-tally-64/cEIYQUwk_UN06JWT/images/integrations/tally-rubymine-diagnostics.png?fit=max\&auto=format\&n=cEIYQUwk_UN06JWT\&q=85\&s=7266ce9743b44acd81084cba2adae8ce)
>
> Tally identifies Bundler deployment, Rails asset compilation, health-check, and YJIT issues in RubyMine.

### Stack-specific analysis

Tally analyzes the tools and runtimes used by each stage rather than treating every `RUN` instruction as generic shell text.

* **PhpStorm:** Composer production dependencies, OPcache, Xdebug, PHP package installs, cache mounts, and security.
* **RubyMine:** Bundler deployment mode and cache mounts, Rails asset compilation and health checks, YJIT, runtime state paths, and secrets.
* **Rider and Windows projects:** PowerShell semantics, Windows container behavior, effective `SHELL`, and PowerShell security rules.

BuildKit and Hadolint-compatible checks remain available alongside these stack-specific rules.

### Configure the plugin

Open **Settings → Tools → Tally** to configure the executable, an explicit configuration file, unsafe fixes, formatting, and Fix All on Save. The
plugin discovers the nearest `.tally.toml` or `tally.toml` by default.

***

## Invocation-aware diagnostics

By default, the LSP server lints the Dockerfile document you are editing. If your workspace builds that Dockerfile through Bake or Compose, configure
invocation entrypoints so diagnostics use the same build args, target stage, platform, and build context as the real build.

User-facing setting:

```json theme={null}
{
  "tally.invocationEntrypoints": ["compose.yaml", "docker-bake.hcl"]
}
```

For generic LSP clients that send the full tally settings envelope, the payload shape is:

```json theme={null}
{
  "tally": {
    "workspaces": [
      {
        "uri": "file:///repo",
        "settings": {
          "invocationEntrypoints": ["compose.yaml", "docker-bake.hcl"]
        }
      }
    ]
  }
}
```

When a configured entrypoint resolves to the open Dockerfile, diagnostics use source labels such as `tally/bake:api` or `tally/compose:worker`.

If a code action request spans diagnostics from more than one invocation context, mutating quick fixes and fix-all actions are hidden. This prevents
one edit from being applied as if it were valid for every target or service.

See [Build invocations](https://tally.wharflab.com/guides/build-invocations.md) for CLI behavior and orchestrator limitations.

***

## Generic LSP

Any editor that supports the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) can use tally's built-in LSP server
over stdio.

### Start the LSP server

If tally is installed globally:

```bash theme={null}
tally lsp --stdio
```

If you prefer to use the npm package without a global install:

```bash theme={null}
npx -y tally-cli lsp --stdio
```

### Editor configuration examples

The exact configuration depends on your editor's LSP client. The general pattern is to configure your LSP client to run `tally lsp --stdio` for
Dockerfile files (`dockerfile` language ID).

```lua Neovim (nvim-lspconfig) theme={null}
-- In your Neovim config (lua)
require('lspconfig').tally.setup({
  cmd = { 'tally', 'lsp', '--stdio' },
  filetypes = { 'dockerfile' },
  root_dir = require('lspconfig.util').root_pattern('.tally.toml', 'tally.toml', '.git'),
})
```

```toml Helix (languages.toml) theme={null}
[[language]]
name = "dockerfile"
language-servers = ["tally"]

[language-server.tally]
command = "tally"
args = ["lsp", "--stdio"]
```

```json Zed (settings.json) theme={null}
{
  "lsp": {
    "tally": {
      "binary": {
        "path": "tally",
        "arguments": ["lsp", "--stdio"]
      }
    }
  }
}
```

> [!NOTE]
>
> tally's LSP server uses cascading config discovery — it finds the nearest `.tally.toml` relative
> to each Dockerfile being edited, the same way the CLI does.


## Related topics

- [tally/eol-last](https://tally.wharflab.com/rules/tally/eol-last.md)
- [tally/no-trailing-spaces](https://tally.wharflab.com/rules/tally/no-trailing-spaces.md)
- [tally/consistent-indentation](https://tally.wharflab.com/rules/tally/consistent-indentation.md)
- [CI/CD integration](https://tally.wharflab.com/guides/ci-cd.md)
- [EditorConfig integration](https://tally.wharflab.com/integrations/editorconfig.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.