Skip to content

Commit 254037a

Browse files
committed
update main.py to include typer info
1 parent 00703d5 commit 254037a

File tree

5 files changed

+42
-114
lines changed

5 files changed

+42
-114
lines changed

src/mcp_agent/cli/cloud/commands/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
from .configure.main import configure_app
88
from .deploy.main import deploy_config
9-
from .login import login
9+
from .auth import login, logout, whoami
1010

11-
__all__ = ["configure_app", "deploy_config", "login"]
11+
__all__ = ["configure_app", "deploy_config", "login", "logout", "whoami"]

src/mcp_agent/cli/cloud/commands/login/__init__.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/mcp_agent/cli/cloud/commands/login/constants.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/mcp_agent/cli/cloud/commands/login/main.py

Lines changed: 0 additions & 90 deletions
This file was deleted.

src/mcp_agent/cli/cloud/main.py

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from rich.panel import Panel
1414
from typer.core import TyperGroup
1515

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
1717
from mcp_agent.cli.cloud.commands.app import (
1818
delete_app,
1919
get_app_status,
@@ -105,17 +105,6 @@ def invoke(self, ctx):
105105
)(deploy_config)
106106

107107

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-
119108
# Sub-typer for `mcp-agent apps` commands
120109
app_cmd_apps = typer.Typer(
121110
help="Management commands for multiple MCP Apps",
@@ -145,6 +134,45 @@ def invoke(self, ctx):
145134
app_cmd_workflow.command(name="status")(get_workflow_status)
146135
app.add_typer(app_cmd_workflow, name="workflow", help="Manage MCP Workflows")
147136

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+
148176

149177
@app.callback(invoke_without_command=True)
150178
def callback(

0 commit comments

Comments
 (0)