Skip to content

feat(git/gh): add checkout, config, and auth subcommand support#2739

Open
jlaportebot wants to merge 4 commits into
rtk-ai:developfrom
jlaportebot:fix/route-more-git-gh-subcommands
Open

feat(git/gh): add checkout, config, and auth subcommand support#2739
jlaportebot wants to merge 4 commits into
rtk-ai:developfrom
jlaportebot:fix/route-more-git-gh-subcommands

Conversation

@jlaportebot

Copy link
Copy Markdown

Summary

Adds support for missing high-frequency git and gh subcommands as requested in issue #2738:

Git commands added:

  • **** - Compact output for branch creation (, , ) and switching (, , pathspecs)
  • **** - Compact output for get/set/unset/list operations with , , , etc.

GitHub CLI commands added:

  • **Authenticate gh and git with GitHub

USAGE
gh auth [flags]

AVAILABLE COMMANDS
login: Log in to a GitHub account
logout: Log out of a GitHub account
refresh: Refresh stored authentication credentials
setup-git: Setup git with GitHub CLI
status: Display active account and authentication state on each known GitHub host
switch: Switch active GitHub account
token: Print the authentication token gh uses for a hostname and account

INHERITED FLAGS
--help Show help for command

LEARN MORE
Use gh <command> <subcommand> --help for more information about a command.
Read the manual at https://cli.github.com/manual** - Compact output for auth subcommands: , , , , ,

Implementation details:

  • Added and enum variants
  • Added and variants to enum in main.rs with proper clap derive
  • Implemented and functions in git.rs with compact output
  • Implemented function in gh_cmd.rs for gh auth subcommands
  • Added unit tests for all new commands

Token savings:

  • → (vs full git branch creation output)
  • jlaportebot → (vs raw config value)
  • github.com
    ✓ Logged in to github.com account jlaportebot (/home/john/.config/gh/hosts.yml)
    • Active account: true
    • Git operations protocol: https
    • Token: ghp_************************************
    • Token scopes: 'admin:enterprise', 'admin:gpg_key', 'admin:org', 'admin:org_hook', 'admin:public_key', 'admin:repo_hook', 'admin:ssh_signing_key', 'audit_log', 'codespace', 'delete:packages', 'delete_repo', 'gist', 'notifications', 'project', 'repo', 'user', 'workflow', 'write:discussion', 'write:network_configurations', 'write:packages' → (vs 6 lines of auth status output)

All tests pass, clippy clean.

- Update has_limit_flag to detect -nN form (e.g., -n20)
- Update parse_user_limit to parse -nN form
- Add tests for -nN form (single and multi-digit)
- All existing tests pass

Fixes: rtk-ai#2665
…y, discover, session

Addresses issue rtk-ai#1248: RTK Windows PowerShell Compatibility Gaps

Changes:
- ls.rs: On Windows, detect when 'ls' is not a real executable (PowerShell alias) and suggest 'rtk tree .' as native alternative
- wc_cmd.rs: On Windows, detect when 'wc' is not available and provide PowerShell/Git Bash/WSL alternatives
- main.rs (proxy): On Windows, warn about PowerShell aliases (ls, dir, echo, pwd, cp, mv, rm, cat, man, which) and built-ins (cd, set, exit, cls, history, alias, function) that aren't real executables
- discover/mod.rs: On Windows, when no Claude sessions found, provide helpful info about session storage location (%USERPROFILE%\.claude\projects\)
- analytics/session_cmd.rs: Same as above for session command

All changes are conditional compilation (cfg(target_os = "windows")) so they only affect Windows users.
@jlaportebot

Copy link
Copy Markdown
Author

All CI checks passing (CLA signed, check-target skipped). PR ready for merge queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant