conduct-cli 0.2.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.
@@ -0,0 +1,108 @@
1
+ Metadata-Version: 2.4
2
+ Name: conduct-cli
3
+ Version: 0.2.0
4
+ Summary: CLI for Conduct AI — install agents, manage projects, run tests
5
+ Author-email: Conduct AI <hello@conductai.ai>
6
+ License: MIT
7
+ Project-URL: Homepage, https://conductai.ai
8
+ Project-URL: Repository, https://github.com/sseshachala/conductai
9
+ Project-URL: Bug Tracker, https://github.com/sseshachala/conductai/issues
10
+ Keywords: ai,agents,automation,devops,cli
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: pyyaml>=6.0
24
+
25
+ # conduct-cli
26
+
27
+ Official CLI for [Conduct AI](https://conductai.ai) — install AI agents, manage projects, and run end-to-end tests from the terminal.
28
+
29
+ ## Install
30
+
31
+ ```bash
32
+ pip install conduct-cli
33
+ ```
34
+
35
+ ## Quick start
36
+
37
+ ```bash
38
+ # Authenticate (one-time)
39
+ conduct login \
40
+ --server https://api.conductai.ai \
41
+ --api-key cond_live_xxx \
42
+ --workspace <workspace-id>
43
+
44
+ # Browse available agents
45
+ conduct playbooks
46
+
47
+ # Create a project and install all agents in one shot
48
+ conduct install-all --project DevOps --repo owner/repo
49
+
50
+ # List installed agents
51
+ conduct agents
52
+
53
+ # Run a test trigger on any agent
54
+ conduct test "PR Reviewer"
55
+ conduct test --all
56
+ ```
57
+
58
+ ## Commands
59
+
60
+ | Command | Description |
61
+ |---------|-------------|
62
+ | `conduct login` | Save connection config to `~/.conduct/config.json` |
63
+ | `conduct projects` | List all projects |
64
+ | `conduct create project <name>` | Create a project |
65
+ | `conduct delete project <name>` | Delete a project and all its agents |
66
+ | `conduct reset project <name>` | Delete all agents in a project (clean slate) |
67
+ | `conduct playbooks` | Browse available playbooks |
68
+ | `conduct playbooks <slug>` | Show required inputs for a playbook |
69
+ | `conduct install <slug>` | Install one agent from a playbook |
70
+ | `conduct install-all` | Install all 12 playbooks into a project |
71
+ | `conduct agents` | List all installed agents |
72
+ | `conduct test <name>` | Fire test trigger on an agent and stream results |
73
+ | `conduct test --all` | Test every playbook-based agent |
74
+
75
+ ## Authentication
76
+
77
+ Generate an API key from **Settings → API Keys** in the Conduct AI dashboard. Keys start with `cond_live_` and are stored as SHA-256 hashes — the plaintext is shown only once.
78
+
79
+ ```bash
80
+ conduct login --server https://api.conductai.ai --api-key cond_live_xxx --workspace <id>
81
+ ```
82
+
83
+ ## Install all agents
84
+
85
+ ```bash
86
+ # Installs all 12 playbooks into a project, pointed at your GitHub repo
87
+ conduct install-all --project DevOps --repo myorg/myrepo
88
+ ```
89
+
90
+ If the project doesn't exist it's created automatically. Use `--input key=value` to override any playbook input.
91
+
92
+ ## Test agents
93
+
94
+ ```bash
95
+ # Test a single agent (fires synthetic test payload, streams run events)
96
+ conduct test "Autopilot Quick"
97
+
98
+ # Test all playbook-based agents in sequence
99
+ conduct test --all
100
+ ```
101
+
102
+ Exit code is `0` if all pass, `1` if any fail — works in CI.
103
+
104
+ ## Links
105
+
106
+ - Dashboard: [conductai.ai](https://conductai.ai)
107
+ - Docs: [conductai.ai/docs](https://conductai.ai/docs)
108
+ - Issues: [github.com/sseshachala/conductai/issues](https://github.com/sseshachala/conductai/issues)
@@ -0,0 +1,84 @@
1
+ # conduct-cli
2
+
3
+ Official CLI for [Conduct AI](https://conductai.ai) — install AI agents, manage projects, and run end-to-end tests from the terminal.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pip install conduct-cli
9
+ ```
10
+
11
+ ## Quick start
12
+
13
+ ```bash
14
+ # Authenticate (one-time)
15
+ conduct login \
16
+ --server https://api.conductai.ai \
17
+ --api-key cond_live_xxx \
18
+ --workspace <workspace-id>
19
+
20
+ # Browse available agents
21
+ conduct playbooks
22
+
23
+ # Create a project and install all agents in one shot
24
+ conduct install-all --project DevOps --repo owner/repo
25
+
26
+ # List installed agents
27
+ conduct agents
28
+
29
+ # Run a test trigger on any agent
30
+ conduct test "PR Reviewer"
31
+ conduct test --all
32
+ ```
33
+
34
+ ## Commands
35
+
36
+ | Command | Description |
37
+ |---------|-------------|
38
+ | `conduct login` | Save connection config to `~/.conduct/config.json` |
39
+ | `conduct projects` | List all projects |
40
+ | `conduct create project <name>` | Create a project |
41
+ | `conduct delete project <name>` | Delete a project and all its agents |
42
+ | `conduct reset project <name>` | Delete all agents in a project (clean slate) |
43
+ | `conduct playbooks` | Browse available playbooks |
44
+ | `conduct playbooks <slug>` | Show required inputs for a playbook |
45
+ | `conduct install <slug>` | Install one agent from a playbook |
46
+ | `conduct install-all` | Install all 12 playbooks into a project |
47
+ | `conduct agents` | List all installed agents |
48
+ | `conduct test <name>` | Fire test trigger on an agent and stream results |
49
+ | `conduct test --all` | Test every playbook-based agent |
50
+
51
+ ## Authentication
52
+
53
+ Generate an API key from **Settings → API Keys** in the Conduct AI dashboard. Keys start with `cond_live_` and are stored as SHA-256 hashes — the plaintext is shown only once.
54
+
55
+ ```bash
56
+ conduct login --server https://api.conductai.ai --api-key cond_live_xxx --workspace <id>
57
+ ```
58
+
59
+ ## Install all agents
60
+
61
+ ```bash
62
+ # Installs all 12 playbooks into a project, pointed at your GitHub repo
63
+ conduct install-all --project DevOps --repo myorg/myrepo
64
+ ```
65
+
66
+ If the project doesn't exist it's created automatically. Use `--input key=value` to override any playbook input.
67
+
68
+ ## Test agents
69
+
70
+ ```bash
71
+ # Test a single agent (fires synthetic test payload, streams run events)
72
+ conduct test "Autopilot Quick"
73
+
74
+ # Test all playbook-based agents in sequence
75
+ conduct test --all
76
+ ```
77
+
78
+ Exit code is `0` if all pass, `1` if any fail — works in CI.
79
+
80
+ ## Links
81
+
82
+ - Dashboard: [conductai.ai](https://conductai.ai)
83
+ - Docs: [conductai.ai/docs](https://conductai.ai/docs)
84
+ - Issues: [github.com/sseshachala/conductai/issues](https://github.com/sseshachala/conductai/issues)
@@ -0,0 +1,37 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "conduct-cli"
7
+ version = "0.2.0"
8
+ description = "CLI for Conduct AI — install agents, manage projects, run tests"
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ requires-python = ">=3.9"
12
+ authors = [{ name = "Conduct AI", email = "hello@conductai.ai" }]
13
+ keywords = ["ai", "agents", "automation", "devops", "cli"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Environment :: Console",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.9",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Topic :: Software Development :: Libraries :: Application Frameworks",
25
+ ]
26
+ dependencies = ["pyyaml>=6.0"]
27
+
28
+ [project.urls]
29
+ Homepage = "https://conductai.ai"
30
+ Repository = "https://github.com/sseshachala/conductai"
31
+ "Bug Tracker" = "https://github.com/sseshachala/conductai/issues"
32
+
33
+ [project.scripts]
34
+ conduct = "conduct_cli.main:main"
35
+
36
+ [tool.setuptools.packages.find]
37
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,2 @@
1
+ from setuptools import setup
2
+ setup()
File without changes
@@ -0,0 +1,100 @@
1
+ import json
2
+ import socket
3
+ import sys
4
+ import urllib.request
5
+ import urllib.error
6
+
7
+ RED = "\033[31m"
8
+ RESET = "\033[0m"
9
+ DEV_WORKSPACE = "00000000-0000-0000-0000-000000000001"
10
+
11
+
12
+ def headers(workspace_id: str, token=None, content_type="application/json", api_key=None) -> dict:
13
+ h = {"Content-Type": content_type, "X-Workspace-Id": workspace_id}
14
+ if api_key:
15
+ h["X-Api-Key"] = api_key
16
+ elif token:
17
+ h["Authorization"] = f"Bearer {token}"
18
+ return h
19
+
20
+
21
+ def req(method: str, url: str, hdrs: dict, body=None, timeout: int = 30) -> dict:
22
+ data = json.dumps(body).encode() if body is not None else None
23
+ r = urllib.request.Request(url, data=data, headers=hdrs, method=method)
24
+ try:
25
+ with urllib.request.urlopen(r, timeout=timeout) as resp:
26
+ raw = resp.read()
27
+ return json.loads(raw) if raw else {}
28
+ except urllib.error.HTTPError as e:
29
+ raw = e.read().decode()
30
+ try:
31
+ detail = json.loads(raw).get("detail", raw)
32
+ except Exception:
33
+ detail = raw
34
+ print(f"{RED}HTTP {e.code}: {detail}{RESET}")
35
+ sys.exit(1)
36
+ except (socket.timeout, TimeoutError):
37
+ print(f"{RED}Request timed out: {url}{RESET}")
38
+ sys.exit(1)
39
+
40
+
41
+ def req_text(method: str, url: str, hdrs: dict, body_text: str, timeout: int = 30) -> dict:
42
+ r = urllib.request.Request(url, data=body_text.encode(), headers=hdrs, method=method)
43
+ try:
44
+ with urllib.request.urlopen(r, timeout=timeout) as resp:
45
+ raw = resp.read()
46
+ return json.loads(raw) if raw else {}
47
+ except urllib.error.HTTPError as e:
48
+ raw = e.read().decode()
49
+ try:
50
+ detail = json.loads(raw).get("detail", raw)
51
+ except Exception:
52
+ detail = raw
53
+ print(f"{RED}HTTP {e.code}: {detail}{RESET}")
54
+ sys.exit(1)
55
+ except (socket.timeout, TimeoutError):
56
+ print(f"{RED}Request timed out: {url}{RESET}")
57
+ sys.exit(1)
58
+
59
+
60
+ def stream(url: str, hdrs=None):
61
+ """Yield parsed SSE data dicts."""
62
+ r = urllib.request.Request(url, headers=hdrs or {})
63
+ try:
64
+ resp = urllib.request.urlopen(r)
65
+ except urllib.error.HTTPError as e:
66
+ msg = e.read().decode()
67
+ raise RuntimeError(f"Stream {e.code}: {msg}")
68
+
69
+ buf = b""
70
+ while True:
71
+ chunk = resp.read(1)
72
+ if not chunk:
73
+ break
74
+ buf += chunk
75
+ if buf.endswith(b"\n\n"):
76
+ text = buf.decode().strip()
77
+ buf = b""
78
+ event = "message"
79
+ for line in text.splitlines():
80
+ if line.startswith("event:"):
81
+ event = line[6:].strip()
82
+ elif line.startswith("data:"):
83
+ try:
84
+ data = json.loads(line[5:].strip())
85
+ except json.JSONDecodeError:
86
+ data = {"raw": line[5:].strip()}
87
+ data.setdefault("kind", event)
88
+ yield data
89
+ event = "message"
90
+
91
+
92
+ def find_or_create_workflow(server: str, name: str, hdrs: dict) -> str:
93
+ for wf in req("GET", f"{server}/workflows", hdrs):
94
+ if wf["name"] == name:
95
+ return wf["id"]
96
+ wf = req("POST", f"{server}/workflows", hdrs, {
97
+ "name": name,
98
+ "graph": {"nodes": [], "edges": []},
99
+ })
100
+ return wf["id"]