@taskless/cli 0.0.2 → 0.0.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.
Files changed (3) hide show
  1. package/README.md +79 -2
  2. package/dist/index.js +5825 -424
  3. package/package.json +7 -5
package/README.md CHANGED
@@ -18,10 +18,51 @@ pnpm dlx @taskless/cli@latest info
18
18
 
19
19
  ### `taskless info`
20
20
 
21
- Outputs CLI version as JSON to stdout:
21
+ Outputs CLI version, tool status, and login info as JSON to stdout:
22
22
 
23
23
  ```json
24
- { "version": "0.0.1" }
24
+ {
25
+ "version": "0.0.3",
26
+ "tools": [],
27
+ "loggedIn": true,
28
+ "auth": { "user": "jake", "email": "jake@example.com", "orgs": ["my-org"] }
29
+ }
30
+ ```
31
+
32
+ ### `taskless init`
33
+
34
+ Install or update Taskless skills into detected tool directories (e.g. `.claude/`).
35
+
36
+ ### `taskless check`
37
+
38
+ Run ast-grep rules from `.taskless/rules/` against the codebase. Exits with code 1 if any error-severity matches are found.
39
+
40
+ ```bash
41
+ taskless check # human-readable output
42
+ taskless check --json # JSONL output
43
+ ```
44
+
45
+ ### `taskless auth login` / `taskless auth logout`
46
+
47
+ Authenticate with taskless.io using the device flow. Tokens are stored in `~/.config/taskless/auth.json`.
48
+
49
+ ### `taskless rules create`
50
+
51
+ Generate ast-grep rules via the taskless.io API. Reads a JSON request from stdin, submits it, polls for results, and writes rule and test files to `.taskless/rules/` and `.taskless/rule-tests/`.
52
+
53
+ ```bash
54
+ echo '{"prompt": "detect console.log usage"}' | taskless rules create
55
+ echo '{"prompt": "find innerHTML assignments", "language": "typescript"}' | taskless rules create --json
56
+ ```
57
+
58
+ Requires authentication and a `.taskless/taskless.json` with `orgId` and `repositoryUrl`.
59
+
60
+ ### `taskless rules delete <id>`
61
+
62
+ Remove a rule file and its associated test files from disk. No authentication required.
63
+
64
+ ```bash
65
+ taskless rules delete no-console-log
25
66
  ```
26
67
 
27
68
  ### `taskless --help`
@@ -36,3 +77,39 @@ Skills should detect the package manager by checking for lock files and invoke t
36
77
  2. Otherwise, use `npx @taskless/cli@latest <command>`
37
78
 
38
79
  All commands output structured JSON to stdout by default. Parse with `JSON.parse()` and handle non-zero exit codes as errors.
80
+
81
+ ## Developing
82
+
83
+ ### API base URL
84
+
85
+ The CLI resolves the API base URL in this order:
86
+
87
+ 1. `TASKLESS_API_URL` env var
88
+ 2. `~/.config/taskless/config.json` → `apiUrl` field
89
+ 3. Default: `https://app.taskless.io/cli`
90
+
91
+ For local development against the taskless.io app:
92
+
93
+ ```bash
94
+ TASKLESS_API_URL=http://localhost:5173/cli taskless info
95
+ ```
96
+
97
+ ### API schema introspection
98
+
99
+ All `/cli/api/*` endpoints support the `x-explain: 1` header. When present, the endpoint returns its JSON schema instead of executing — no authentication required.
100
+
101
+ ```bash
102
+ # List available endpoints
103
+ curl -s -H "x-explain: 1" http://localhost:5173/cli/api
104
+
105
+ # Get the schema for rule generation
106
+ curl -s -H "x-explain: 1" -X POST http://localhost:5173/cli/api/rule
107
+
108
+ # Get the schema for rule status polling
109
+ curl -s -H "x-explain: 1" http://localhost:5173/cli/api/rule/any-id
110
+
111
+ # Get the schema for whoami
112
+ curl -s -H "x-explain: 1" http://localhost:5173/cli/api/whoami
113
+ ```
114
+
115
+ This is useful for verifying that CLI types align with the production API contract.