jvcli 2.0.18__py3-none-any.whl → 2.0.19__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.
- jvcli/__init__.py +1 -1
- jvcli/auth.py +23 -0
- jvcli/cli.py +4 -0
- jvcli/commands/clean.py +29 -0
- jvcli/commands/server.py +258 -0
- jvcli/commands/startproject.py +0 -1
- jvcli/templates/2.0.0/project/env.example +3 -2
- jvcli/utils.py +26 -0
- jvcli-2.0.19.dist-info/METADATA +422 -0
- {jvcli-2.0.18.dist-info → jvcli-2.0.19.dist-info}/RECORD +14 -19
- {jvcli-2.0.18.dist-info → jvcli-2.0.19.dist-info}/WHEEL +1 -1
- jvcli/templates/2.0.0/project/sh/exportenv.sh +0 -12
- jvcli/templates/2.0.0/project/sh/importagent.sh +0 -47
- jvcli/templates/2.0.0/project/sh/initagents.sh +0 -37
- jvcli/templates/2.0.0/project/sh/inituser.sh +0 -50
- jvcli/templates/2.0.0/project/sh/jacclean.sh +0 -11
- jvcli/templates/2.0.0/project/sh/serve.sh +0 -7
- jvcli/templates/2.0.0/project/sh/startclient.sh +0 -7
- jvcli-2.0.18.dist-info/METADATA +0 -128
- {jvcli-2.0.18.dist-info → jvcli-2.0.19.dist-info}/entry_points.txt +0 -0
- {jvcli-2.0.18.dist-info → jvcli-2.0.19.dist-info}/licenses/LICENSE +0 -0
- {jvcli-2.0.18.dist-info → jvcli-2.0.19.dist-info}/top_level.txt +0 -0
jvcli/__init__.py
CHANGED
jvcli/auth.py
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
import json
|
4
4
|
import os
|
5
5
|
|
6
|
+
import requests
|
7
|
+
|
6
8
|
TOKEN_FILE = os.path.expanduser("~/.jvcli_token")
|
7
9
|
|
8
10
|
|
@@ -43,3 +45,24 @@ def load_namespaces() -> str:
|
|
43
45
|
"""Load the namespaces from the token."""
|
44
46
|
token = load_token()
|
45
47
|
return token.get("namespaces", {}).get("default", "anonymous")
|
48
|
+
|
49
|
+
|
50
|
+
def login_jivas() -> str:
|
51
|
+
"""Login to Jivas and return the token."""
|
52
|
+
email = os.environ.get("JIVAS_USER")
|
53
|
+
password = os.environ.get("JIVAS_PASSWORD")
|
54
|
+
if not email or not password:
|
55
|
+
raise ValueError(
|
56
|
+
"JIVAS_USER and JIVAS_PASSWORD environment variables are required."
|
57
|
+
)
|
58
|
+
|
59
|
+
login_url = (
|
60
|
+
f"{os.environ.get('JIVAS_BASE_URL', 'http://localhost:8000')}/user/login"
|
61
|
+
)
|
62
|
+
response = requests.post(login_url, json={"email": email, "password": password})
|
63
|
+
if response.status_code == 200:
|
64
|
+
data = response.json()
|
65
|
+
os.environ["JIVAS_TOKEN"] = data["token"]
|
66
|
+
return data["token"]
|
67
|
+
else:
|
68
|
+
raise ValueError(f"Login failed: {response.text}")
|
jvcli/cli.py
CHANGED
@@ -4,11 +4,13 @@ import click
|
|
4
4
|
|
5
5
|
from jvcli import __version__
|
6
6
|
from jvcli.commands.auth import login, logout, signup
|
7
|
+
from jvcli.commands.clean import clean
|
7
8
|
from jvcli.commands.client import client
|
8
9
|
from jvcli.commands.create import create
|
9
10
|
from jvcli.commands.download import download
|
10
11
|
from jvcli.commands.info import info
|
11
12
|
from jvcli.commands.publish import publish
|
13
|
+
from jvcli.commands.server import server
|
12
14
|
from jvcli.commands.startproject import startproject
|
13
15
|
from jvcli.commands.studio import studio
|
14
16
|
from jvcli.commands.update import update
|
@@ -30,6 +32,8 @@ jvcli.add_command(info)
|
|
30
32
|
jvcli.add_command(studio)
|
31
33
|
jvcli.add_command(client)
|
32
34
|
jvcli.add_command(startproject)
|
35
|
+
jvcli.add_command(clean)
|
36
|
+
jvcli.add_command(server)
|
33
37
|
|
34
38
|
# Register standalone commands
|
35
39
|
jvcli.add_command(signup)
|
jvcli/commands/clean.py
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
"""Runs the jac clean command"""
|
2
|
+
|
3
|
+
import subprocess
|
4
|
+
|
5
|
+
import click
|
6
|
+
|
7
|
+
|
8
|
+
@click.command(
|
9
|
+
help="Clean the Jac files in the current directory and subdirectories. This command executes 'jac clean', which removes compiled Jac artifacts and temporary files. "
|
10
|
+
"Use this command to ensure a clean state before rebuilding your Jac project."
|
11
|
+
)
|
12
|
+
@click.pass_context
|
13
|
+
def clean(ctx: click.Context) -> None:
|
14
|
+
"""Clean the Jac files in directory."""
|
15
|
+
try:
|
16
|
+
click.echo("Running jac clean in actions directory...")
|
17
|
+
result = subprocess.run(["jac", "clean"], check=True)
|
18
|
+
if result.returncode == 0:
|
19
|
+
click.echo("Successfully cleaned directory.")
|
20
|
+
|
21
|
+
else:
|
22
|
+
click.secho("Failed to clean directory.", fg="red")
|
23
|
+
ctx.exit(1)
|
24
|
+
except subprocess.CalledProcessError as e:
|
25
|
+
click.secho(f"Error running jac clean: {e}", fg="red")
|
26
|
+
ctx.exit(1)
|
27
|
+
except Exception as e:
|
28
|
+
click.secho(f"Unexpected error: {e}", fg="red")
|
29
|
+
ctx.exit(1)
|
jvcli/commands/server.py
ADDED
@@ -0,0 +1,258 @@
|
|
1
|
+
"""Server command group for interfacing with the Jivas Server."""
|
2
|
+
|
3
|
+
import json
|
4
|
+
import os
|
5
|
+
import subprocess
|
6
|
+
import sys
|
7
|
+
from typing import Optional
|
8
|
+
|
9
|
+
import click
|
10
|
+
import requests
|
11
|
+
|
12
|
+
from jvcli.auth import login_jivas
|
13
|
+
from jvcli.commands.clean import clean
|
14
|
+
from jvcli.utils import is_server_running
|
15
|
+
|
16
|
+
|
17
|
+
@click.group()
|
18
|
+
def server() -> None:
|
19
|
+
"""Group for interfacing with the Jivas Server."""
|
20
|
+
pass # pragma: no cover
|
21
|
+
|
22
|
+
|
23
|
+
@server.command()
|
24
|
+
@click.option(
|
25
|
+
"--jac-file",
|
26
|
+
default="main.jac",
|
27
|
+
help="Path to the JAC file to run. Defaults to main.jac in the current directory.",
|
28
|
+
)
|
29
|
+
def launch(jac_file: str) -> None:
|
30
|
+
"""Launch the Jivas Server by running the specified JAC file."""
|
31
|
+
click.echo(f"Launching Jivas Server with JAC file: {jac_file}...")
|
32
|
+
subprocess.call(["jac", "jvserve", jac_file])
|
33
|
+
|
34
|
+
|
35
|
+
@server.command()
|
36
|
+
@click.option(
|
37
|
+
"--email",
|
38
|
+
required=False,
|
39
|
+
help="Email address for Jivas login.",
|
40
|
+
)
|
41
|
+
@click.option(
|
42
|
+
"--password",
|
43
|
+
required=False,
|
44
|
+
hide_input=True,
|
45
|
+
help="Password for Jivas login.",
|
46
|
+
)
|
47
|
+
def login(email: Optional[str] = None, password: Optional[str] = None) -> Optional[str]:
|
48
|
+
"""Login to Jivas Server and get an authentication token."""
|
49
|
+
email = os.environ.get("JIVAS_USER") or email
|
50
|
+
password = os.environ.get("JIVAS_PASSWORD") or password
|
51
|
+
|
52
|
+
if email is None:
|
53
|
+
email = click.prompt("Email")
|
54
|
+
if password is None:
|
55
|
+
password = click.prompt("Password", hide_input=True)
|
56
|
+
|
57
|
+
click.echo(f"Logging in to Jivas Server as {email}...")
|
58
|
+
|
59
|
+
login_url = (
|
60
|
+
f"{os.environ.get('JIVAS_BASE_URL', 'http://localhost:8000')}/user/login"
|
61
|
+
)
|
62
|
+
|
63
|
+
try:
|
64
|
+
response = requests.post(login_url, json={"email": email, "password": password})
|
65
|
+
if response.status_code == 200:
|
66
|
+
data = response.json()
|
67
|
+
token = data["token"]
|
68
|
+
os.environ["JIVAS_TOKEN"] = token
|
69
|
+
click.secho("Login successful!", fg="green", bold=True)
|
70
|
+
click.echo(f"Token: {token}")
|
71
|
+
return token
|
72
|
+
else:
|
73
|
+
click.secho(f"Login failed: {response.text}", fg="red", bold=True)
|
74
|
+
return None
|
75
|
+
except Exception as e:
|
76
|
+
click.secho(f"Error connecting to Jivas Server: {str(e)}", fg="red", bold=True)
|
77
|
+
return None
|
78
|
+
|
79
|
+
|
80
|
+
@server.command()
|
81
|
+
@click.option(
|
82
|
+
"--email",
|
83
|
+
required=False,
|
84
|
+
help="Email address for the system admin.",
|
85
|
+
)
|
86
|
+
@click.option(
|
87
|
+
"--password",
|
88
|
+
required=False,
|
89
|
+
hide_input=True,
|
90
|
+
help="Password for the system admin.",
|
91
|
+
)
|
92
|
+
def createadmin(email: Optional[str] = None, password: Optional[str] = None) -> None:
|
93
|
+
"""Create a system administrator account."""
|
94
|
+
email = os.environ.get("JIVAS_USER") or email
|
95
|
+
password = os.environ.get("JIVAS_PASSWORD") or password
|
96
|
+
|
97
|
+
if email is None:
|
98
|
+
email = click.prompt("Email")
|
99
|
+
if password is None:
|
100
|
+
password = click.prompt("Password", hide_input=True)
|
101
|
+
|
102
|
+
database_host = os.environ.get("DATABASE_HOST")
|
103
|
+
|
104
|
+
if not database_host:
|
105
|
+
click.echo("Database host is not set. Using signup endpoint...")
|
106
|
+
signup_url = (
|
107
|
+
f"{os.environ.get('JIVAS_BASE_URL', 'http://localhost:8000')}/user/register"
|
108
|
+
)
|
109
|
+
|
110
|
+
try:
|
111
|
+
response = requests.post(
|
112
|
+
signup_url, json={"email": email, "password": password}
|
113
|
+
)
|
114
|
+
if response.status_code in (200, 201):
|
115
|
+
click.secho("Admin user created successfully!", fg="green", bold=True)
|
116
|
+
return response.json()
|
117
|
+
else:
|
118
|
+
click.secho(
|
119
|
+
f"Failed to create admin: {response.text}", fg="red", bold=True
|
120
|
+
)
|
121
|
+
except Exception as e:
|
122
|
+
click.secho(
|
123
|
+
f"Error connecting to Jivas Server: {str(e)}", fg="red", bold=True
|
124
|
+
)
|
125
|
+
else:
|
126
|
+
click.echo("Creating system admin...")
|
127
|
+
try:
|
128
|
+
result = subprocess.call(
|
129
|
+
[
|
130
|
+
"jac",
|
131
|
+
"create_system_admin",
|
132
|
+
"main.jac",
|
133
|
+
"--email",
|
134
|
+
email,
|
135
|
+
"--password",
|
136
|
+
password,
|
137
|
+
]
|
138
|
+
)
|
139
|
+
if result == 0:
|
140
|
+
click.secho("Admin user created successfully!", fg="green", bold=True)
|
141
|
+
else:
|
142
|
+
click.secho("Failed to create admin user", fg="red", bold=True)
|
143
|
+
except Exception as e:
|
144
|
+
click.secho(f"Error running jac command: {str(e)}", fg="red", bold=True)
|
145
|
+
|
146
|
+
|
147
|
+
@server.command()
|
148
|
+
def initagents() -> None:
|
149
|
+
"""
|
150
|
+
Initialize agents in the Jivas system.
|
151
|
+
|
152
|
+
Usage:
|
153
|
+
jvcli initagents
|
154
|
+
"""
|
155
|
+
|
156
|
+
# Check if server is running
|
157
|
+
if not is_server_running():
|
158
|
+
click.secho("Server is not running. Please start the server first.", fg="red")
|
159
|
+
sys.exit(1)
|
160
|
+
|
161
|
+
# Login to Jivas
|
162
|
+
token = login_jivas()
|
163
|
+
if not token:
|
164
|
+
click.secho("Failed to login to Jivas.", fg="red")
|
165
|
+
sys.exit(1)
|
166
|
+
click.secho("Logged in to Jivas successfully.", fg="green")
|
167
|
+
|
168
|
+
# Run jvcli clean command
|
169
|
+
click.secho("Cleaning Jac files before initializing agents...", fg="blue")
|
170
|
+
ctx = click.Context(clean, info_name="clean")
|
171
|
+
clean.invoke(ctx)
|
172
|
+
|
173
|
+
# Initialize agents
|
174
|
+
try:
|
175
|
+
response = requests.post(
|
176
|
+
f"{os.environ['JIVAS_BASE_URL']}/walker/init_agents",
|
177
|
+
headers={
|
178
|
+
"Content-Type": "application/json",
|
179
|
+
"Accept": "application/json",
|
180
|
+
"Authorization": f"Bearer {token}",
|
181
|
+
},
|
182
|
+
json={}, # Add empty JSON object as request data
|
183
|
+
)
|
184
|
+
|
185
|
+
if response.status_code == 200:
|
186
|
+
data = response.json()
|
187
|
+
click.secho(f"Successfully initialized agents: {data}", fg="green")
|
188
|
+
else:
|
189
|
+
click.secho("Failed to initialize agents", fg="red")
|
190
|
+
sys.exit(1)
|
191
|
+
except requests.RequestException as e:
|
192
|
+
click.secho(f"Error during request: {e}", fg="red")
|
193
|
+
sys.exit(1)
|
194
|
+
|
195
|
+
|
196
|
+
@server.command()
|
197
|
+
@click.argument("agent_name")
|
198
|
+
@click.argument("version", required=False)
|
199
|
+
def importagent(agent_name: str, version: str) -> None:
|
200
|
+
"""
|
201
|
+
Import an agent from a DAF package.
|
202
|
+
|
203
|
+
Usage:
|
204
|
+
jvcli importagent <agent_name> [--version <jivas_version>]
|
205
|
+
"""
|
206
|
+
|
207
|
+
# Check if server is running
|
208
|
+
if not is_server_running():
|
209
|
+
click.secho("Server is not running. Please start the server first.", fg="red")
|
210
|
+
sys.exit(1)
|
211
|
+
|
212
|
+
# Login to Jivas
|
213
|
+
token = login_jivas()
|
214
|
+
if not token:
|
215
|
+
click.secho("Failed to login to Jivas.", fg="red")
|
216
|
+
sys.exit(1)
|
217
|
+
click.secho("Logged in to Jivas successfully.", fg="green")
|
218
|
+
|
219
|
+
# Check if version is provided
|
220
|
+
if not version:
|
221
|
+
version = "latest"
|
222
|
+
|
223
|
+
try:
|
224
|
+
response = requests.post(
|
225
|
+
f"{os.environ.get('JIVAS_BASE_URL', 'http://localhost:8000')}/walker/import_agent",
|
226
|
+
json={"daf_name": agent_name, "daf_version": version},
|
227
|
+
headers={
|
228
|
+
"Content-Type": "application/json",
|
229
|
+
"Accept": "application/json",
|
230
|
+
"Authorization": f"Bearer {token}",
|
231
|
+
},
|
232
|
+
)
|
233
|
+
|
234
|
+
if response.status_code == 200:
|
235
|
+
try:
|
236
|
+
data = response.json()
|
237
|
+
agent_id = data.get("id")
|
238
|
+
if agent_id:
|
239
|
+
click.secho(
|
240
|
+
f"Successfully imported agent. Agent ID: {agent_id}", fg="green"
|
241
|
+
)
|
242
|
+
else:
|
243
|
+
click.secho(
|
244
|
+
"Agent imported but no ID was returned in the response",
|
245
|
+
fg="yellow",
|
246
|
+
)
|
247
|
+
except json.JSONDecodeError:
|
248
|
+
click.secho("Invalid JSON response from server", fg="red")
|
249
|
+
sys.exit(1)
|
250
|
+
else:
|
251
|
+
click.secho(
|
252
|
+
f"Failed to import agent. Status: {response.status_code}", fg="red"
|
253
|
+
)
|
254
|
+
click.echo(response.text)
|
255
|
+
sys.exit(1)
|
256
|
+
except requests.RequestException as e:
|
257
|
+
click.secho(f"Request failed: {e}", fg="red")
|
258
|
+
sys.exit(1)
|
jvcli/commands/startproject.py
CHANGED
@@ -28,7 +28,8 @@ JIVAS_WEBHOOK_SECRET_KEY="ABCDEFGHIJK"
|
|
28
28
|
TOKEN_SECRET=s3cr3t
|
29
29
|
|
30
30
|
# MongoDB Config
|
31
|
-
# DATABASE_HOST=mongodb://localhost:27017/?replicaSet=my-rs
|
31
|
+
# DATABASE_HOST=mongodb://localhost:27017/?replicaSet=my-rs # If running MongoDB exposed on localhost, replace with the actual host and replaceSet name
|
32
|
+
# DATABASE_HOST=mongodb://mongodb:27017/?replicaSet=my-rs # If running MongoDB in a container named mongodb, replace with the actual host and replaceSet name
|
32
33
|
|
33
34
|
# Typesense Config
|
34
35
|
# TYPESENSE_HOST=localhost
|
@@ -39,4 +40,4 @@ TOKEN_SECRET=s3cr3t
|
|
39
40
|
|
40
41
|
# WPP Config
|
41
42
|
# WPP_API_URL="http://localhost:21465"
|
42
|
-
#
|
43
|
+
# WPP_SECRET_KEY="wpp_secret"
|
jvcli/utils.py
CHANGED
@@ -5,6 +5,7 @@ import re
|
|
5
5
|
import tarfile
|
6
6
|
|
7
7
|
import click
|
8
|
+
import requests
|
8
9
|
import yaml
|
9
10
|
from packaging.specifiers import InvalidSpecifier, SpecifierSet
|
10
11
|
from packaging.version import InvalidVersion, Version
|
@@ -202,3 +203,28 @@ def compress_package_to_tgz(source_path: str, output_filename: str) -> str:
|
|
202
203
|
arcname = os.path.relpath(file_path, start=source_path)
|
203
204
|
tar.add(file_path, arcname=arcname)
|
204
205
|
return output_filename
|
206
|
+
|
207
|
+
|
208
|
+
def load_env_if_present() -> None:
|
209
|
+
"""Load environment variables from .env file if present."""
|
210
|
+
env_path = os.path.join(os.getcwd(), ".env")
|
211
|
+
if os.path.exists(env_path):
|
212
|
+
try:
|
213
|
+
import dotenv
|
214
|
+
|
215
|
+
dotenv.load_dotenv(env_path)
|
216
|
+
except ImportError:
|
217
|
+
click.echo(
|
218
|
+
"dotenv package not installed. Environment variables will not be loaded from .env file."
|
219
|
+
)
|
220
|
+
|
221
|
+
|
222
|
+
def is_server_running() -> bool:
|
223
|
+
"""Check if the server is running by sending a request to the API."""
|
224
|
+
try:
|
225
|
+
base_url = os.environ.get("JIVAS_BASE_URL", "http://localhost:8000")
|
226
|
+
healthz_url = f"{base_url}/healthz"
|
227
|
+
response = requests.get(healthz_url)
|
228
|
+
return response.status_code == 200
|
229
|
+
except requests.ConnectionError:
|
230
|
+
return False
|
@@ -0,0 +1,422 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: jvcli
|
3
|
+
Version: 2.0.19
|
4
|
+
Summary: CLI tool for Jivas Package Repository
|
5
|
+
Home-page: https://github.com/TrueSelph/jvcli
|
6
|
+
Author: TrueSelph Inc.
|
7
|
+
Author-email: admin@trueselph.com
|
8
|
+
Requires-Python: >=3.12
|
9
|
+
Description-Content-Type: text/markdown
|
10
|
+
License-File: LICENSE
|
11
|
+
Requires-Dist: click>=8.1.8
|
12
|
+
Requires-Dist: requests>=2.32.3
|
13
|
+
Requires-Dist: packaging>=24.2
|
14
|
+
Requires-Dist: pyaml>=25.1.0
|
15
|
+
Requires-Dist: jac-cloud==0.1.20
|
16
|
+
Requires-Dist: streamlit>=1.42.0
|
17
|
+
Requires-Dist: streamlit-elements>=0.1.0
|
18
|
+
Requires-Dist: streamlit-router>=0.1.8
|
19
|
+
Requires-Dist: streamlit-javascript>=0.1.5
|
20
|
+
Requires-Dist: python-dotenv>=1.0.0
|
21
|
+
Provides-Extra: dev
|
22
|
+
Requires-Dist: pre-commit; extra == "dev"
|
23
|
+
Requires-Dist: pytest; extra == "dev"
|
24
|
+
Requires-Dist: pytest-mock; extra == "dev"
|
25
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
26
|
+
Dynamic: author
|
27
|
+
Dynamic: author-email
|
28
|
+
Dynamic: description
|
29
|
+
Dynamic: description-content-type
|
30
|
+
Dynamic: home-page
|
31
|
+
Dynamic: license-file
|
32
|
+
Dynamic: provides-extra
|
33
|
+
Dynamic: requires-dist
|
34
|
+
Dynamic: requires-python
|
35
|
+
Dynamic: summary
|
36
|
+
|
37
|
+
# JIVAS Command Line Interface (JVCLI)
|
38
|
+
|
39
|
+

