How to Configure OfficeCLI Auto-Update and Skip Checks via Environment Variables

Set OFFICECLI_SKIP_UPDATE=1 to skip update checks for a single command, or run officecli config autoUpdate false to disable automatic updates permanently in the iOfficeAI/OfficeCLI tool.

OfficeCLI by iOfficeAI automatically checks for newer releases in the background when you run commands. You can configure this behavior using environment variables for temporary overrides or persistent configuration settings to disable updates entirely. This guide explains exactly how to control OfficeCLI's update behavior using the source code implementation as reference.

Disabling Auto-Update Permanently

To turn off automatic updates forever, use the built-in configuration command. This writes "autoUpdate": false to ~/.officecli/config.json, preventing any future automatic update checks across all sessions.

officecli config autoUpdate false

According to the repository documentation, this persistent setting is stored in the user's home directory configuration file and takes precedence over default update behavior.

Skipping Update Checks Temporarily with Environment Variables

For CI/CD pipelines or one-off commands where you want to avoid the latency of update checks, use environment variables to skip the check for a single invocation.

OFFICECLI_SKIP_UPDATE for Single Commands

The OFFICECLI_SKIP_UPDATE environment variable bypasses the update check entirely when set to "1". In src/officecli/Program.cs at line 268, the CLI checks this variable before triggering the update routine:

// src/officecli/Program.cs
if (Environment.GetEnvironmentVariable("OFFICECLI_SKIP_UPDATE") != "1")
    // … trigger the update checker

If the variable equals "1", the update-checking code path is skipped entirely.

Use it in your shell:

export OFFICECLI_SKIP_UPDATE=1
officecli add mydoc.docx /paragraph --text "Hello world"

Or as a one-liner for individual commands:

OFFICECLI_SKIP_UPDATE=1 officecli set mydoc.docx /docProps --prop updateFields=true

OFFICECLI_NO_AUTO_RESIDENT for Background Processes

Set OFFICECLI_NO_AUTO_RESIDENT=1 to prevent the background resident from starting automatically, which also avoids its periodic update checks. This is implemented in src/officecli/McpServer.cs at line 41, where the variable controls resident auto-start behavior.

How the Update Logic Works Under the Hood

The actual update implementation resides in src/officecli/Core/UpdateChecker.cs. When the CLI starts, the entry point in Program.cs validates the environment variable before invoking UpdateChecker. The checker respects the same OFFICECLI_SKIP_UPDATE variable (documented at lines 729–747 in the source), ensuring the skip propagates to any child processes launched by the CLI.

The guard logic ensures that:

  • Persistent configuration (autoUpdate: false) disables checks globally
  • Environment variables override behavior for specific invocations
  • Child processes inherit the skip settings

Summary

  • Permanent disable: Run officecli config autoUpdate false to write "autoUpdate": false to ~/.officecli/config.json
  • Temporary skip: Export OFFICECLI_SKIP_UPDATE=1 before commands to bypass the check in src/officecli/Program.cs line 268
  • Background control: Set OFFICECLI_NO_AUTO_RESIDENT=1 to stop the resident auto-start in src/officecli/McpServer.cs
  • Propagation: The skip logic in src/officecli/Core/UpdateChecker.cs ensures environment variables affect child processes

Frequently Asked Questions

Will OFFICECLI_SKIP_UPDATE disable updates permanently?

No. Setting OFFICECLI_SKIP_UPDATE=1 only affects the current shell session or single command execution. To disable updates permanently, use officecli config autoUpdate false which modifies ~/.officecli/config.json.

Can I use OFFICECLI_SKIP_UPDATE in CI/CD pipelines?

Yes. This environment variable is specifically designed for automation scenarios where you want to avoid network latency or external calls. Prefix your CI commands with OFFICECLI_SKIP_UPDATE=1 to ensure deterministic execution without update checks.

What happens if both the config file and environment variable are set?

The environment variable takes precedence for that specific invocation. Even if autoUpdate is true in the config file, setting OFFICECLI_SKIP_UPDATE=1 bypasses the check as implemented in src/officecli/Program.cs line 268.

Where does OfficeCLI store the persistent auto-update configuration?

The persistent configuration is stored in ~/.officecli/config.json in the user's home directory. Running officecli config autoUpdate false writes to this file, while the environment variables only affect runtime behavior.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →