Skip to content

Commit

Permalink
hide ecs sub-commands and re-order commands
Browse files Browse the repository at this point in the history
  • Loading branch information
synfinatic committed Jul 11, 2024
1 parent 0596d11 commit 87acfef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Changes

* No longer show help for sub-commands by default

### New Features

* Now require `login` as a seperate step for better security #291
Expand Down
15 changes: 10 additions & 5 deletions cmd/aws-sso/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,23 @@ type CLI struct {

// Commands
Cache CacheCmd `kong:"cmd,help='Force reload of cached AWS SSO role info and config.yaml'"`
Completions CompleteCmd `kong:"cmd,help='Manage shell completions'"`
Console ConsoleCmd `kong:"cmd,help='Open AWS Console using specificed AWS role/profile'"`
Config ConfigCmd `kong:"cmd,help='Run the configuration wizard'"`
ConfigProfiles ConfigProfilesCmd `kong:"cmd,help='Update ~/.aws/config with AWS SSO profiles from the cache'"`
Credentials CredentialsCmd `kong:"cmd,help='Generate static AWS credentials for use with AWS CLI'"`
Default DefaultCmd `kong:"cmd,hidden,default='1'"` // list command without args
Ecs EcsCmd `kong:"cmd,help='ECS server/client commands'"`
Eval EvalCmd `kong:"cmd,help='Print AWS environment vars for use with eval $(aws-sso eval ...)'"`
Exec ExecCmd `kong:"cmd,help='Execute command using specified IAM role in a new shell'"`
List ListCmd `kong:"cmd,help='List all accounts / roles (default command)'"`
Login LoginCmd `kong:"cmd,help='Login to an AWS Identity Center instance'"`
Logout LogoutCmd `kong:"cmd,help='Logout from an AWS Identity Center instance and invalidate all credentials'"`
Process ProcessCmd `kong:"cmd,help='Generate JSON for credential_process in ~/.aws/config'"`
Static StaticCmd `kong:"cmd,hidden,help='Manage static AWS API credentials'"`
Tags TagsCmd `kong:"cmd,help='List tags'"`
Time TimeCmd `kong:"cmd,help='Print how much time before current STS Token expires'"`
Completions CompleteCmd `kong:"cmd,help='Manage shell completions'"`
ConfigProfiles ConfigProfilesCmd `kong:"cmd,help='Update ~/.aws/config with AWS SSO profiles from the cache'"`
Config ConfigCmd `kong:"cmd,help='Run the configuration wizard'"`
Ecs EcsCmd `kong:"cmd,help='ECS server/client commands'"`
Version VersionCmd `kong:"cmd,help='Print version and exit'"`
Static StaticCmd `kong:"cmd,hidden,help='Manage static AWS API credentials'"`
}

func main() {
Expand Down Expand Up @@ -259,10 +259,15 @@ func parseArgs(cli *CLI) (*kong.Context, sso.OverrideSettings) {
"VERSION": Version,
}

help := kong.HelpOptions{
NoExpandSubcommands: true,
}

parser := kong.Must(
cli,
kong.Name("aws-sso"),
kong.Description("Securely manage temporary AWS API Credentials issued via AWS SSO"),
kong.ConfigureHelp(help),
vars,
)

Expand Down

0 comments on commit 87acfef

Please sign in to comment.