|
13 | 13 | from rich.panel import Panel |
14 | 14 | from typer.core import TyperGroup |
15 | 15 |
|
16 | | -from mcp_agent.cli.cloud.commands import configure_app, deploy_config, login |
| 16 | +from mcp_agent.cli.cloud.commands import configure_app, deploy_config, login, logout, whoami |
17 | 17 | from mcp_agent.cli.cloud.commands.app import ( |
18 | 18 | delete_app, |
19 | 19 | get_app_status, |
@@ -105,17 +105,6 @@ def invoke(self, ctx): |
105 | 105 | )(deploy_config) |
106 | 106 |
|
107 | 107 |
|
108 | | -# Login command |
109 | | -app.command( |
110 | | - name="login", |
111 | | - help=""" |
112 | | -Authenticate to MCP Agent Cloud API.\n\n |
113 | | -
|
114 | | -Direct to the api keys page for obtaining credentials, routing through login. |
115 | | -""".strip(), |
116 | | -)(login) |
117 | | - |
118 | | - |
119 | 108 | # Sub-typer for `mcp-agent apps` commands |
120 | 109 | app_cmd_apps = typer.Typer( |
121 | 110 | help="Management commands for multiple MCP Apps", |
@@ -145,6 +134,45 @@ def invoke(self, ctx): |
145 | 134 | app_cmd_workflow.command(name="status")(get_workflow_status) |
146 | 135 | app.add_typer(app_cmd_workflow, name="workflow", help="Manage MCP Workflows") |
147 | 136 |
|
| 137 | +# Sub-typer for `mcp-agent cloud` commands |
| 138 | +app_cmd_cloud = typer.Typer( |
| 139 | + help="Cloud operations and management", |
| 140 | + no_args_is_help=True, |
| 141 | + cls=HelpfulTyperGroup, |
| 142 | +) |
| 143 | +# Sub-typer for `mcp-agent cloud auth` commands |
| 144 | +app_cmd_cloud_auth = typer.Typer( |
| 145 | + help="Cloud authentication commands", |
| 146 | + no_args_is_help=True, |
| 147 | + cls=HelpfulTyperGroup, |
| 148 | +) |
| 149 | +# Register auth commands under cloud auth |
| 150 | +app_cmd_cloud_auth.command( |
| 151 | + name="login", |
| 152 | + help=""" |
| 153 | +Authenticate to MCP Agent Cloud API.\n\n |
| 154 | +Direct to the api keys page for obtaining credentials, routing through login. |
| 155 | +""".strip(), |
| 156 | +)(login) |
| 157 | +app_cmd_cloud_auth.command(name="whoami", help="Print current identity and org(s).")( |
| 158 | + whoami |
| 159 | +) |
| 160 | +app_cmd_cloud_auth.command(name="logout", help="Clear credentials.")(logout) |
| 161 | +# Add auth sub-typer to cloud |
| 162 | +app_cmd_cloud.add_typer(app_cmd_cloud_auth, name="auth", help="Authentication commands") |
| 163 | +# Register cloud commands (only containing auth for now) |
| 164 | +app.add_typer(app_cmd_cloud, name="cloud", help="Cloud operations and management") |
| 165 | +# Top-level auth commands that map to cloud auth commands |
| 166 | +app.command( |
| 167 | + name="login", |
| 168 | + help=""" |
| 169 | +Authenticate to MCP Agent Cloud API.\n\n |
| 170 | +Direct to the api keys page for obtaining credentials, routing through login. |
| 171 | +""".strip(), |
| 172 | +)(login) |
| 173 | +app.command(name="whoami", help="Print current identity and org(s).")(whoami) |
| 174 | +app.command(name="logout", help="Clear credentials.")(logout) |
| 175 | + |
148 | 176 |
|
149 | 177 | @app.callback(invoke_without_command=True) |
150 | 178 | def callback( |
|
0 commit comments