Make a complete, running app (a CRM, a shop, a blog) with one command, such as dbbasic crm.

0 downloads

dbbasic-cli/src/dbbasic/commands/open_service.py
Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-cli.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-cli.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-cli.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 Version 0.1.2: Working instant apps! a36b93a 1 year, 2 months ago History
open_service.py · 970 bytes · 32 lines
1"""Open DBBasic services in browser"""
2
3import webbrowser
4import typer
5from rich.console import Console
6
7from .config import SERVICES
8
9console = Console()
10
11def open_service(service: str = typer.Argument(None, help="Service to open (omit for dashboard)")):
12 """Open DBBasic service in browser"""
13
14 # Default to monitor dashboard
15 if not service:
16 service = "monitor"
17
18 if service == "docs":
19 # Special case for API docs
20 url = f"{SERVICES['crud']['url']}/docs"
21 console.print(f"Opening API documentation: [blue]{url}[/blue]")
22 webbrowser.open(url)
23 return
24
25 if service not in SERVICES:
26 console.print(f"[red]Unknown service: {service}[/red]")
27 console.print(f"Available: {', '.join(SERVICES.keys())} or 'docs' for API docs")
28 raise typer.Exit(1)
29
30 svc = SERVICES[service]
31 console.print(f"Opening {svc['name']}: [blue]{svc['url']}[/blue]")
32 webbrowser.open(svc['url'])