Documentation

CLI Reference

Complete command-line reference — every subcommand, flag, and option in one place.

Edit on GitHub

Quick-reference table for every nyz command and flag.

Main Modes

nyz                              # Interactive TUI
nyz run "<prompt>"               # Non-interactive, human-readable output
nyz exec "<prompt>"              # CI/scripting mode, supports stdin + JSON

Global Flags

FlagShortTypeDescription
--provider-pstringOverride default provider
--model-mstringOverride model
--trust-ystringTrust mode: off, limited, autoedit, full
--continue-cboolResume most recent session
--session-sstringResume session by ID or title
--team-namestringRun as team lead for this team

nyz run

Non-interactive single-prompt execution.

nyz run "add error handling to api.rs"
nyz run -i screenshot.png "analyze this UI"
nyz run --format json "generate JSONL events"
nyz run -o result.md "summarize the codebase"
FlagShortTypeDescription
--image-ipathAttach image (repeatable)
--formattext/jsonOutput format (default: text)
--output-opathWrite response to file

Sandbox: full access.

nyz exec

CI/scripting mode with stdin support and sandbox control.

nyz exec "fix lint errors"
cat ci.log | nyz exec --json "explain failure"
nyz exec --sandbox read-only --ephemeral "audit repo"
nyz exec --full_auto "update deps and test"
FlagShortTypeDescription
--image-ipathAttach image (repeatable)
--jsonboolJSONL event stream output
--quiet-qboolSuppress non-essential output
--ephemeralboolDon’t persist session
--full_autoboolTrust=full + sandbox=workspace-write
--sandboxstringread-only, workspace-write, full-access
--output-opathWrite response to file

Sandbox: workspace-write (default). Aliases: readonly, workspace, full, danger-full-access.

Auth

Preferred interactive path:

nyz → /connect

CLI fallback:

nyz login              # interactive provider picker
nyz login <provider>   # direct login
nyz logout <provider>  # remove stored credentials
nyz whoami             # show auth status

Config & Init

nyz config             # print merged runtime config
nyz init               # scaffold .nyzhi/ directory
nyz deepinit           # advanced project initialization

MCP

nyz mcp add <name> -- <command> [args...]   # add stdio server
nyz mcp add <name> --url <url>              # add HTTP server
nyz mcp add <name> --scope global -- ...    # add to global config
nyz mcp list                                # list servers
nyz mcp remove <name> [--scope global]      # remove server

Default scope: project (writes to <project>/.nyzhi/config.toml).

Sessions

nyz sessions [query]                            # list/search
nyz session delete <id-or-title>                # delete
nyz session rename <id-or-title> "New Title"    # rename
nyz export <id-or-title> [-o output.md]         # export markdown
nyz replay <id> [--filter <event-type>]         # replay events

Lookup matches on ID prefix or title substring. Ambiguous queries show candidates.

Analytics

nyz stats                    # usage statistics
nyz cost [daily|weekly|monthly]  # cost breakdown

Period aliases: day, week, month.

Teams

nyz teams list               # list teams
nyz teams show <name>        # show details
nyz teams delete <name>      # delete team

Skills

nyz skills                   # list available skills

CI Fix

nyz ci-fix [--log-file <path>] [--format auto|junit|tap|plain]
nyz ci-fix --commit          # auto-commit fix
cat ci.log | nyz ci-fix      # from stdin

Update & Uninstall

nyz update                   # check and install update
nyz update --force           # force reinstall
nyz update --list-backups    # list backup binaries
nyz update --rollback latest # rollback to previous version
nyz uninstall [--yes]        # remove everything

Misc

nyz wait                     # wait for background processes
nyz skills                   # list skills

Exit Codes

CodeMeaning
0Success
Non-zeroValidation error, missing input, ambiguous query

Next Steps