CLI

Global Flags

Flags and environment variables that work on every poly command.

Every poly command accepts these flags, and each one can also be set through an environment variable — handy for scripts, CI, and agent harnesses where you want a behavior applied to every command.

Output & diagnostics

FlagEnv varDescription
-o, --output <pretty|json>POLY_OUTPUTOutput format. pretty (default) renders colored, human-readable tables; json emits the same data as JSON for scripts.
--colorPOLY_COLORForce ANSI color, even when output isn't a terminal. Conflicts with --no-color.
--no-colorPOLY_NO_COLORDisable color. The ambient NO_COLOR convention is honored too, and JSON output is never colored.
-v, --verbose <LEVEL>POLY_VERBOSELog level: error, warn (default), info, debug, or trace.
--timeout-ms <MS>POLY_TIMEOUT_MSOverride each command's default timeout.

Offline & staleness

These control how commands balance the local cache against the server — the full model is explained in How it Works.

FlagEnv varDescription
--cache-onlyPOLY_CACHE_ONLYOnly use the local cache. Reads fail if the data isn't cached; writes are queued and return without waiting for a server response.
--no-stalePOLY_NO_STALENever accept possibly-stale local data. Reads fail rather than fall back to unconfirmed cache; writes wait for server confirmation before returning.

Waiting for processing

FlagEnv varDescription
--wait-for-indexingPOLY_WAIT_FOR_INDEXINGAfter any write (and on file show/file read), wait until the file has been indexed for search. Indexing errors don't fail the command.
--wait-for-transcodingPOLY_WAIT_FOR_TRANSCODINGAlso wait for derived artifacts — video variants, PDF transcriptions. These can take minutes to hours; combine with --timeout-ms deliberately.

Safety

FlagEnv varDescription
--disallow-forcePOLY_DISALLOW_FORCERefuse irreversible actions that would otherwise be forced through — rm --force on archived files, rmdrive --force. Designed for agent harnesses. Once on (via flag, env var, or config file), it cannot be turned off from the command line.

Configuration

FlagEnv varDescription
-c, --config <PATH>POLY_CONFIGLayer a TOML config file over the built-in defaults. The safety and staleness flags above can be set there as durable defaults.
--config.<key>=<value>Override a single config key inline, e.g. --config.daemon.binary_path=/opt/poly/poly. Highest precedence.

Environment variables

Every global flag has an environment-variable twin, listed in the tables above. A few rules govern how they interact:

  • Precedence — an explicit flag beats its environment variable, which beats the config file, which beats the built-in defaults. So POLY_OUTPUT=json poly ls --output pretty renders pretty.
  • Boolean parsing — boolean variables accept 1/true/yes/on and 0/false/no/off, so POLY_CACHE_ONLY=1 and POLY_CACHE_ONLY=true are equivalent.
  • One-way safetyPOLY_DISALLOW_FORCE is the exception to precedence: like its flag, it can only switch the protection on. No flag or variable can switch it back off once any layer has enabled it.
  • Discoverabilitypoly --help annotates each flag with its [env: …] variable, so the CLI itself is always the up-to-date reference.

Examples

# Script-friendly: JSON output, no color, fail on stale data
POLY_OUTPUT=json POLY_NO_STALE=1 poly ls //Home

# Upload and block until the file is searchable
poly cp ./notes.md //Home/notes/ --wait-for-indexing

# A hardened environment for an agent
export POLY_DISALLOW_FORCE=1
export POLY_TIMEOUT_MS=30000

# Work fully offline from the local cache
poly find //Home -name "*.pdf" --cache-only
© Poly Corp. 2026