devs-cli 2.0.2__tar.gz → 2.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {devs_cli-2.0.2/devs_cli.egg-info → devs_cli-2.0.4}/PKG-INFO +1 -1
- {devs_cli-2.0.2 → devs_cli-2.0.4}/devs/__init__.py +6 -1
- {devs_cli-2.0.2 → devs_cli-2.0.4}/devs/cli.py +37 -11
- {devs_cli-2.0.2 → devs_cli-2.0.4/devs_cli.egg-info}/PKG-INFO +1 -1
- {devs_cli-2.0.2 → devs_cli-2.0.4}/pyproject.toml +1 -1
- {devs_cli-2.0.2 → devs_cli-2.0.4}/LICENSE +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/README.md +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/devs/config.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/devs/core/__init__.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/devs/core/integration.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/devs/exceptions.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/devs/utils/__init__.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/devs_cli.egg-info/SOURCES.txt +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/devs_cli.egg-info/dependency_links.txt +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/devs_cli.egg-info/entry_points.txt +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/devs_cli.egg-info/requires.txt +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/devs_cli.egg-info/top_level.txt +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/setup.cfg +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_cli.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_cli_clean.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_cli_misc.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_cli_start.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_cli_stop.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_cli_vscode.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_container_manager.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_e2e.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_error_parsing.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_integration.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_live_mode.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_project.py +0 -0
- {devs_cli-2.0.2 → devs_cli-2.0.4}/tests/test_workspace_manager.py +0 -0
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
A command-line tool that simplifies managing multiple named devcontainers for any project.
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
__version__ = version("devs-cli")
|
|
10
|
+
except PackageNotFoundError:
|
|
11
|
+
__version__ = "0.0.0"
|
|
7
12
|
__author__ = "Dan Lester"
|
|
8
13
|
__email__ = "dan@ideonate.com"
|
|
9
14
|
|
|
@@ -4,6 +4,7 @@ import os
|
|
|
4
4
|
import sys
|
|
5
5
|
import subprocess
|
|
6
6
|
from functools import wraps
|
|
7
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
7
8
|
|
|
8
9
|
import click
|
|
9
10
|
from rich.console import Console
|
|
@@ -114,13 +115,27 @@ def get_project() -> Project:
|
|
|
114
115
|
sys.exit(1)
|
|
115
116
|
|
|
116
117
|
|
|
118
|
+
def _get_version(ctx: click.Context, param: click.Parameter, value: bool) -> None:
|
|
119
|
+
"""Print version info for devs-cli and installed dependencies."""
|
|
120
|
+
if not value or ctx.resilient_parsing:
|
|
121
|
+
return
|
|
122
|
+
parts = []
|
|
123
|
+
for pkg, label in [("devs-cli", "devs-cli"), ("devs-common", "devs-common"), ("devs-webhook", "devs-webhook")]:
|
|
124
|
+
try:
|
|
125
|
+
parts.append(f"{label} {version(pkg)}")
|
|
126
|
+
except PackageNotFoundError:
|
|
127
|
+
pass
|
|
128
|
+
click.echo("\n".join(parts) if parts else "devs-cli (unknown version)")
|
|
129
|
+
ctx.exit()
|
|
130
|
+
|
|
131
|
+
|
|
117
132
|
@click.group()
|
|
118
|
-
@click.
|
|
133
|
+
@click.option('--version', is_flag=True, callback=_get_version, expose_value=False, is_eager=True, help='Show version and exit.')
|
|
119
134
|
@click.option('--debug', is_flag=True, help='Show debug tracebacks on error')
|
|
120
135
|
@click.pass_context
|
|
121
136
|
def cli(ctx, debug: bool) -> None:
|
|
122
137
|
"""DevContainer Management Tool
|
|
123
|
-
|
|
138
|
+
|
|
124
139
|
Manage multiple named devcontainers for any project.
|
|
125
140
|
"""
|
|
126
141
|
ctx.ensure_object(dict)
|
|
@@ -780,29 +795,30 @@ def runtests(dev_name: str, reset_workspace: bool, live: bool, env: tuple, debug
|
|
|
780
795
|
|
|
781
796
|
@cli.command()
|
|
782
797
|
@click.argument('dev_name')
|
|
798
|
+
@click.option('--auth', is_flag=True, help='Set up tunnel authentication (interactive, one-time setup)')
|
|
783
799
|
@click.option('--status', is_flag=True, help='Check tunnel status instead of starting')
|
|
784
800
|
@click.option('--kill', 'kill_tunnel', is_flag=True, help='Kill running tunnel')
|
|
785
801
|
@click.option('--live', is_flag=True, help='Start container with current directory mounted as workspace')
|
|
786
802
|
@click.option('--env', multiple=True, help='Environment variables to pass to container (format: VAR=value)')
|
|
787
803
|
@debug_option
|
|
788
|
-
def tunnel(dev_name: str, status: bool, kill_tunnel: bool, live: bool, env: tuple, debug: bool) -> None:
|
|
804
|
+
def tunnel(dev_name: str, auth: bool, status: bool, kill_tunnel: bool, live: bool, env: tuple, debug: bool) -> None:
|
|
789
805
|
"""Start a VS Code tunnel in devcontainer.
|
|
790
806
|
|
|
791
807
|
VS Code tunnels allow you to connect VS Code directly to the container
|
|
792
808
|
without SSH - the container initiates an outbound connection to Microsoft's
|
|
793
809
|
tunnel service, and your local VS Code connects through that.
|
|
794
810
|
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
811
|
+
First-time setup requires authentication:
|
|
812
|
+
devs tunnel <name> --auth
|
|
813
|
+
|
|
814
|
+
After that, tunnels run in the background automatically.
|
|
799
815
|
|
|
800
816
|
DEV_NAME: Development environment name
|
|
801
817
|
|
|
802
|
-
Example: devs tunnel sally
|
|
818
|
+
Example: devs tunnel sally --auth # One-time auth setup
|
|
819
|
+
Example: devs tunnel sally # Start tunnel (background)
|
|
803
820
|
Example: devs tunnel sally --status # Check tunnel status
|
|
804
821
|
Example: devs tunnel sally --kill # Stop running tunnel
|
|
805
|
-
Example: devs tunnel sally --live # Start with current directory mounted
|
|
806
822
|
"""
|
|
807
823
|
check_dependencies()
|
|
808
824
|
project = get_project()
|
|
@@ -822,7 +838,17 @@ def tunnel(dev_name: str, status: bool, kill_tunnel: bool, live: bool, env: tupl
|
|
|
822
838
|
# Ensure workspace exists (handles live mode internally)
|
|
823
839
|
workspace_dir = workspace_manager.create_workspace(dev_name, live=live)
|
|
824
840
|
|
|
825
|
-
if
|
|
841
|
+
if auth:
|
|
842
|
+
# Interactive authentication
|
|
843
|
+
container_manager.tunnel_auth(
|
|
844
|
+
dev_name=dev_name,
|
|
845
|
+
workspace_dir=workspace_dir,
|
|
846
|
+
debug=debug,
|
|
847
|
+
live=live,
|
|
848
|
+
extra_env=extra_env
|
|
849
|
+
)
|
|
850
|
+
|
|
851
|
+
elif status:
|
|
826
852
|
# Check tunnel status
|
|
827
853
|
is_running, status_msg = container_manager.get_tunnel_status(
|
|
828
854
|
dev_name=dev_name,
|
|
@@ -850,7 +876,7 @@ def tunnel(dev_name: str, status: bool, kill_tunnel: bool, live: bool, env: tupl
|
|
|
850
876
|
)
|
|
851
877
|
|
|
852
878
|
else:
|
|
853
|
-
# Start the tunnel (
|
|
879
|
+
# Start the tunnel (background)
|
|
854
880
|
container_manager.start_tunnel(
|
|
855
881
|
dev_name=dev_name,
|
|
856
882
|
workspace_dir=workspace_dir,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|