← Back to Dashboard
Verified Production Fix

[docker/cli] Add `--no-trunc` and `--all` equivalent options to the CLI config file

GH-docker/cli#6673 • Mar 07, 2026

### ROOT CAUSE The issue arises because Docker's CLI configuration does not allow setting `--no-trunc` and `--all` flags globally, forcing users to include them with every command. This leads to inconvenience for users relying on consistent output formats. ### CODE FIX To resolve this, we'll modify the Docker CLI configuration to include new options for `no_trunc` and `all` and update the relevant commands to respect these settings. 1. **Update Configuration File**: - Add new keys `no_trunc` and `all` in `config.json`. 2. **Modify Command Handling**: - Read these keys in the `docker/images` command and apply the corresponding flags. Here's how the code can be adjusted:
json
// ~/.docker/config.json
{
  "no_trunc": true,
  "all": true
}


3. **Update CLI Command Parsing**:


// In docker/images/images.go
func NewImagesCommand(c *command.Context) *cobra.Command {
    // Read config
    config := c.Config()
    noTrunc := config.Images.NoTrunc
    showAll := config.Images.All

    // Apply flags
    cmd.Flags().SetBool("no-trunc", noTrunc)
    cmd.Flags().SetBool("all", showAll)

    return cmd
}


This fix allows users to set these options in their config file, ensuring consistent output across CLI commands.

Deploy with DigitalOcean

Use this fix in production instantly. Claim your $200 developer credit.

Get Started →