You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ax ssh --help does not print usage. The first positional argument is taken as the task name, so the command tries to fetch a task literally named --help:
$ ax ssh --help
Error: fetching task "--help": rpc error: code = NotFound desc = task "--help" not found in atespace "default"
ax --help and ax ssh (no args) behave as expected. AX d8ed0fe.
Suggested fix
The ssh subcommand parses its own flags before/after the task name (to support ax ssh <task> -- <cmd>); it should still honour -h/--help when it appears before the task name, either by letting cobra handle help or by checking for it explicitly before treating the argument as a task name.
ax ssh -h/--help now prints ssh usage and exits 0, and a missing task name fails before the CLI resolves the server, so neither one starts a port-forward.
While in there I found a related bug: the global flag loop in main() doesn't stop at --, so it eats flags meant for the remote command. ax ssh t -- grep -n foo file sets the namespace to foo and runs grep file, and ax ssh t -- ls -a /tmp switches the atespace to /tmp. The same commit makes parsing stop at -- and adds the first tests for cmd/ax.
Happy to open it as a PR if you can enable that, or feel free to cherry-pick.
Activity
anzal1 commentedon Sep 23, 2026
I have a fix for this on a branch since PRs look restricted to collaborators: https://github.com/anzal1/ax/tree/fix/ssh-arg-parsing (single commit, CLA signed).
ax ssh -h/--helpnow prints ssh usage and exits 0, and a missing task name fails before the CLI resolves the server, so neither one starts a port-forward.While in there I found a related bug: the global flag loop in
main()doesn't stop at--, so it eats flags meant for the remote command.ax ssh t -- grep -n foo filesets the namespace tofooand runsgrep file, andax ssh t -- ls -a /tmpswitches the atespace to/tmp. The same commit makes parsing stop at--and adds the first tests forcmd/ax.Happy to open it as a PR if you can enable that, or feel free to cherry-pick.
feat: migrate to latest substrate ate.dev rename (google#373)
fix(cli): honour ax ssh --help and stop global flag parsing at -- (go…