|
40
|
+

|
41
|
+

|
42
|
+

|
43
|
+

|
44
|
+
|
45
|
+
`jvcli` is a powerful command-line interface tool designed to streamline interactions with the Jivas Package Repository ([https://jpr.trueselph.com/](https://jpr.trueselph.com/)). It simplifies package management, user authentication, and namespace operations, ensuring seamless software development and deployment. It allows you to create, publish, update, download, and get information about various resources such as actions and agents.
|
46
|
+
|
47
|
+
## Installation
|
48
|
+
|
49
|
+
To install `jvcli`, use `pip`:
|
50
|
+
|
51
|
+
```sh
|
52
|
+
pip install jvcli
|
53
|
+
```
|
54
|
+
|
55
|
+
## Usage
|
56
|
+
|
57
|
+
To use `jvcli`, you need to log in first:
|
58
|
+
|
59
|
+
```sh
|
60
|
+
jvcli login
|
61
|
+
```
|
62
|
+
|
63
|
+
After logging in, you can use any of the available commands. For example, to create a new action:
|
64
|
+
|
65
|
+
```sh
|
66
|
+
jvcli create action --name my_action --version 0.0.1 --description "My first action"
|
67
|
+
```
|
68
|
+
|
69
|
+
## Command Reference
|
70
|
+
|
71
|
+
Here's a comprehensive guide to all available JVCLI commands:
|
72
|
+
|
73
|
+
### Authentication Commands
|
74
|
+
|
75
|
+
#### `jvcli login`
|
76
|
+
Login to the Jivas Package Repository.
|
77
|
+
|
78
|
+
```sh
|
79
|
+
jvcli login
|
80
|
+
```
|
81
|
+
|
82
|
+
#### `jvcli signup`
|
83
|
+
Create a new account on the Jivas Package Repository.
|
84
|
+
|
85
|
+
```sh
|
86
|
+
jvcli signup
|
87
|
+
```
|
88
|
+
|
89
|
+
#### `jvcli logout`
|
90
|
+
Log out from the Jivas Package Repository.
|
91
|
+
|
92
|
+
```sh
|
93
|
+
jvcli logout
|
94
|
+
```
|
95
|
+
|
96
|
+
### Project Management
|
97
|
+
|
98
|
+
#### `jvcli startproject`
|
99
|
+
Create a new Jivas project with scaffolding.
|
100
|
+
|
101
|
+
```sh
|
102
|
+
jvcli startproject my_project
|
103
|
+
# With specific version
|
104
|
+
jvcli startproject my_project --version 2.0.0
|
105
|
+
# Without .env file
|
106
|
+
jvcli startproject my_project --no-env
|
107
|
+
```
|
108
|
+
|
109
|
+
Options:
|
110
|
+
- `--version`: Jivas project version to use for scaffolding (default: latest)
|
111
|
+
- `--no-env`: Skip generating the .env file
|
112
|
+
|
113
|
+
#### `jvcli clean`
|
114
|
+
Clean the Jac files in the current directory and subdirectories.
|
115
|
+
|
116
|
+
```sh
|
117
|
+
jvcli clean
|
118
|
+
```
|
119
|
+
|
120
|
+
### Create Commands
|
121
|
+
|
122
|
+
#### `jvcli create action`
|
123
|
+
Create a new action with its folder structure and files.
|
124
|
+
|
125
|
+
```sh
|
126
|
+
jvcli create action --name custom_action
|
127
|
+
# With more options
|
128
|
+
jvcli create action --name custom_action --version 1.0.0 --description "A custom action" --type interact_action --path ./my_actions
|
129
|
+
```
|
130
|
+
|
131
|
+
Options:
|
132
|
+
- `--name`: Name of the action (must be snake_case)
|
133
|
+
- `--version`: Version of the action (default: 0.0.1)
|
134
|
+
- `--jivas_version`: Version of Jivas (default: latest supported)
|
135
|
+
- `--description`: Description of the action
|
136
|
+
- `--type`: Type of action (action, interact_action, vector_store_action)
|
137
|
+
- `--singleton`: Indicate if the action is singleton (default: true)
|
138
|
+
- `--path`: Directory to create the action folder in (default: ./actions)
|
139
|
+
- `--namespace`: Namespace for the action (default: from token)
|
140
|
+
|
141
|
+
#### `jvcli create agent`
|
142
|
+
Create a new agent with its folder and associated files.
|
143
|
+
|
144
|
+
```sh
|
145
|
+
jvcli create agent --name custom_agent
|
146
|
+
# With more options
|
147
|
+
jvcli create agent --name custom_agent --version 1.0.0 --description "A custom agent" --path ./my_agents
|
148
|
+
```
|
149
|
+
|
150
|
+
Options:
|
151
|
+
- `--name`: Name of the agent (must be snake_case)
|
152
|
+
- `--version`: Version of the agent (default: 0.0.1)
|
153
|
+
- `--jivas_version`: Version of Jivas (default: latest supported)
|
154
|
+
- `--description`: Description of the agent (default: "A jivas agent autocreated by the jvcli")
|
155
|
+
- `--path`: Directory to create the agent (default: ./daf)
|
156
|
+
- `--namespace`: Namespace for the agent (default: from token)
|
157
|
+
|
158
|
+
#### `jvcli create namespace`
|
159
|
+
Create a new namespace through the API.
|
160
|
+
|
161
|
+
```sh
|
162
|
+
jvcli create namespace --name my-namespace
|
163
|
+
```
|
164
|
+
|
165
|
+
Options:
|
166
|
+
- `--name`: Name of the namespace
|
167
|
+
|
168
|
+
### Publish Commands
|
169
|
+
|
170
|
+
#### `jvcli publish action`
|
171
|
+
Publish an action to the Jivas environment.
|
172
|
+
|
173
|
+
```sh
|
174
|
+
jvcli publish action --path ./actions/my_action
|
175
|
+
# With visibility option
|
176
|
+
jvcli publish action --path ./actions/my_action --visibility private
|
177
|
+
# Generate package only without publishing
|
178
|
+
jvcli publish action --path ./actions/my_action --package-only --output ./packages
|
179
|
+
```
|
180
|
+
|
181
|
+
Options:
|
182
|
+
- `--path`: Path to the directory containing the action to publish
|
183
|
+
- `--visibility`: Visibility of the published action (public/private, default: public)
|
184
|
+
- `--package-only`: Only generate the package without publishing
|
185
|
+
- `--output`, `-o`: Output path for generated package
|
186
|
+
- `--namespace`: Namespace of the package (required when --path is a tarball)
|
187
|
+
|
188
|
+
#### `jvcli publish agent`
|
189
|
+
Publish an agent to the Jivas environment.
|
190
|
+
|
191
|
+
```sh
|
192
|
+
jvcli publish agent --path ./daf/my_agent
|
193
|
+
# With visibility option
|
194
|
+
jvcli publish agent --path ./daf/my_agent --visibility private
|
195
|
+
# Generate package only without publishing
|
196
|
+
jvcli publish agent --path ./daf/my_agent --package-only --output ./packages
|
197
|
+
```
|
198
|
+
|
199
|
+
Options:
|
200
|
+
- `--path`: Path to the directory containing the agent to publish
|
201
|
+
- `--visibility`: Visibility of the published agent (public/private, default: public)
|
202
|
+
- `--package-only`: Only generate the package without publishing
|
203
|
+
- `--output`, `-o`: Output path for generated package
|
204
|
+
- `--namespace`: Namespace of the package (required when --path is a tarball)
|
205
|
+
|
206
|
+
### Download Commands
|
207
|
+
|
208
|
+
#### `jvcli download action`
|
209
|
+
Download a JIVAS action package.
|
210
|
+
|
211
|
+
```sh
|
212
|
+
jvcli download action my_namespace/custom_action
|
213
|
+
# With specific version
|
214
|
+
jvcli download action my_namespace/custom_action 1.0.0
|
215
|
+
# With custom path
|
216
|
+
jvcli download action my_namespace/custom_action --path ./my_custom_actions
|
217
|
+
```
|
218
|
+
|
219
|
+
Options:
|
220
|
+
- `name`: Name of the action to download
|
221
|
+
- `version`: Version of the action (optional, default: latest)
|
222
|
+
- `--path`: Directory to download the action (optional)
|
223
|
+
|
224
|
+
#### `jvcli download agent`
|
225
|
+
Download a JIVAS agent package.
|
226
|
+
|
227
|
+
```sh
|
228
|
+
jvcli download agent my_namespace/custom_agent
|
229
|
+
# With specific version
|
230
|
+
jvcli download agent my_namespace/custom_agent 1.0.0
|
231
|
+
# With custom path
|
232
|
+
jvcli download agent my_namespace/custom_agent --path ./my_custom_agents
|
233
|
+
```
|
234
|
+
|
235
|
+
Options:
|
236
|
+
- `name`: Name of the agent to download
|
237
|
+
- `version`: Version of the agent (optional, default: latest)
|
238
|
+
- `--path`: Directory to download the agent (optional)
|
239
|
+
|
240
|
+
### Info Commands
|
241
|
+
|
242
|
+
#### `jvcli info action`
|
243
|
+
Get information about an action package.
|
244
|
+
|
245
|
+
```sh
|
246
|
+
jvcli info action my_namespace/custom_action
|
247
|
+
# With specific version
|
248
|
+
jvcli info action my_namespace/custom_action 1.0.0
|
249
|
+
```
|
250
|
+
|
251
|
+
Options:
|
252
|
+
- `name`: Name of the action
|
253
|
+
- `version`: Version of the action (optional, default: latest)
|
254
|
+
|
255
|
+
#### `jvcli info agent`
|
256
|
+
Get information about an agent package.
|
257
|
+
|
258
|
+
```sh
|
259
|
+
jvcli info agent my_namespace/custom_agent
|
260
|
+
# With specific version
|
261
|
+
jvcli info agent my_namespace/custom_agent 1.0.0
|
262
|
+
```
|
263
|
+
|
264
|
+
Options:
|
265
|
+
- `name`: Name of the agent
|
266
|
+
- `version`: Version of the agent (optional, default: latest)
|
267
|
+
|
268
|
+
### Update Commands
|
269
|
+
|
270
|
+
#### `jvcli update namespace`
|
271
|
+
Update operations for a specified namespace.
|
272
|
+
|
273
|
+
```sh
|
274
|
+
# Invite a user to a namespace
|
275
|
+
jvcli update namespace my-namespace --invite user@example.com
|
276
|
+
# Transfer ownership of a namespace
|
277
|
+
jvcli update namespace my-namespace --transfer newowner@example.com
|
278
|
+
```
|
279
|
+
|
280
|
+
Options:
|
281
|
+
- `namespace`: Name of the namespace to update
|
282
|
+
- `--invite`: Invite a user to the namespace by their email
|
283
|
+
- `--transfer`: Transfer ownership of the namespace to a specified user by their email
|
284
|
+
|
285
|
+
### Server Commands
|
286
|
+
|
287
|
+
#### `jvcli server launch`
|
288
|
+
Launch the Jivas Server by running a JAC file.
|
289
|
+
|
290
|
+
```sh
|
291
|
+
jvcli server launch
|
292
|
+
# With custom JAC file
|
293
|
+
jvcli server launch --jac-file custom.jac
|
294
|
+
```
|
295
|
+
|
296
|
+
Options:
|
297
|
+
- `--jac-file`: Path to the JAC file to run (default: main.jac)
|
298
|
+
|
299
|
+
#### `jvcli server login`
|
300
|
+
Login to Jivas Server and get an authentication token.
|
301
|
+
|
302
|
+
```sh
|
303
|
+
jvcli server login
|
304
|
+
# With credentials
|
305
|
+
jvcli server login --email admin@example.com --password mypassword
|
306
|
+
```
|
307
|
+
|
308
|
+
Options:
|
309
|
+
- `--email`: Email address for Jivas login
|
310
|
+
- `--password`: Password for Jivas login
|
311
|
+
|
312
|
+
#### `jvcli server createadmin`
|
313
|
+
Create a system administrator account.
|
314
|
+
|
315
|
+
```sh
|
316
|
+
jvcli server createadmin
|
317
|
+
# With credentials
|
318
|
+
jvcli server createadmin --email admin@example.com --password mypassword
|
319
|
+
```
|
320
|
+
|
321
|
+
Options:
|
322
|
+
- `--email`: Email address for the system admin
|
323
|
+
- `--password`: Password for the system admin
|
324
|
+
|
325
|
+
#### `jvcli server initagents`
|
326
|
+
Initialize agents in the Jivas system.
|
327
|
+
|
328
|
+
```sh
|
329
|
+
jvcli server initagents
|
330
|
+
```
|
331
|
+
|
332
|
+
#### `jvcli server importagent`
|
333
|
+
Import an agent from a DAF package.
|
334
|
+
|
335
|
+
```sh
|
336
|
+
jvcli server importagent my_agent
|
337
|
+
# With specific version
|
338
|
+
jvcli server importagent my_agent 1.0.0
|
339
|
+
```
|
340
|
+
|
341
|
+
Options:
|
342
|
+
- `agent_name`: Name of the agent to import
|
343
|
+
- `version`: Version of the agent (optional, default: latest)
|
344
|
+
|
345
|
+
### Studio Commands
|
346
|
+
|
347
|
+
#### `jvcli studio launch`
|
348
|
+
Launch the Jivas Studio on a specified port.
|
349
|
+
|
350
|
+
```sh
|
351
|
+
jvcli studio launch
|
352
|
+
# With custom port
|
353
|
+
jvcli studio launch --port 9000
|
354
|
+
# With authentication required
|
355
|
+
jvcli studio launch --require-auth
|
356
|
+
```
|
357
|
+
|
358
|
+
Options:
|
359
|
+
- `--port`: Port for the studio to launch on (default: 8989)
|
360
|
+
- `--require-auth`: Require authentication for studio API (default: false)
|
361
|
+
|
362
|
+
### Client Commands
|
363
|
+
|
364
|
+
#### `jvcli client launch`
|
365
|
+
Launch the Jivas Client.
|
366
|
+
|
367
|
+
```sh
|
368
|
+
jvcli client launch
|
369
|
+
# With custom port
|
370
|
+
jvcli client launch --port 9001
|
371
|
+
# With custom Jivas and Studio URLs
|
372
|
+
jvcli client launch --jivas_url http://my-server:8000 --studio_url http://my-studio:8989
|
373
|
+
```
|
374
|
+
|
375
|
+
Options:
|
376
|
+
- `--port`: Port for the client to launch on (default: 8501)
|
377
|
+
- `--jivas_url`: URL for the Jivas API (default: http://localhost:8000 or JIVAS_BASE_URL env var)
|
378
|
+
- `--studio_url`: URL for the Jivas Studio (default: http://localhost:8989 or JIVAS_STUDIO_URL env var)
|
379
|
+
|
380
|
+
## 🔰 Contributing
|
381
|
+
|
382
|
+
- **🐛 [Report Issues](https://github.com/TrueSelph/jvcli/issues)**: Submit bugs found or log feature requests for the `jvcli` project.
|
383
|
+
- **💡 [Submit Pull Requests](https://github.com/TrueSelph/jvcli/blob/main/CONTRIBUTING.md)**: Review open PRs, and submit your own PRs.
|
384
|
+
|
385
|
+
<details closed>
|
386
|
+
<summary>Contributing Guidelines</summary>
|
387
|
+
|
388
|
+
1. **Fork the Repository**: Start by forking the project repository to your github account.
|
389
|
+
2. **Clone Locally**: Clone the forked repository to your local machine using a git client.
|
390
|
+
```sh
|
391
|
+
git clone https://github.com/TrueSelph/jvcli
|
392
|
+
```
|
393
|
+
3. **Create a New Branch**: Always work on a new branch, giving it a descriptive name.
|
394
|
+
```sh
|
395
|
+
git checkout -b new-feature-x
|
396
|
+
```
|
397
|
+
4. **Make Your Changes**: Develop and test your changes locally.
|
398
|
+
5. **Commit Your Changes**: Commit with a clear message describing your updates.
|
399
|
+
```sh
|
400
|
+
git commit -m 'Implemented new feature x.'
|
401
|
+
```
|
402
|
+
6. **Push to github**: Push the changes to your forked repository.
|
403
|
+
```sh
|
404
|
+
git push origin new-feature-x
|
405
|
+
```
|
406
|
+
7. **Submit a Pull Request**: Create a PR against the original project repository. Clearly describe the changes and their motivations.
|
407
|
+
8. **Review**: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
|
408
|
+
</details>
|
409
|
+
|
410
|
+
<details open>
|
411
|
+
<summary>Contributor Graph</summary>
|
412
|
+
<br>
|
413
|
+
<p align="left">
|
414
|
+
<a href="https://github.com/TrueSelph/jvcli/graphs/contributors">
|
415
|
+
<img src="https://contrib.rocks/image?repo=TrueSelph/jvcli" />
|
416
|
+
</a>
|
417
|
+
</p>
|
418
|
+
</details>
|
419
|
+
|
420
|
+
## 🎗 License
|
421
|
+
|
422
|
+
This project is protected under the Apache License 2.0. See [LICENSE](./LICENSE) for more information.
|
@@ -1,8 +1,8 @@
|
|
1
|
-
jvcli/__init__.py,sha256=
|
1
|
+
jvcli/__init__.py,sha256=fVKPAMLff8BS1NopmRtRFg7MJGigwzhOrNXO8NsVnKA,171
|
2
2
|
jvcli/api.py,sha256=gd-EP1e75e7HijyrP-EF6i_jjCo6YUeSbm1l5daKLfQ,10352
|
3
|
-
jvcli/auth.py,sha256=
|
4
|
-
jvcli/cli.py,sha256=
|
5
|
-
jvcli/utils.py,sha256=
|
3
|
+
jvcli/auth.py,sha256=mHP425hvXhNxzeX--cApkrP7SdDPmfG6V0Li5TLHmIg,1953
|
4
|
+
jvcli/cli.py,sha256=ntTkriNGtfxFAdJw5ikdq2wD43pIqDpb7lfXsCMXOWQ,1191
|
5
|
+
jvcli/utils.py,sha256=rhXStZMsW7mMp5l0p_90c7G0p1FhfVB97Cr9zN1plds,8484
|
6
6
|
jvcli/client/__init__.py,sha256=WGP05OBzZHReqENYs1qYqMnYvgAaNVW6KvGQvyB3NGs,85
|
7
7
|
jvcli/client/app.py,sha256=bjdGY9J43qymdmODt0BgzN66Aolyo1653ZuCj_gNdKA,6184
|
8
8
|
jvcli/client/lib/__init__.py,sha256=_Wv8CNIxeIle_x0U9T6w9s5mPuOY9-0u69BvTEPXLUw,38
|
@@ -16,12 +16,14 @@ jvcli/client/pages/chat_page.py,sha256=HJC2GxqFQhaCyv-3GmrxY6hPsR-i3BjaJyZfxAEwI
|
|
16
16
|
jvcli/client/pages/graph_page.py,sha256=2ZN-C9eskqICgnZhfP1zc6YOPPsGib_WZw3xHXcA63k,491
|
17
17
|
jvcli/commands/__init__.py,sha256=bjZvM55MC2NugvRlxkEU9CDDP9NnsygcsGZewj1gQcg,57
|
18
18
|
jvcli/commands/auth.py,sha256=lO5G1_TCbxhOfy7xH9EULwvCLqf7iQTF9Q3MrpAtHPY,1611
|
19
|
+
jvcli/commands/clean.py,sha256=AOyssr5MZ_EJ0wW6Q8GoWQ7ve5OGke9W82GusBFoDCg,1006
|
19
20
|
jvcli/commands/client.py,sha256=yIp0wCmoxgxImJrpl0dH9qURGMcVKTxonVd1d-BdsxI,1432
|
20
21
|
jvcli/commands/create.py,sha256=HIL01nTcyEEXk4yLMwnPsRtj_cbhsuz2AEN2BwWeI-o,13393
|
21
22
|
jvcli/commands/download.py,sha256=GiLX_43CQOW9d5vF04fAszOWh3AB-7Mgote4tJ9RVng,3416
|
22
23
|
jvcli/commands/info.py,sha256=NyIDpR_AGMMSFPE0tFZv4dIuv_gwqrfd589zQAA_Q3s,2685
|
23
24
|
jvcli/commands/publish.py,sha256=q1ihoL42GmEsU5ggHN3bcg8QD26kjRUZGfQpRzI2GMo,6630
|
24
|
-
jvcli/commands/
|
25
|
+
jvcli/commands/server.py,sha256=ODkzn4HoAlvyq52KODDhGS-Bjhvl6X7DAjnnUpMpfX0,8092
|
26
|
+
jvcli/commands/startproject.py,sha256=5qis2Dhed-HhKqZ8e37Xpy__Rmqga8cTwAOmfGVPzmU,3375
|
25
27
|
jvcli/commands/studio.py,sha256=avD5M3Ss7R6AtUMN3Mk6AmTyPJ7LnXcmwQ0mbRzivrQ,8192
|
26
28
|
jvcli/commands/update.py,sha256=LwCLg-W1b8WSdFkiiJ8WwTit2HJXTLpM5OQ4WBTe9C4,1997
|
27
29
|
jvcli/studio/index.html,sha256=LGhVhKwe1FF_9r_PAG7J2ZPrRLFTwFH3PpCN_KdA-10,474
|
@@ -44,23 +46,16 @@ jvcli/templates/2.0.0/agent_info.yaml,sha256=3olXRQDQG-543o7zSWWT23kJsK29QGhdx6-
|
|
44
46
|
jvcli/templates/2.0.0/agent_knowledge.yaml,sha256=hI0ifr0ICiZGce-oUFovBOmDWxGU1Z2M10WyZH_wS2g,284
|
45
47
|
jvcli/templates/2.0.0/agent_memory.yaml,sha256=_MBgObZcW1UzwWuYQVJiPZ_7TvYbGrDgd-xMuzJEkVo,9
|
46
48
|
jvcli/templates/2.0.0/project/README.md,sha256=cr6yHG1qEzO7xDFchEDpl8tKawVvF0tsUVTrWyxjiG4,1077
|
47
|
-
jvcli/templates/2.0.0/project/env.example,sha256
|
49
|
+
jvcli/templates/2.0.0/project/env.example,sha256=f8udeW8ElKiy_MZ-neWa3j3ctNZBMRUYXtHqJLOucXA,1301
|
48
50
|
jvcli/templates/2.0.0/project/gitignore.example,sha256=KG1wl-o8ltNs4d8qCVgok5F2waUYqCJ5-HJq58Kh79I,530
|
49
51
|
jvcli/templates/2.0.0/project/globals.jac,sha256=CEt7L25wEZfE6TupqpM1ilHbtJMQQWExDQ5GJlkHPts,56
|
50
52
|
jvcli/templates/2.0.0/project/main.jac,sha256=r37jsaGq-85YvDbHP3bQvBXk0u8w0rtRTZTNxZOjTW0,48
|
51
53
|
jvcli/templates/2.0.0/project/actions/README.md,sha256=TU1t-rOBH5WQP_HUWaEBLq5BbPv4jejtjIrwTW4hZwM,1742
|
52
54
|
jvcli/templates/2.0.0/project/daf/README.md,sha256=fO-dcc3j-1E6sFagIvvJsISAth11N-2d64G0yHi7JrY,1682
|
53
|
-
jvcli/templates/2.0.0/project/sh/exportenv.sh,sha256=keFEu6HAROE8F9cOa5FxdIb2pryd22fED66rhaAvAuU,164
|
54
|
-
jvcli/templates/2.0.0/project/sh/importagent.sh,sha256=isDMHR8ZEJEuwAAfJRc0xWhw8xHWetQNMeUqxCDOqx8,1174
|
55
|
-
jvcli/templates/2.0.0/project/sh/initagents.sh,sha256=ZTgVT37Gkw-YOgesTOIUKC1fN_6omAJRvkbGRdbvtZA,983
|
56
|
-
jvcli/templates/2.0.0/project/sh/inituser.sh,sha256=BYvLfFZdL0n7AGmjmoTQQcb236f5wG68RMeVJiUyhFQ,1893
|
57
|
-
jvcli/templates/2.0.0/project/sh/jacclean.sh,sha256=xkC7KLjvvxz5YLdDBT8Js06nr6ru_9G8kYmp_3-kXks,260
|
58
|
-
jvcli/templates/2.0.0/project/sh/serve.sh,sha256=EsXOqszYD5xa8fjAEwyYCz8mSTX-v5VfiTZeKUpOKYw,105
|
59
|
-
jvcli/templates/2.0.0/project/sh/startclient.sh,sha256=3GbJtTxycLBUJGfX2_b3cfQoAPFzhvcJpWRtS2sSsRM,119
|
60
55
|
jvcli/templates/2.0.0/project/tests/README.md,sha256=-1ZXkxuUKa6tMw_jlF3rpCvUFq8ijW2L-nSuAkbCANo,917
|
61
|
-
jvcli-2.0.
|
62
|
-
jvcli-2.0.
|
63
|
-
jvcli-2.0.
|
64
|
-
jvcli-2.0.
|
65
|
-
jvcli-2.0.
|
66
|
-
jvcli-2.0.
|
56
|
+
jvcli-2.0.19.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
57
|
+
jvcli-2.0.19.dist-info/METADATA,sha256=qVeyRWWQp6qKsJGNefRQ4jUS6lvkOEVED9KxYEHVtcc,12229
|
58
|
+
jvcli-2.0.19.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
|
59
|
+
jvcli-2.0.19.dist-info/entry_points.txt,sha256=XunGcL0LWmIMIytaUckUA27czEf8M2Y4aTOfYIpOgrQ,42
|
60
|
+
jvcli-2.0.19.dist-info/top_level.txt,sha256=akZnN9Zy1dFT93N0ms-C8ZXUn-xlhq37nO3jSRp0Y6o,6
|
61
|
+
jvcli-2.0.19.dist-info/RECORD,,
|
@@ -1,47 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
# Script to create jivas user, login, and initialize jivas graph
|
3
|
-
|
4
|
-
# Check if DAF_NAME is passed as a parameter
|
5
|
-
if [ -z "$1" ]; then
|
6
|
-
echo "Usage: $0 <DAF_NAME>"
|
7
|
-
exit 1
|
8
|
-
fi
|
9
|
-
|
10
|
-
DAF_NAME="$1"
|
11
|
-
|
12
|
-
# Export env vars
|
13
|
-
source ./sh/exportenv.sh
|
14
|
-
|
15
|
-
# Init the user token
|
16
|
-
source ./sh/inituser.sh
|
17
|
-
|
18
|
-
# Wait until JIVAS_TOKEN is set
|
19
|
-
while [ -z "$JIVAS_TOKEN" ]; do
|
20
|
-
echo "Waiting for JIVAS_TOKEN to be initialized..."
|
21
|
-
sleep 1
|
22
|
-
source ./sh/inituser.sh
|
23
|
-
done
|
24
|
-
|
25
|
-
# Check if JIVAS_TOKEN is set
|
26
|
-
if [ -n "$JIVAS_TOKEN" ]; then
|
27
|
-
|
28
|
-
echo -e "\n\nImporting agent...\n"
|
29
|
-
# Import the agent
|
30
|
-
AGENT_ID=$(curl --silent --show-error --no-progress-meter \
|
31
|
-
--request POST \
|
32
|
-
--header 'Content-Type: application/json' \
|
33
|
-
--header 'Accept: application/json' \
|
34
|
-
--header "Authorization: Bearer $JIVAS_TOKEN" \
|
35
|
-
--data "{\"daf_name\": \"$DAF_NAME\"}" \
|
36
|
-
"http://localhost:$JIVAS_PORT/walker/import_agent" | grep -o '"id":"[^"]*' | sed 's/"id":"//')
|
37
|
-
|
38
|
-
if [ -z "$AGENT_ID" ]; then
|
39
|
-
echo "Failed to import agent. Exiting..."
|
40
|
-
exit 1
|
41
|
-
fi
|
42
|
-
|
43
|
-
echo -e "Agent ID: $AGENT_ID\n"
|
44
|
-
else
|
45
|
-
echo "Failed to initialize user token. Exiting..."
|
46
|
-
exit 1
|
47
|
-
fi
|
@@ -1,37 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
# Script to authenticate and initialize jivas agents
|
3
|
-
|
4
|
-
# Export env vars
|
5
|
-
source ./sh/exportenv.sh
|
6
|
-
|
7
|
-
# perform jac clean of actions
|
8
|
-
source ./sh/jacclean.sh
|
9
|
-
|
10
|
-
# Init the user token
|
11
|
-
source ./sh/inituser.sh
|
12
|
-
|
13
|
-
# Check if JIVAS_TOKEN is set
|
14
|
-
if [ -n "$JIVAS_TOKEN" ]; then
|
15
|
-
|
16
|
-
echo -e "\n\Initializing agents...\n"
|
17
|
-
|
18
|
-
# Initialize agents and capture the response
|
19
|
-
response=$(curl --silent --show-error --no-progress-meter \
|
20
|
-
--request POST \
|
21
|
-
-H 'accept: application/json' \
|
22
|
-
-H 'Content-Type: application/json' \
|
23
|
-
-H "Authorization: Bearer $JIVAS_TOKEN" \
|
24
|
-
--data '{"reporting":"true"}' \
|
25
|
-
"http://localhost:$JIVAS_PORT/walker/init_agents")
|
26
|
-
|
27
|
-
# Parse the response to extract the list of "id"s without using jq
|
28
|
-
ids=$(echo "$response" | grep -o '"id":"[^"]*"' | sed -e 's/"id":"//g' -e 's/"//g')
|
29
|
-
|
30
|
-
# Output the list of "id"s
|
31
|
-
echo "Initialized Agents:"
|
32
|
-
echo "$ids \n"
|
33
|
-
|
34
|
-
else
|
35
|
-
echo "Failed to initialize user token. Exiting..."
|
36
|
-
exit 1
|
37
|
-
fi
|
@@ -1,50 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
# Script to init jivas user and grab token
|
3
|
-
|
4
|
-
# Check if required environment variables are set
|
5
|
-
if [ -z "$JIVAS_PORT" ] || [ -z "$JIVAS_PASSWORD" ] || [ -z "$JIVAS_USER" ]; then
|
6
|
-
echo "Required environment variables (JIVAS_PORT, JIVAS_PASSWORD, JIVAS_USER) are not set. Exiting..."
|
7
|
-
exit 1
|
8
|
-
fi
|
9
|
-
|
10
|
-
if lsof -i :$JIVAS_PORT >/dev/null || netstat -an | grep -q ":$JIVAS_PORT .*LISTEN"; then
|
11
|
-
|
12
|
-
# Try to login first
|
13
|
-
JIVAS_TOKEN=$(curl --silent --show-error --no-progress-meter \
|
14
|
-
--request POST \
|
15
|
-
--header 'Content-Type: application/json' \
|
16
|
-
--header 'Accept: application/json' \
|
17
|
-
--data '{"password": "'"$JIVAS_PASSWORD"'","email": "'"$JIVAS_USER"'"}' \
|
18
|
-
"http://localhost:$JIVAS_PORT/user/login" | grep -o '"token":"[^"]*' | sed 's/"token":"//')
|
19
|
-
|
20
|
-
# Check if login was successful
|
21
|
-
if [ -z "$JIVAS_TOKEN" ] || [ "$JIVAS_TOKEN" == "null" ]; then
|
22
|
-
echo "Login failed. Registering user..."
|
23
|
-
|
24
|
-
# Register user if login failed
|
25
|
-
curl --silent --show-error --no-progress-meter \
|
26
|
-
--request POST \
|
27
|
-
--header 'Content-Type: application/json' \
|
28
|
-
--header 'Accept: application/json' \
|
29
|
-
--data '{
|
30
|
-
"password": "'"$JIVAS_PASSWORD"'",
|
31
|
-
"email": "'"$JIVAS_USER"'"
|
32
|
-
}' \
|
33
|
-
"http://localhost:$JIVAS_PORT/user/register"
|
34
|
-
|
35
|
-
# Attempt to login again after registration
|
36
|
-
JIVAS_TOKEN=$(curl --silent --show-error --no-progress-meter \
|
37
|
-
--request POST \
|
38
|
-
--header 'Content-Type: application/json' \
|
39
|
-
--header 'Accept: application/json' \
|
40
|
-
--data '{"password": "'"$JIVAS_PASSWORD"'","email": "'"$JIVAS_USER"'"}' \
|
41
|
-
"http://localhost:$JIVAS_PORT/user/login" | grep -o '"token":"[^"]*' | sed 's/"token":"//')
|
42
|
-
fi
|
43
|
-
|
44
|
-
# Print token
|
45
|
-
echo "\n JIVAS token: $JIVAS_TOKEN"
|
46
|
-
|
47
|
-
else
|
48
|
-
echo "Server is not running on port $JIVAS_PORT. Exiting..."
|
49
|
-
exit 1
|
50
|
-
fi
|
@@ -1,11 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
# perform a jac_clean on the actions folder
|
4
|
-
# Navigate to the ./actions subdirectory and execute jac clean
|
5
|
-
if cd ./actions; then
|
6
|
-
jac clean
|
7
|
-
cd - > /dev/null
|
8
|
-
else
|
9
|
-
echo "Failed to navigate to ./actions directory. Exiting..."
|
10
|
-
exit 1
|
11
|
-
fi
|
jvcli-2.0.18.dist-info/METADATA
DELETED
@@ -1,128 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: jvcli
|
3
|
-
Version: 2.0.18
|
4
|
-
Summary: CLI tool for Jivas Package Repository
|
5
|
-
Home-page: https://github.com/TrueSelph/jvcli
|
6
|
-
Author: TrueSelph Inc.
|
7
|
-
Author-email: admin@trueselph.com
|
8
|
-
Requires-Python: >=3.12
|
9
|
-
Description-Content-Type: text/markdown
|
10
|
-
License-File: LICENSE
|
11
|
-
Requires-Dist: click>=8.1.8
|
12
|
-
Requires-Dist: requests>=2.32.3
|
13
|
-
Requires-Dist: packaging>=24.2
|
14
|
-
Requires-Dist: pyaml>=25.1.0
|
15
|
-
Requires-Dist: jac-cloud==0.1.20
|
16
|
-
Requires-Dist: streamlit>=1.42.0
|
17
|
-
Requires-Dist: streamlit-elements>=0.1.0
|
18
|
-
Requires-Dist: streamlit-router>=0.1.8
|
19
|
-
Requires-Dist: streamlit-javascript>=0.1.5
|
20
|
-
Provides-Extra: dev
|
21
|
-
Requires-Dist: pre-commit; extra == "dev"
|
22
|
-
Requires-Dist: pytest; extra == "dev"
|
23
|
-
Requires-Dist: pytest-mock; extra == "dev"
|
24
|
-
Requires-Dist: pytest-cov; extra == "dev"
|
25
|
-
Dynamic: author
|
26
|
-
Dynamic: author-email
|
27
|
-
Dynamic: description
|
28
|
-
Dynamic: description-content-type
|
29
|
-
Dynamic: home-page
|
30
|
-
Dynamic: license-file
|
31
|
-
Dynamic: provides-extra
|
32
|
-
Dynamic: requires-dist
|
33
|
-
Dynamic: requires-python
|
34
|
-
Dynamic: summary
|
35
|
-
|
36
|
-
# JIVAS Command Line Interface (JVCLI)
|
37
|
-
|
38
|
-

|
39
|
-

|
40
|
-

|
41
|
-

|
42
|
-

|
43
|
-
|
44
|
-
`jvcli` is a powerful command-line interface tool designed to streamline interactions with the Jivas Package Repository ([https://jpr.trueselph.com/](https://jpr.trueselph.com/)). It simplifies package management, user authentication, and namespace operations, ensuring seamless software development and deployment. It allows you to create, publish, update, download, and get information about various resources such as actions and agents.
|
45
|
-
|
46
|
-
## Installation
|
47
|
-
|
48
|
-
To install `jvcli`, use `pip`:
|
49
|
-
|
50
|
-
```sh
|
51
|
-
pip install jvcli
|
52
|
-
```
|
53
|
-
|
54
|
-
## Usage
|
55
|
-
|
56
|
-
To use `jvcli`, you need to log in first:
|
57
|
-
|
58
|
-
```sh
|
59
|
-
jvcli login
|
60
|
-
```
|
61
|
-
|
62
|
-
After logging in, you can use any of the available commands. For example, to create a new action:
|
63
|
-
|
64
|
-
```sh
|
65
|
-
jvcli create action --name my_action --version 0.0.1 --description "My first action"
|
66
|
-
```
|
67
|
-
|
68
|
-
To publish an action:
|
69
|
-
|
70
|
-
```sh
|
71
|
-
jvcli publish action --path ./my_action --visibility public
|
72
|
-
```
|
73
|
-
|
74
|
-
To start a new project:
|
75
|
-
|
76
|
-
```sh
|
77
|
-
jvcli startproject my_project
|
78
|
-
```
|
79
|
-
|
80
|
-
For more detailed usage, refer to the help command:
|
81
|
-
|
82
|
-
```sh
|
83
|
-
jvcli --help
|
84
|
-
```
|
85
|
-
|
86
|
-
## 🔰 Contributing
|
87
|
-
|
88
|
-
- **🐛 [Report Issues](https://github.com/TrueSelph/jvcli/issues)**: Submit bugs found or log feature requests for the `jvcli` project.
|
89
|
-
- **💡 [Submit Pull Requests](https://github.com/TrueSelph/jvcli/blob/main/CONTRIBUTING.md)**: Review open PRs, and submit your own PRs.
|
90
|
-
|
91
|
-
<details closed>
|
92
|
-
<summary>Contributing Guidelines</summary>
|
93
|
-
|
94
|
-
1. **Fork the Repository**: Start by forking the project repository to your github account.
|
95
|
-
2. **Clone Locally**: Clone the forked repository to your local machine using a git client.
|
96
|
-
```sh
|
97
|
-
git clone https://github.com/TrueSelph/jvcli
|
98
|
-
```
|
99
|
-
3. **Create a New Branch**: Always work on a new branch, giving it a descriptive name.
|
100
|
-
```sh
|
101
|
-
git checkout -b new-feature-x
|
102
|
-
```
|
103
|
-
4. **Make Your Changes**: Develop and test your changes locally.
|
104
|
-
5. **Commit Your Changes**: Commit with a clear message describing your updates.
|
105
|
-
```sh
|
106
|
-
git commit -m 'Implemented new feature x.'
|
107
|
-
```
|
108
|
-
6. **Push to github**: Push the changes to your forked repository.
|
109
|
-
```sh
|
110
|
-
git push origin new-feature-x
|
111
|
-
```
|
112
|
-
7. **Submit a Pull Request**: Create a PR against the original project repository. Clearly describe the changes and their motivations.
|
113
|
-
8. **Review**: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
|
114
|
-
</details>
|
115
|
-
|
116
|
-
<details open>
|
117
|
-
<summary>Contributor Graph</summary>
|
118
|
-
<br>
|
119
|
-
<p align="left">
|
120
|
-
<a href="https://github.com/TrueSelph/jvcli/graphs/contributors">
|
121
|
-
<img src="https://contrib.rocks/image?repo=TrueSelph/jvcli" />
|
122
|
-
</a>
|
123
|
-
</p>
|
124
|
-
</details>
|
125
|
-
|
126
|
-
## 🎗 License
|
127
|
-
|
128
|
-
This project is protected under the Apache License 2.0. See [LICENSE](./LICENSE) for more information.
|
File without changes
|
File without changes
|
File without changes
|