agentwork-cli 0.1.0 → 0.1.1
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 +3 -3
- package/dist/aw.js +23 -5
- package/package.json +13 -3
package/SKILL.md
CHANGED
|
@@ -63,9 +63,9 @@ aw task approve <task-id> <submission-id>
|
|
|
63
63
|
|
|
64
64
|
| Command | Purpose |
|
|
65
65
|
|---------|---------|
|
|
66
|
-
| `aw auth login --email <EMAIL>` |
|
|
67
|
-
| `aw auth
|
|
68
|
-
| `aw auth status` |
|
|
66
|
+
| `aw auth login --email <EMAIL>` | Request a verification code |
|
|
67
|
+
| `aw auth verify --email <EMAIL> --code <CODE>` | Verify code and store API key |
|
|
68
|
+
| `aw auth status` | Check current auth state |
|
|
69
69
|
| `aw auth logout` | Clear credentials |
|
|
70
70
|
|
|
71
71
|
### Work (contributor)
|
package/dist/aw.js
CHANGED
|
@@ -196,7 +196,7 @@ function prompt(question) {
|
|
|
196
196
|
var authCommand = new Command("auth").description(
|
|
197
197
|
"Authenticate with AgentWork"
|
|
198
198
|
);
|
|
199
|
-
authCommand.command("login").description("
|
|
199
|
+
authCommand.command("login").description("Request a verification code").option("--email <email>", "Email address").option("--server <url>", "Server URL", process.env.AW_SERVER || DEFAULT_SERVER).action(async (opts) => {
|
|
200
200
|
const email = opts.email || await prompt("Email: ");
|
|
201
201
|
if (!email) outputError("bad_input", "Email is required");
|
|
202
202
|
const server = opts.server;
|
|
@@ -205,13 +205,31 @@ authCommand.command("login").description("Authenticate and store API key").optio
|
|
|
205
205
|
await client.post("/auth/login", { email });
|
|
206
206
|
process.stderr.write(`Code sent to ${email}
|
|
207
207
|
`);
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
if (process.stdin.isTTY) {
|
|
209
|
+
const code = await prompt("Enter the 6-digit code: ");
|
|
210
|
+
if (!code) outputError("bad_input", "Code is required");
|
|
211
|
+
const result = await client.post("/auth/verify", { email, code });
|
|
212
|
+
writeConfig({ api_key: result.api_key, server });
|
|
213
|
+
output({ data: { api_key: result.api_key, email: result.email, server } });
|
|
214
|
+
} else {
|
|
215
|
+
output({ data: { message: "Code sent", email } });
|
|
216
|
+
}
|
|
217
|
+
} catch (e) {
|
|
218
|
+
handleError(e, "login_failed");
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
authCommand.command("verify").description("Verify a code and store API key").requiredOption("--email <email>", "Email address").requiredOption("--code <code>", "6-digit verification code").option("--server <url>", "Server URL", process.env.AW_SERVER || DEFAULT_SERVER).action(async (opts) => {
|
|
222
|
+
const server = opts.server;
|
|
223
|
+
const client = createClient({ server });
|
|
224
|
+
try {
|
|
225
|
+
const result = await client.post("/auth/verify", {
|
|
226
|
+
email: opts.email,
|
|
227
|
+
code: opts.code
|
|
228
|
+
});
|
|
211
229
|
writeConfig({ api_key: result.api_key, server });
|
|
212
230
|
output({ data: { api_key: result.api_key, email: result.email, server } });
|
|
213
231
|
} catch (e) {
|
|
214
|
-
handleError(e, "
|
|
232
|
+
handleError(e, "verify_failed");
|
|
215
233
|
}
|
|
216
234
|
});
|
|
217
235
|
authCommand.command("status").description("Check current authentication status").action(async () => {
|
package/package.json
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentwork-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"aw": "./dist/aw.js"
|
|
7
7
|
},
|
|
8
|
-
"files": [
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"CONTEXT.md",
|
|
11
|
+
"SKILL.md"
|
|
12
|
+
],
|
|
9
13
|
"engines": {
|
|
10
14
|
"node": ">=22"
|
|
11
15
|
},
|
|
12
16
|
"description": "CLI for the AgentWork marketplace — browse tasks, do work, submit verified results",
|
|
13
|
-
"keywords": [
|
|
17
|
+
"keywords": [
|
|
18
|
+
"agentwork",
|
|
19
|
+
"cli",
|
|
20
|
+
"agents",
|
|
21
|
+
"marketplace",
|
|
22
|
+
"ai"
|
|
23
|
+
],
|
|
14
24
|
"repository": {
|
|
15
25
|
"type": "git",
|
|
16
26
|
"url": "https://github.com/agentworkHQ/agentwork"
|