@thierryteisseire/leadgenius-skill 1.1.3 → 1.1.4
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.
- package/SKILL.md +12 -14
- package/package.json +2 -2
- package/scripts/api_call.py +3 -2
- package/scripts/auth.py +1 -1
- package/scripts/lgp.py +11 -2
package/SKILL.md
CHANGED
|
@@ -56,10 +56,20 @@ The API uses separate root paths depending on the operation scope. Standard agen
|
|
|
56
56
|
The primary way to interact with LeadGenius is via the `lgp` CLI tool.
|
|
57
57
|
|
|
58
58
|
#### 1. Setup & Auth
|
|
59
|
+
Authentication is a two-step process:
|
|
60
|
+
1. **Login**: Authenticate with your email and password to get a temporary session.
|
|
61
|
+
2. **Generate Key**: Create a long-lived API Key (`lgp_...`) for your scripts/agent.
|
|
62
|
+
|
|
59
63
|
```bash
|
|
64
|
+
# 1. Login to get session (email/password)
|
|
60
65
|
python3 scripts/lgp.py auth --email your@email.com
|
|
66
|
+
|
|
67
|
+
# 2. Generate an API Key (this will be automatically saved)
|
|
68
|
+
python3 scripts/lgp.py generate-key --name "Production Agent"
|
|
61
69
|
```
|
|
62
70
|
|
|
71
|
+
Once generated, the key is saved to `~/.leadgenius_auth.json` and will be automatically used by the CLI. You can also explicitly set it via `LGP_API_KEY` environment variable.
|
|
72
|
+
|
|
63
73
|
#### 2. Manage Leads
|
|
64
74
|
```bash
|
|
65
75
|
# List leads
|
|
@@ -98,13 +108,7 @@ python3 scripts/lgp.py maintenance enhancements list
|
|
|
98
108
|
python3 scripts/lgp.py maintenance enhancements request --desc "Add support for Google Maps leads"
|
|
99
109
|
```
|
|
100
110
|
|
|
101
|
-
#### 6.
|
|
102
|
-
```bash
|
|
103
|
-
# Generate a new API Key (Requires active session)
|
|
104
|
-
python3 scripts/lgp.py generate-key --name "Production Agent" --desc "Key for main auto-agent"
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
#### 7. Global Administration (Admin Only)
|
|
111
|
+
#### 6. Global Administration (Admin Only)
|
|
108
112
|
```bash
|
|
109
113
|
# View system-wide data
|
|
110
114
|
python3 scripts/lgp.py admin companies
|
|
@@ -143,13 +147,7 @@ python3 scripts/lgp.py admin users
|
|
|
143
147
|
}
|
|
144
148
|
```
|
|
145
149
|
|
|
146
|
-
|
|
147
|
-
To test your connection:
|
|
148
|
-
1. Set your API Key: `export LGP_API_KEY=lgp_your_key`
|
|
149
|
-
2. Fetch campaigns:
|
|
150
|
-
```bash
|
|
151
|
-
python3 scripts/api_call.py GET /campaigns
|
|
152
|
-
```
|
|
150
|
+
|
|
153
151
|
|
|
154
152
|
|
|
155
153
|
## Data Architecture & Logic
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thierryteisseire/leadgenius-skill",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "LeadGenius Pro Agent API Skill for AI agents",
|
|
5
5
|
"main": "SKILL.md",
|
|
6
6
|
"repository": {
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
"LICENSE.txt",
|
|
28
28
|
"README.md"
|
|
29
29
|
]
|
|
30
|
-
}
|
|
30
|
+
}
|
package/scripts/api_call.py
CHANGED
|
@@ -10,7 +10,7 @@ def main():
|
|
|
10
10
|
parser.add_argument("method", choices=["GET", "POST", "PUT", "DELETE"], help="HTTP method")
|
|
11
11
|
parser.add_argument("endpoint", help="API endpoint (e.g., /leads)")
|
|
12
12
|
parser.add_argument("--data", help="JSON data for POST/PUT requests")
|
|
13
|
-
parser.add_argument("--base-url", default="
|
|
13
|
+
parser.add_argument("--base-url", default="https://last.leadgenius.app/api/agent", help="Base URL")
|
|
14
14
|
parser.add_argument("--key", help="API Key (defaults to LGP_API_KEY env var)")
|
|
15
15
|
|
|
16
16
|
args = parser.parse_args()
|
|
@@ -27,7 +27,8 @@ def main():
|
|
|
27
27
|
try:
|
|
28
28
|
with open(auth_file, "r") as f:
|
|
29
29
|
auth_data = json.load(f)
|
|
30
|
-
|
|
30
|
+
# Prioritize API Key, then fall back to token (JWT)
|
|
31
|
+
api_key = auth_data.get("api_key") or auth_data.get("token")
|
|
31
32
|
if api_key:
|
|
32
33
|
print(f"Using saved credentials for {auth_data.get('email', 'unknown user')}")
|
|
33
34
|
except Exception as e:
|
package/scripts/auth.py
CHANGED
package/scripts/lgp.py
CHANGED
|
@@ -7,12 +7,21 @@ import sys
|
|
|
7
7
|
from getpass import getpass
|
|
8
8
|
from datetime import datetime
|
|
9
9
|
|
|
10
|
-
DEFAULT_BASE_URL = "
|
|
10
|
+
DEFAULT_BASE_URL = "https://last.leadgenius.app"
|
|
11
11
|
AUTH_FILE = os.path.expanduser("~/.leadgenius_auth.json")
|
|
12
12
|
|
|
13
13
|
class LeadGeniusCLI:
|
|
14
14
|
def __init__(self, base_url=None):
|
|
15
|
-
|
|
15
|
+
auth_base_url = None
|
|
16
|
+
if os.path.exists(AUTH_FILE):
|
|
17
|
+
try:
|
|
18
|
+
with open(AUTH_FILE, "r") as f:
|
|
19
|
+
data = json.load(f)
|
|
20
|
+
auth_base_url = data.get("base_url")
|
|
21
|
+
except:
|
|
22
|
+
pass
|
|
23
|
+
|
|
24
|
+
self.base_url = (base_url or auth_base_url or DEFAULT_BASE_URL).rstrip('/')
|
|
16
25
|
self.token = self._load_token()
|
|
17
26
|
|
|
18
27
|
def _load_token(self):
|