hop3-cli 0.4.0__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.
- hop3_cli-0.4.0/PKG-INFO +114 -0
- hop3_cli-0.4.0/README.md +94 -0
- hop3_cli-0.4.0/pyproject.toml +58 -0
- hop3_cli-0.4.0/src/hop3_cli/__init__.py +1 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/__init__.py +47 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/arguments.py +455 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/destructive.py +191 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/flags.py +145 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/help.py +227 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/local/__init__.py +116 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/local/auth_cmd.py +52 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/local/completion_cmd.py +602 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/local/context_cmd.py +356 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/local/help_text.py +163 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/local/init_cmd.py +201 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/local/login_cmd.py +742 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/local/settings_cmd.py +125 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/local/ssh_ops.py +285 -0
- hop3_cli-0.4.0/src/hop3_cli/commands/local/version_cmd.py +24 -0
- hop3_cli-0.4.0/src/hop3_cli/config.py +505 -0
- hop3_cli-0.4.0/src/hop3_cli/exceptions.py +19 -0
- hop3_cli-0.4.0/src/hop3_cli/exit_codes.py +102 -0
- hop3_cli-0.4.0/src/hop3_cli/main.py +344 -0
- hop3_cli-0.4.0/src/hop3_cli/rpc/__init__.py +29 -0
- hop3_cli-0.4.0/src/hop3_cli/rpc/client.py +369 -0
- hop3_cli-0.4.0/src/hop3_cli/rpc/responses.py +302 -0
- hop3_cli-0.4.0/src/hop3_cli/rpc/streaming.py +223 -0
- hop3_cli-0.4.0/src/hop3_cli/rpc/tunnel.py +177 -0
- hop3_cli-0.4.0/src/hop3_cli/tokens.py +26 -0
- hop3_cli-0.4.0/src/hop3_cli/types.py +12 -0
- hop3_cli-0.4.0/src/hop3_cli/ui/__init__.py +30 -0
- hop3_cli-0.4.0/src/hop3_cli/ui/console.py +19 -0
- hop3_cli-0.4.0/src/hop3_cli/ui/messages.py +40 -0
- hop3_cli-0.4.0/src/hop3_cli/ui/prompts.py +90 -0
- hop3_cli-0.4.0/src/hop3_cli/ui/rich_printer.py +286 -0
hop3_cli-0.4.0/PKG-INFO
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hop3-cli
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary:
|
|
5
|
+
Author: Stefane Fermigier
|
|
6
|
+
Author-email: Stefane Fermigier <sf@abilian.com>
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Requires-Dist: toml>=0.10.2,<1.0.0
|
|
9
|
+
Requires-Dist: jsonrpcclient>=4.0.3,<5.0.0
|
|
10
|
+
Requires-Dist: requests>=2.32.3,<3.0.0
|
|
11
|
+
Requires-Dist: tabulate>=0.9.0,<1.0.0
|
|
12
|
+
Requires-Dist: rich>=13.0.0
|
|
13
|
+
Requires-Dist: sshtunnel>=0.4.0
|
|
14
|
+
Requires-Dist: paramiko>=2.11.0,<3.0.0
|
|
15
|
+
Requires-Dist: loguru>=0.7.3
|
|
16
|
+
Requires-Dist: pathspec>=0.12.1
|
|
17
|
+
Requires-Dist: platformdirs>=4.3.8
|
|
18
|
+
Requires-Python: >=3.10, <4.0
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# hop3-cli
|
|
22
|
+
|
|
23
|
+
Command-line interface for interacting with Hop3 servers.
|
|
24
|
+
|
|
25
|
+
## Overview
|
|
26
|
+
|
|
27
|
+
hop3-cli is a thin client that communicates with hop3-server via JSON-RPC over HTTP or SSH tunneling. It provides a familiar Heroku-like CLI experience for deploying and managing applications.
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- **Application management**: Deploy, start, stop, restart, and scale applications
|
|
32
|
+
- **Environment variables**: Securely manage app configuration
|
|
33
|
+
- **Log streaming**: View real-time application logs
|
|
34
|
+
- **Addon management**: Provision and manage backing services (PostgreSQL, Redis, MySQL)
|
|
35
|
+
- **SSH tunneling**: Secure communication with remote servers
|
|
36
|
+
- **Multiple output formats**: Human-readable, JSON, or quiet mode
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install hop3-cli
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Quick Start
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Initialize connection to a Hop3 server
|
|
48
|
+
hop3 init user@hop3.example.com
|
|
49
|
+
|
|
50
|
+
# Or configure via environment
|
|
51
|
+
export HOP3_API_URL="ssh://user@hop3.example.com"
|
|
52
|
+
|
|
53
|
+
# List applications
|
|
54
|
+
hop3 apps
|
|
55
|
+
|
|
56
|
+
# View application logs
|
|
57
|
+
hop3 app:logs myapp
|
|
58
|
+
|
|
59
|
+
# Set environment variables
|
|
60
|
+
hop3 config:set myapp KEY=value
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Configuration
|
|
64
|
+
|
|
65
|
+
Configuration can be set via environment variables or config file (`~/.config/hop3-cli/config.toml`).
|
|
66
|
+
|
|
67
|
+
| Variable | Description | Default |
|
|
68
|
+
|----------|-------------|---------|
|
|
69
|
+
| `HOP3_API_URL` | Server URL (HTTP or SSH) | - |
|
|
70
|
+
| `HOP3_API_TOKEN` | Authentication token | - |
|
|
71
|
+
| `HOP3_DEV_MODE` | Enable development mode | `false` |
|
|
72
|
+
|
|
73
|
+
## Architecture
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
hop3-cli/
|
|
77
|
+
├── src/hop3_cli/
|
|
78
|
+
│ ├── main.py # Entry point, argument parsing
|
|
79
|
+
│ ├── config.py # Configuration management
|
|
80
|
+
│ ├── rpc/
|
|
81
|
+
│ │ └── client.py # JSON-RPC client with SSH tunnel
|
|
82
|
+
│ ├── commands/
|
|
83
|
+
│ │ ├── local.py # Local commands (init, login, settings)
|
|
84
|
+
│ │ ├── flags.py # CLI flag parsing
|
|
85
|
+
│ │ └── destructive.py # Confirmation prompts
|
|
86
|
+
│ └── ui/
|
|
87
|
+
│ └── rich_printer.py # Output formatting
|
|
88
|
+
└── tests/
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Development
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Run tests
|
|
95
|
+
uv run pytest tests/ -v
|
|
96
|
+
|
|
97
|
+
# Lint and format
|
|
98
|
+
uv run ruff check src/
|
|
99
|
+
uv run ruff format src/
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Documentation
|
|
103
|
+
|
|
104
|
+
- [User Guide](../../docs/src/guide.md)
|
|
105
|
+
- [CLI Reference](../../docs/src/cli-reference.md)
|
|
106
|
+
|
|
107
|
+
## Related Packages
|
|
108
|
+
|
|
109
|
+
- [hop3-server](../hop3-server/) - The server that hop3-cli communicates with
|
|
110
|
+
- [hop3-tui](../hop3-tui/) - Alternative terminal UI interface
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
Apache-2.0 - Copyright (c) 2024-2026, Abilian SAS
|
hop3_cli-0.4.0/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# hop3-cli
|
|
2
|
+
|
|
3
|
+
Command-line interface for interacting with Hop3 servers.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
hop3-cli is a thin client that communicates with hop3-server via JSON-RPC over HTTP or SSH tunneling. It provides a familiar Heroku-like CLI experience for deploying and managing applications.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Application management**: Deploy, start, stop, restart, and scale applications
|
|
12
|
+
- **Environment variables**: Securely manage app configuration
|
|
13
|
+
- **Log streaming**: View real-time application logs
|
|
14
|
+
- **Addon management**: Provision and manage backing services (PostgreSQL, Redis, MySQL)
|
|
15
|
+
- **SSH tunneling**: Secure communication with remote servers
|
|
16
|
+
- **Multiple output formats**: Human-readable, JSON, or quiet mode
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install hop3-cli
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Initialize connection to a Hop3 server
|
|
28
|
+
hop3 init user@hop3.example.com
|
|
29
|
+
|
|
30
|
+
# Or configure via environment
|
|
31
|
+
export HOP3_API_URL="ssh://user@hop3.example.com"
|
|
32
|
+
|
|
33
|
+
# List applications
|
|
34
|
+
hop3 apps
|
|
35
|
+
|
|
36
|
+
# View application logs
|
|
37
|
+
hop3 app:logs myapp
|
|
38
|
+
|
|
39
|
+
# Set environment variables
|
|
40
|
+
hop3 config:set myapp KEY=value
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Configuration
|
|
44
|
+
|
|
45
|
+
Configuration can be set via environment variables or config file (`~/.config/hop3-cli/config.toml`).
|
|
46
|
+
|
|
47
|
+
| Variable | Description | Default |
|
|
48
|
+
|----------|-------------|---------|
|
|
49
|
+
| `HOP3_API_URL` | Server URL (HTTP or SSH) | - |
|
|
50
|
+
| `HOP3_API_TOKEN` | Authentication token | - |
|
|
51
|
+
| `HOP3_DEV_MODE` | Enable development mode | `false` |
|
|
52
|
+
|
|
53
|
+
## Architecture
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
hop3-cli/
|
|
57
|
+
├── src/hop3_cli/
|
|
58
|
+
│ ├── main.py # Entry point, argument parsing
|
|
59
|
+
│ ├── config.py # Configuration management
|
|
60
|
+
│ ├── rpc/
|
|
61
|
+
│ │ └── client.py # JSON-RPC client with SSH tunnel
|
|
62
|
+
│ ├── commands/
|
|
63
|
+
│ │ ├── local.py # Local commands (init, login, settings)
|
|
64
|
+
│ │ ├── flags.py # CLI flag parsing
|
|
65
|
+
│ │ └── destructive.py # Confirmation prompts
|
|
66
|
+
│ └── ui/
|
|
67
|
+
│ └── rich_printer.py # Output formatting
|
|
68
|
+
└── tests/
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Development
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Run tests
|
|
75
|
+
uv run pytest tests/ -v
|
|
76
|
+
|
|
77
|
+
# Lint and format
|
|
78
|
+
uv run ruff check src/
|
|
79
|
+
uv run ruff format src/
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Documentation
|
|
83
|
+
|
|
84
|
+
- [User Guide](../../docs/src/guide.md)
|
|
85
|
+
- [CLI Reference](../../docs/src/cli-reference.md)
|
|
86
|
+
|
|
87
|
+
## Related Packages
|
|
88
|
+
|
|
89
|
+
- [hop3-server](../hop3-server/) - The server that hop3-cli communicates with
|
|
90
|
+
- [hop3-tui](../hop3-tui/) - Alternative terminal UI interface
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
Apache-2.0 - Copyright (c) 2024-2026, Abilian SAS
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "hop3-cli"
|
|
3
|
+
version = "0.4.0"
|
|
4
|
+
authors = [
|
|
5
|
+
{name = "Stefane Fermigier", email = "sf@abilian.com"},
|
|
6
|
+
]
|
|
7
|
+
license = "Apache-2.0"
|
|
8
|
+
requires-python = "<4.0,>=3.10"
|
|
9
|
+
dependencies = [
|
|
10
|
+
# Configuration
|
|
11
|
+
"toml<1.0.0,>=0.10.2",
|
|
12
|
+
# Communication
|
|
13
|
+
"jsonrpcclient<5.0.0,>=4.0.3",
|
|
14
|
+
"requests<3.0.0,>=2.32.3",
|
|
15
|
+
# Presentation
|
|
16
|
+
"tabulate<1.0.0,>=0.9.0",
|
|
17
|
+
"rich>=13.0.0", # Rich formatting, tables, progress bars, colors
|
|
18
|
+
# SSH tunneling - pin paramiko to 2.x for DSS key compatibility with sshtunnel
|
|
19
|
+
"sshtunnel>=0.4.0",
|
|
20
|
+
"paramiko>=2.11.0,<3.0.0",
|
|
21
|
+
"loguru>=0.7.3",
|
|
22
|
+
"pathspec>=0.12.1",
|
|
23
|
+
"platformdirs>=4.3.8",
|
|
24
|
+
]
|
|
25
|
+
description = ""
|
|
26
|
+
readme = "README.md"
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
hop = "hop3_cli.main:main"
|
|
30
|
+
hop3 = "hop3_cli.main:main"
|
|
31
|
+
|
|
32
|
+
# ----------------------------------------
|
|
33
|
+
|
|
34
|
+
[build-system]
|
|
35
|
+
requires = ["uv-build>=0.8.4,<0.9.0"]
|
|
36
|
+
build-backend = "uv_build"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
[tool.pytest.ini_options]
|
|
40
|
+
filterwarnings = [
|
|
41
|
+
# paramiko uses TripleDES which cryptography has deprecated
|
|
42
|
+
"ignore:TripleDES has been moved:cryptography.utils.CryptographyDeprecationWarning",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
# Keep!
|
|
46
|
+
[tool.pyrefly]
|
|
47
|
+
project-includes = [
|
|
48
|
+
"**/*.py*",
|
|
49
|
+
"**/*.ipynb",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
# Was:
|
|
53
|
+
#[build-system]
|
|
54
|
+
#requires = ["pdm-backend"]
|
|
55
|
+
#build-backend = "pdm.backend"
|
|
56
|
+
#
|
|
57
|
+
#[tool.pdm.build]
|
|
58
|
+
#includes = ["src/hop3_cli"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Copyright (c) 2023-2025, Abilian SAS
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Copyright (c) 2025, Abilian SAS
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
"""Command processing for the Hop3 CLI.
|
|
6
|
+
|
|
7
|
+
This package handles command parsing and local command execution:
|
|
8
|
+
- local: Commands handled locally without server RPC
|
|
9
|
+
- help: Help flag handling and help output injection
|
|
10
|
+
- destructive: Confirmation prompts for destructive commands
|
|
11
|
+
- flags: CLI flag parsing (--json, --quiet, -y, etc.)
|
|
12
|
+
- arguments: Argument generation (e.g., deploy archive)
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
from .arguments import generate_archive, get_extra_args, pack_repository
|
|
18
|
+
from .destructive import confirm_destructive_action, is_destructive_command
|
|
19
|
+
from .flags import CliFlags, parse_flags
|
|
20
|
+
from .help import (
|
|
21
|
+
handle_help_flags,
|
|
22
|
+
inject_local_commands_into_help,
|
|
23
|
+
is_help_command,
|
|
24
|
+
)
|
|
25
|
+
from .local import (
|
|
26
|
+
LOCAL_COMMANDS,
|
|
27
|
+
LOCAL_COMMANDS_INFO,
|
|
28
|
+
handle_local_command,
|
|
29
|
+
is_local_command,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
__all__ = [
|
|
33
|
+
"LOCAL_COMMANDS",
|
|
34
|
+
"LOCAL_COMMANDS_INFO",
|
|
35
|
+
"CliFlags",
|
|
36
|
+
"confirm_destructive_action",
|
|
37
|
+
"generate_archive",
|
|
38
|
+
"get_extra_args",
|
|
39
|
+
"handle_help_flags",
|
|
40
|
+
"handle_local_command",
|
|
41
|
+
"inject_local_commands_into_help",
|
|
42
|
+
"is_destructive_command",
|
|
43
|
+
"is_help_command",
|
|
44
|
+
"is_local_command",
|
|
45
|
+
"pack_repository",
|
|
46
|
+
"parse_flags",
|
|
47
|
+
]
|