LoguDocs
Open Logu

Quickstart: CLI

logu asks from the terminal and from shell scripts: its exit code is the decision.

1. Install and connect#

npm install -g @logu/cli   # or run any command with npx -y @logu/cli …
logu login                 # shows a code and opens the app: check it and click Connect
logu whoami                # the agent and workspace this computer acts as

In CI, create an agent in the app (Agents) and set LOGU_API_KEY=lg_…; it wins over any saved API key. logu login --test saves a test API key: nobody's phone is notified while you try things.

2. Ask before something risky#

logu ask "Deploy api to production?" --project shop --body "v2.14.0 · 12 commits" \
  --expires-in 3600 && ./deploy.sh

logu ask waits for the decision and exits 0 when approved, 1 when declined and 2 when the ask ended without a decision (timed out, withdrawn, or --wait ran out). A default option applied on timeout is never an approval: --default decline exits 1, and --default can't be an approving option (refused; pre-approval is an Owner's rule). With your own options it prints the chosen option's id:

region=$(logu ask "Which region?" --option us=US --option eu=Europe)

3. Events and metrics#

logu event "Nightly backup finished" --project infra --icon ✅
logu metric orders 42 --project shop --label "Orders today"

Next#

  • Approve Claude Code's permission prompts from your phone: Claude Code and MCP.
  • Every command and exit code: logu <command> --help, or the agent guide.