Skip to content

rtk interprets psql flags as its own options #613

@tobwen

Description

@tobwen

Summary

I'm using rtk with the opencode-plugin.

When running rtk psql with standard psql CLI flags (e.g. -h, -U, -d), the flags are interpreted by rtk instead of being forwarded to psql.

As a result, the command shows the help of rtk psql output instead of executing the psql command.

How to reproduce

$ rtk psql -h 192.168.106.72 -U dev -d dev -c "\dn"
PostgreSQL client with compact output (strip borders, compress tables)

Usage: rtk psql [OPTIONS] [ARGS]...

Arguments:
  [ARGS]...  psql arguments

Options:
  -v, --verbose...     Verbosity level (-v, -vv, -vvv)
  -u, --ultra-compact  Ultra-compact mode: ASCII icons, inline format (Level 2 optimizations)
      --skip-env       Set SKIP_ENV_VALIDATION=1 for child processes (Next.js, tsc, lint, prisma)
  -h, --help           Print help

How to fix

The issue can be worked around by using --, which separates rtk options from the psql arguments.”

$ rtk psql -- -h 192.168.106.72 -U dev -d dev -c "\dn"
List of schemas
Name    Owner
table1    postgres
table2    dev
table3    kebab

rtk version

rtk 0.29.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions