agentic-fabriq-sdk 0.1.5__py3-none-any.whl → 0.1.7__py3-none-any.whl
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.
Potentially problematic release.
This version of agentic-fabriq-sdk might be problematic. Click here for more details.
- af_cli/__init__.py +8 -0
- af_cli/commands/__init__.py +3 -0
- af_cli/commands/agents.py +238 -0
- af_cli/commands/auth.py +390 -0
- af_cli/commands/config.py +102 -0
- af_cli/commands/mcp_servers.py +83 -0
- af_cli/commands/secrets.py +109 -0
- af_cli/commands/tools.py +474 -0
- af_cli/core/__init__.py +3 -0
- af_cli/core/client.py +127 -0
- af_cli/core/config.py +200 -0
- af_cli/core/oauth.py +506 -0
- af_cli/core/output.py +180 -0
- af_cli/core/token_storage.py +263 -0
- af_cli/main.py +187 -0
- {agentic_fabriq_sdk-0.1.5.dist-info → agentic_fabriq_sdk-0.1.7.dist-info}/METADATA +40 -10
- {agentic_fabriq_sdk-0.1.5.dist-info → agentic_fabriq_sdk-0.1.7.dist-info}/RECORD +19 -3
- agentic_fabriq_sdk-0.1.7.dist-info/entry_points.txt +3 -0
- {agentic_fabriq_sdk-0.1.5.dist-info → agentic_fabriq_sdk-0.1.7.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Configuration commands for the Agentic Fabric CLI.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from af_cli.core.config import get_config
|
|
8
|
+
from af_cli.core.output import error, info, print_output, success
|
|
9
|
+
|
|
10
|
+
app = typer.Typer(help="Configuration commands")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@app.command()
|
|
14
|
+
def show(
|
|
15
|
+
format: str = typer.Option("table", "--format", "-f", help="Output format"),
|
|
16
|
+
):
|
|
17
|
+
"""Show current configuration."""
|
|
18
|
+
config = get_config()
|
|
19
|
+
|
|
20
|
+
config_data = {
|
|
21
|
+
"gateway_url": config.gateway_url,
|
|
22
|
+
"tenant_id": config.tenant_id or "Not set",
|
|
23
|
+
"authenticated": "Yes" if config.is_authenticated() else "No",
|
|
24
|
+
"config_file": config.config_file,
|
|
25
|
+
"output_format": config.output_format,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
print_output(
|
|
29
|
+
config_data,
|
|
30
|
+
format_type=format,
|
|
31
|
+
title="Configuration"
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@app.command()
|
|
36
|
+
def set(
|
|
37
|
+
key: str = typer.Argument(..., help="Configuration key"),
|
|
38
|
+
value: str = typer.Argument(..., help="Configuration value"),
|
|
39
|
+
):
|
|
40
|
+
"""Set configuration value."""
|
|
41
|
+
config = get_config()
|
|
42
|
+
|
|
43
|
+
valid_keys = {
|
|
44
|
+
"gateway_url": "gateway_url",
|
|
45
|
+
"tenant_id": "tenant_id",
|
|
46
|
+
"output_format": "output_format",
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if key not in valid_keys:
|
|
50
|
+
error(f"Invalid configuration key: {key}")
|
|
51
|
+
error(f"Valid keys: {', '.join(valid_keys.keys())}")
|
|
52
|
+
raise typer.Exit(1)
|
|
53
|
+
|
|
54
|
+
# Set the value
|
|
55
|
+
setattr(config, valid_keys[key], value)
|
|
56
|
+
config.save()
|
|
57
|
+
|
|
58
|
+
success(f"Configuration updated: {key} = {value}")
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@app.command()
|
|
62
|
+
def get(
|
|
63
|
+
key: str = typer.Argument(..., help="Configuration key"),
|
|
64
|
+
):
|
|
65
|
+
"""Get configuration value."""
|
|
66
|
+
config = get_config()
|
|
67
|
+
|
|
68
|
+
valid_keys = {
|
|
69
|
+
"gateway_url": "gateway_url",
|
|
70
|
+
"tenant_id": "tenant_id",
|
|
71
|
+
"output_format": "output_format",
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if key not in valid_keys:
|
|
75
|
+
error(f"Invalid configuration key: {key}")
|
|
76
|
+
error(f"Valid keys: {', '.join(valid_keys.keys())}")
|
|
77
|
+
raise typer.Exit(1)
|
|
78
|
+
|
|
79
|
+
value = getattr(config, valid_keys[key])
|
|
80
|
+
info(f"{key}: {value}")
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@app.command()
|
|
84
|
+
def reset():
|
|
85
|
+
"""Reset configuration to defaults."""
|
|
86
|
+
config = get_config()
|
|
87
|
+
|
|
88
|
+
if not typer.confirm("Are you sure you want to reset configuration to defaults?"):
|
|
89
|
+
info("Reset cancelled")
|
|
90
|
+
return
|
|
91
|
+
|
|
92
|
+
# Clear authentication
|
|
93
|
+
config.clear_auth()
|
|
94
|
+
|
|
95
|
+
# Reset to defaults
|
|
96
|
+
config.gateway_url = "https://dashboard.agenticfabriq.com"
|
|
97
|
+
config.tenant_id = None
|
|
98
|
+
config.output_format = "table"
|
|
99
|
+
|
|
100
|
+
config.save()
|
|
101
|
+
|
|
102
|
+
success("Configuration reset to defaults")
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MCP server management commands for the Agentic Fabric CLI.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from af_cli.core.client import get_client
|
|
8
|
+
from af_cli.core.output import error, info, print_output, success, warning
|
|
9
|
+
|
|
10
|
+
app = typer.Typer(help="MCP server management commands")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@app.command()
|
|
14
|
+
def list(
|
|
15
|
+
format: str = typer.Option("table", "--format", "-f", help="Output format"),
|
|
16
|
+
):
|
|
17
|
+
"""List MCP servers."""
|
|
18
|
+
try:
|
|
19
|
+
with get_client() as client:
|
|
20
|
+
response = client.get("/api/v1/mcp-servers")
|
|
21
|
+
servers = response["servers"]
|
|
22
|
+
|
|
23
|
+
if not servers:
|
|
24
|
+
warning("No MCP servers found")
|
|
25
|
+
return
|
|
26
|
+
|
|
27
|
+
print_output(
|
|
28
|
+
servers,
|
|
29
|
+
format_type=format,
|
|
30
|
+
title="MCP Servers"
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
except Exception as e:
|
|
34
|
+
error(f"Failed to list MCP servers: {e}")
|
|
35
|
+
raise typer.Exit(1)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@app.command()
|
|
39
|
+
def get(
|
|
40
|
+
server_id: str = typer.Argument(..., help="MCP server ID"),
|
|
41
|
+
format: str = typer.Option("table", "--format", "-f", help="Output format"),
|
|
42
|
+
):
|
|
43
|
+
"""Get MCP server details."""
|
|
44
|
+
try:
|
|
45
|
+
with get_client() as client:
|
|
46
|
+
server = client.get(f"/api/v1/mcp-servers/{server_id}")
|
|
47
|
+
|
|
48
|
+
print_output(
|
|
49
|
+
server,
|
|
50
|
+
format_type=format,
|
|
51
|
+
title=f"MCP Server {server_id}"
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
except Exception as e:
|
|
55
|
+
error(f"Failed to get MCP server: {e}")
|
|
56
|
+
raise typer.Exit(1)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@app.command()
|
|
60
|
+
def create(
|
|
61
|
+
name: str = typer.Option(..., "--name", "-n", help="MCP server name"),
|
|
62
|
+
base_url: str = typer.Option(..., "--base-url", "-u", help="Base URL"),
|
|
63
|
+
auth_type: str = typer.Option("API_KEY", "--auth-type", "-a", help="Authentication type"),
|
|
64
|
+
):
|
|
65
|
+
"""Create a new MCP server."""
|
|
66
|
+
try:
|
|
67
|
+
with get_client() as client:
|
|
68
|
+
data = {
|
|
69
|
+
"name": name,
|
|
70
|
+
"base_url": base_url,
|
|
71
|
+
"auth_type": auth_type,
|
|
72
|
+
"source": "STATIC",
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
server = client.post("/api/v1/mcp-servers", data)
|
|
76
|
+
|
|
77
|
+
success(f"MCP server created: {server['id']}")
|
|
78
|
+
info(f"Name: {server['name']}")
|
|
79
|
+
info(f"Base URL: {server['base_url']}")
|
|
80
|
+
|
|
81
|
+
except Exception as e:
|
|
82
|
+
error(f"Failed to create MCP server: {e}")
|
|
83
|
+
raise typer.Exit(1)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Secret management commands for the Agentic Fabric CLI.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from af_cli.core.client import get_client
|
|
8
|
+
from af_cli.core.output import error, info, print_output, success
|
|
9
|
+
|
|
10
|
+
app = typer.Typer(help="Secret management commands")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@app.command()
|
|
14
|
+
def get(
|
|
15
|
+
path: str = typer.Argument(..., help="Secret path"),
|
|
16
|
+
format: str = typer.Option("table", "--format", "-f", help="Output format"),
|
|
17
|
+
):
|
|
18
|
+
"""Get a secret."""
|
|
19
|
+
try:
|
|
20
|
+
with get_client() as client:
|
|
21
|
+
secret = client.get(f"/api/v1/secrets/{path}")
|
|
22
|
+
|
|
23
|
+
# Don't display the actual secret value in table format
|
|
24
|
+
if format == "table":
|
|
25
|
+
display_data = {
|
|
26
|
+
"path": secret["path"],
|
|
27
|
+
"description": secret.get("description", ""),
|
|
28
|
+
"version": secret["version"],
|
|
29
|
+
"created_at": secret["created_at"],
|
|
30
|
+
"updated_at": secret["updated_at"],
|
|
31
|
+
}
|
|
32
|
+
print_output(display_data, format_type=format, title=f"Secret {path}")
|
|
33
|
+
info("Use --format=json to see the secret value")
|
|
34
|
+
else:
|
|
35
|
+
print_output(secret, format_type=format)
|
|
36
|
+
|
|
37
|
+
except Exception as e:
|
|
38
|
+
error(f"Failed to get secret: {e}")
|
|
39
|
+
raise typer.Exit(1)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@app.command()
|
|
43
|
+
def create(
|
|
44
|
+
path: str = typer.Argument(..., help="Secret path"),
|
|
45
|
+
value: str = typer.Option(..., "--value", "-v", help="Secret value"),
|
|
46
|
+
description: str = typer.Option("", "--description", "-d", help="Secret description"),
|
|
47
|
+
):
|
|
48
|
+
"""Create a new secret."""
|
|
49
|
+
try:
|
|
50
|
+
with get_client() as client:
|
|
51
|
+
data = {
|
|
52
|
+
"value": value,
|
|
53
|
+
"description": description,
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
secret = client.post(f"/api/v1/secrets/{path}", data)
|
|
57
|
+
|
|
58
|
+
success(f"Secret created: {secret['path']}")
|
|
59
|
+
info(f"Version: {secret['version']}")
|
|
60
|
+
|
|
61
|
+
except Exception as e:
|
|
62
|
+
error(f"Failed to create secret: {e}")
|
|
63
|
+
raise typer.Exit(1)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@app.command()
|
|
67
|
+
def update(
|
|
68
|
+
path: str = typer.Argument(..., help="Secret path"),
|
|
69
|
+
value: str = typer.Option(..., "--value", "-v", help="Secret value"),
|
|
70
|
+
description: str = typer.Option("", "--description", "-d", help="Secret description"),
|
|
71
|
+
):
|
|
72
|
+
"""Update a secret."""
|
|
73
|
+
try:
|
|
74
|
+
with get_client() as client:
|
|
75
|
+
data = {
|
|
76
|
+
"value": value,
|
|
77
|
+
"description": description,
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
secret = client.put(f"/api/v1/secrets/{path}", data)
|
|
81
|
+
|
|
82
|
+
success(f"Secret updated: {secret['path']}")
|
|
83
|
+
info(f"Version: {secret['version']}")
|
|
84
|
+
|
|
85
|
+
except Exception as e:
|
|
86
|
+
error(f"Failed to update secret: {e}")
|
|
87
|
+
raise typer.Exit(1)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@app.command()
|
|
91
|
+
def delete(
|
|
92
|
+
path: str = typer.Argument(..., help="Secret path"),
|
|
93
|
+
force: bool = typer.Option(False, "--force", "-f", help="Force deletion"),
|
|
94
|
+
):
|
|
95
|
+
"""Delete a secret."""
|
|
96
|
+
try:
|
|
97
|
+
if not force:
|
|
98
|
+
if not typer.confirm(f"Are you sure you want to delete secret {path}?"):
|
|
99
|
+
info("Deletion cancelled")
|
|
100
|
+
return
|
|
101
|
+
|
|
102
|
+
with get_client() as client:
|
|
103
|
+
client.delete(f"/api/v1/secrets/{path}")
|
|
104
|
+
|
|
105
|
+
success(f"Secret deleted: {path}")
|
|
106
|
+
|
|
107
|
+
except Exception as e:
|
|
108
|
+
error(f"Failed to delete secret: {e}")
|
|
109
|
+
raise typer.Exit(1)
|