Start typing to search the documentation.

CLI navigation

Commands

Every command accepts --help for its full flag list, for example rewyyn run --help. Some server-backed commands accept --standalone to run a private server or --server <url> to target a specific one; check the command’s help for its supported flags.

run

Sends a message and prints the reply without opening the interactive interface.

$ rewyyn run "Explain this repository"

CI

In CI, pass a provider API key as a secret and use standalone mode so the private server receives it. For example, this GitHub Actions job reviews the checked-out repository:

name: Rewyyn review
on: [pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm install --global @rewyyn/cli
      - run: rewyyn run --standalone --model anthropic/claude-sonnet-5-5 "Review this repository for correctness and summarize any issues."
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

Choose a model.

$ rewyyn run --model anthropic/claude-sonnet-5-5 "Refactor parseToken"

Continue the last session.

$ rewyyn run --continue "Now handle the expired case"

Emit newline-delimited JSON for scripts.

$ rewyyn run --format json "List the TODO comments"

Attach files to the message.

$ rewyyn run --file src/server.ts --file src/client.ts "Review these for bugs"

Run with a specific agent.

$ rewyyn run --agent build "Fix the failing test"

Continue a specific session.

$ rewyyn run --session ses_4f2a1c "Check edge cases"

Auto-approve permissions that are not explicitly denied.

$ rewyyn run --auto "Fix the failing test"

View all subcommands and flags.

$ rewyyn run --help

mini

Starts the minimal interactive interface instead of the full-screen TUI.

$ rewyyn mini

Continue the last session.

$ rewyyn mini --continue

Start with a model and an initial prompt.

$ rewyyn mini --model anthropic/claude-sonnet-5-5 --prompt "Summarize this repository"

Continue a specific session.

$ rewyyn mini --session ses_4f2a1c

View all subcommands and flags.

$ rewyyn mini --help

session

Manages sessions.

$ rewyyn session list

Limit the list and print JSON.

$ rewyyn session list --max-count 20 --format json

Delete a session and its child sessions.

$ rewyyn session delete ses_9c1b08

Export session data as JSON.

$ rewyyn session export ses_4f2a1c

Redact sensitive transcript and file data when exporting.

$ rewyyn session export ses_4f2a1c --sanitize

Import session data from a JSON file or URL.

$ rewyyn session import session.json

Import into a specific directory.

$ rewyyn session import session.json --directory ~/code/project

View all subcommands and flags.

$ rewyyn session --help

auth

Manages AI providers and credentials.

$ rewyyn auth list

List them as JSON.

$ rewyyn auth list --format json

Log in to a provider.

$ rewyyn auth login anthropic

Log in with a specific authentication method.

$ rewyyn auth login anthropic --method key

Log out of a saved account.

$ rewyyn auth logout anthropic work

Switch the active account for an integration.

$ rewyyn auth switch anthropic work

Export saved credentials and import them on another machine. The file contains secrets.

$ rewyyn auth export anthropic > credentials.json
$ rewyyn auth import credentials.json

View all subcommands and flags.

$ rewyyn auth --help

models

Lists every available model.

$ rewyyn models

View all subcommands and flags.

$ rewyyn models --help

mcp

Manages MCP (Model Context Protocol) servers.

$ rewyyn mcp list

Add a remote server.

$ rewyyn mcp add context7 --url https://mcp.context7.com/mcp

Add a local server to the global config.

$ rewyyn mcp add everything --global -- npx -y @modelcontextprotocol/server-everything

Add a local server with an environment variable.

$ rewyyn mcp add everything --env LOG_LEVEL=debug -- npx -y @modelcontextprotocol/server-everything

Add a remote server with a header.

$ rewyyn mcp add context7 --url https://mcp.context7.com/mcp --header CONTEXT7_API_KEY=secret

Authenticate with an OAuth-capable remote server.

$ rewyyn mcp auth sentry

Remove stored OAuth credentials for a server.

$ rewyyn mcp logout sentry

View all subcommands and flags.

$ rewyyn mcp --help

plugin

Manages plugins.

$ rewyyn plugin list

Include built-in server plugins.

$ rewyyn plugin list --builtin

Install a plugin and add it to the global configuration.

$ rewyyn plugin add @example/rewyyn-tui

Check package plugins for updates.

$ rewyyn plugin check

Update package plugins.

$ rewyyn plugin update

Remove a plugin from global configuration.

$ rewyyn plugin remove @example/rewyyn-tui

View all subcommands and flags.

$ rewyyn plugin --help

stats

Shows shareable usage statistics.

$ rewyyn stats

Show the last 7 days.

$ rewyyn stats --days 7

Show model usage.

$ rewyyn stats --models

Show cost and token details.

$ rewyyn stats --cost

Print JSON instead of a report.

$ rewyyn stats --json

Show only the current project.

$ rewyyn stats --project .

View all subcommands and flags.

$ rewyyn stats --help

serve

Starts the API and web server. See Web.

$ rewyyn serve

Bind to all interfaces on a fixed port.

$ rewyyn serve --hostname 0.0.0.0 --port 4096

Allow a browser client from another origin.

$ rewyyn serve --cors https://app.example.com

View all subcommands and flags.

$ rewyyn serve --help

pair

Prints one-time links, plus a QR code of the first one, that sign a browser or app in to the server. Links expire after 5 minutes and work once.

$ rewyyn pair

Use an external URL in the links.

$ rewyyn pair --url https://dev.example.com

Pair from anywhere through an OpenTunnel remote address. This exposes the server to the internet, so the first time it enables remote access it explains this and asks you to accept. See Remote access.

$ rewyyn pair --remote

Accept without a prompt, for example in a script without a terminal.

$ rewyyn pair --remote --yes

View all subcommands and flags.

$ rewyyn pair --help

service

Manages the background server. See Web.

$ rewyyn service start

Restart it.

$ rewyyn service restart

Show its status.

$ rewyyn service status

Stop it.

$ rewyyn service stop

Read a setting.

$ rewyyn service get hostname

Set a setting.

$ rewyyn service set hostname 0.0.0.0

Allow an extra CORS origin.

$ rewyyn service set cors https://app.example.com

Pass an environment variable to the server process.

$ rewyyn service set env REWYYN_LOG_LEVEL DEBUG

Reset a setting to its default.

$ rewyyn service unset hostname

View all subcommands and flags.

$ rewyyn service --help

reload

Reloads configuration without restarting the server. Running sessions continue with fresh services at the next step boundary.

$ rewyyn reload

api

Makes a request to the running server.

$ rewyyn api GET /api/session

Call an operation ID with a query parameter.

$ rewyyn api session.list --param limit=10

Send a JSON body.

$ rewyyn api session.create --data '{"title": "New session"}'

Add a request header.

$ rewyyn api GET /api/session -H "accept: application/json"

View all subcommands and flags.

$ rewyyn api --help

acp

Starts an Agent Client Protocol server over stdin and stdout for editor integrations. It runs until the client closes the connection.

$ rewyyn acp

View all subcommands and flags.

$ rewyyn acp --help

debug

Provides debugging and troubleshooting tools.

$ rewyyn debug agents

List configuration sources.

$ rewyyn debug config

Write a heap snapshot of the running background server and print its path.

$ rewyyn debug heap-dump

Write the snapshot into a directory of your choice.

$ rewyyn debug heap-dump --directory ./snapshots

Show global paths.

$ rewyyn debug paths

Print a single path.

$ rewyyn debug paths db

View all subcommands and flags.

$ rewyyn debug --help

upgrade

Upgrades Rewyyn to the latest or a specific version. Alias: update.

$ rewyyn upgrade

Upgrade to a specific version with a specific package manager.

$ rewyyn upgrade 2.0.21 --method bun

View all subcommands and flags.

$ rewyyn upgrade --help

uninstall

Stops background services, removes the global cache, and uninstalls Rewyyn. Session data, configuration, and state are not removed.

$ rewyyn uninstall

Preview what would be removed.

$ rewyyn uninstall --dry-run

View all subcommands and flags.

$ rewyyn uninstall --help