Startup Version Check¶
azlin checks for a newer release at startup and prints a one-line notice to stderr when an update is available.
Contents¶
- How It Works
- What You See
- Cache File
- Configuration
- Disabling the Check
- Manual Update
- Troubleshooting
How It Works¶
Every time you run an azlin command, the CLI checks whether a newer release exists before executing your command. The check is designed to be invisible when everything is current and non-blocking in all cases.
azlin <command>
│
├─ 1. Is AZLIN_NO_UPDATE_CHECK=1? → skip
├─ 2. Was cache written less than 24h ago? → use cached result
├─ 3. Query GitHub releases API (5s timeout, fail-silent)
├─ 4. Write result to cache
└─ 5. If newer version found → print notice to stderr
└─ Run your command normally
Key properties:
| Property | Behavior |
|---|---|
| Position | Before your command runs |
| Output stream | stderr only (stdout is clean) |
| Network timeout | 5 seconds |
| Cooldown | 24 hours between live checks |
| On network failure | Silent — your command still runs |
| Cache hit | Sub-millisecond — no network call |
What You See¶
When a newer version is available, you see one line on stderr before your command output:
The notice appears in yellow on terminals that support ANSI colors. It goes to stderr, so piping stdout works as expected:
# This captures only your command's output, not the update notice
azlin list --json | jq '.[] | .name'
When your version is current, or after a recent check (within 24 hours), startup is silent.
Cache File¶
The check result is cached at:
The cache file contains two lines:
- Line 1: Latest version tag from GitHub
- Line 2: Unix timestamp of last live network check
azlin reads this file on startup. If the timestamp is less than 24 hours old, it uses the cached version rather than making a network request. If the cache is missing or corrupt, it falls back to a live check.
To force an immediate live check, delete the cache file:
Configuration¶
Environment Variable¶
| Variable | Value | Effect |
|---|---|---|
AZLIN_NO_UPDATE_CHECK | 1 | Skip the check entirely |
The variable must be set to the value 1. Other truthy values (true, yes, on) are not recognized — only AZLIN_NO_UPDATE_CHECK=1 disables the check.
Network¶
The check uses two methods in order:
ghCLI (authenticated) — used whenghis installed and authenticatedcurl(anonymous) — fallback using the GitHub releases API over HTTPS
Both use a maximum 5-second timeout. If both fail (no network, rate limiting, etc.), startup is silent and your command runs normally.
Disabling the Check¶
Per-command¶
Session-wide¶
Permanently¶
Add to your shell profile (~/.bashrc, ~/.zshrc, etc.):
CI/CD pipelines¶
Set the variable in your pipeline environment to prevent update notices in automated output:
Manual Update¶
When you see the update notice, run:
This updates azlin itself (the CLI binary). See azlin update for the full reference.
Troubleshooting¶
Notice appears every time, not just once per 24 hours
The cache file may be unwritable. Check that ~/.config/azlin/ is writable:
Create it if missing:
Notice never appears even though a newer version exists
Delete the cache to force a fresh check:
If the notice still doesn't appear, verify network access to GitHub:
Suppressing the notice without disabling updates
The notice goes to stderr. Redirect stderr to suppress it while keeping stdout clean:
To update silently in a script: