Linear CLI (Zig)
Single-binary Linear client built with Zig 0.16.0. Uses stdlib only, defaults to human-readable tables with a --json override, and stores auth securely at ~/.config/linear/config.json (0600). Use linear help <command> to see command-specific flags and examples.
Install
One owner per machine: the npm wrapper, mise, and a hand-placed binary all put
linear on PATH and will shadow each other.
npm — any platform with node:
npm install -g @0xbigboss/linear-cli
mise — tracks the GitHub release assets, so every host on a fleet resolves
the same pinned build:
# ~/.config/mise/config.toml
[tools]
"github:alleneubank/linear-cli" = { version = "latest", exe = "linear" }
Then mise install. exe is required: the repo is linear-cli, the binary is
linear.
Direct download — each release carries
linear-<version>-<os>-<arch>.tar.gz plus a .sha256 sidecar for macOS
(aarch64, x86_64) and Linux (aarch64, x86_64; statically linked against musl,
so any distro works). The tarball holds one root linear executable.
From source — Zig 0.16.0, stdlib only:
zig build -Doptimize=ReleaseSafe # -> zig-out/bin/linear
Then configure a key (see Config & Auth) and check it:
linear config set credential_helper "op read op://<vault>/<item>/<field>"
linear auth test
Build & Test
- Build:
zig build -Doptimize=ReleaseSafe (debug is default). Binary installs to zig-out/bin/linear.
- Tests:
zig build test. Online suite runs with LINEAR_ONLINE_TESTS=1: LINEAR_ONLINE_TESTS=1 LINEAR_TEST_TEAM_ID=<TEAM_ID> zig build online (requires LINEAR_API_KEY; optional LINEAR_TEST_ISSUE_ID, LINEAR_TEST_PROJECT_ID, LINEAR_TEST_MILESTONE_ID; opt-in mutations with LINEAR_TEST_ALLOW_MUTATIONS=1).
Manual QA (Live API)
Config & Auth
- Config path:
~/.config/linear/config.json (override with --config PATH or env LINEAR_CONFIG).
- API keys must be 4-512 characters from
[A-Za-z0-9_-]; anything else is rejected at every ingestion point (config file, LINEAR_API_KEY, auth set, and every credential backend).
- Keys:
api_key — plaintext, deprecated; see Credential backends
credential_helper — argv array for an external command that prints the key
default_team_id (default ``)
default_output (table|json, default table)
default_state_filter (default ["completed","canceled"])
team_cache (auto-populated key->id cache from issue create)
- Manage defaults without editing JSON:
linear config show, linear config set default_team_id ENG, linear config set default_output json, linear config unset default_state_filter
config set default_team_id verifies the team against the workspace before writing. An unknown team is refused and nothing is saved (team 'X' not found in workspace); a lookup that could not complete is reported separately (could not verify team 'X') so a timeout is never mistaken for a verdict. There is no --force: use a per-command --team while offline.
- Files are created with 0600 perms inside a 0700 directory; the CLI warns if permissions drift.
auth show prints a redacted key by default (--redacted is kept as a no-op alias); auth show --reveal prints the full token and is refused unless stdout is a terminal. auth test pings viewer to validate the current key.