@driftless-sh/cli 0.1.15 → 0.1.17
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/README.md +24 -11
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,26 +11,37 @@ npm install -g @driftless-sh/cli
|
|
|
11
11
|
## Quick Start
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
driftless login --key <api-key>
|
|
15
|
-
driftless init
|
|
16
|
-
driftless scan --diff
|
|
17
|
-
driftless context get <name>
|
|
14
|
+
driftless login --key <api-key> # Generate one at driftless.icu → Settings → API keys
|
|
15
|
+
driftless init # Scan repo, upload baseline, suggest rules
|
|
16
|
+
driftless scan --diff # Check uncommitted changes against rules
|
|
17
|
+
driftless context get <name> # Load team context before coding
|
|
18
|
+
driftless install-skill # Write AGENTS.md for Claude Code / Cursor
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
Dashboard: [driftless.icu](https://driftless.icu) | API: [api.driftless.icu](https://api.driftless.icu/api/v1)
|
|
21
|
+
Dashboard: [driftless.icu](https://driftless.icu) | API: [api.driftless.icu/api/v1](https://api.driftless.icu/api/v1)
|
|
22
|
+
|
|
23
|
+
### Where to get your API key
|
|
24
|
+
|
|
25
|
+
1. Go to [driftless.icu](https://driftless.icu) → Sign in
|
|
26
|
+
2. Navigate to **Settings → API keys**
|
|
27
|
+
3. Click **Generate key**
|
|
28
|
+
4. Copy the key and run: `driftless login --key drift_xxx`
|
|
29
|
+
|
|
30
|
+
Or set the env var: `export DRIFTLESS_API_KEY=drift_xxx`
|
|
21
31
|
|
|
22
32
|
## Commands
|
|
23
33
|
|
|
24
34
|
### `driftless login`
|
|
25
35
|
|
|
26
|
-
Authenticate with Driftless Cloud.
|
|
36
|
+
Authenticate with Driftless Cloud. Generates an API key at [driftless.icu](https://driftless.icu) → Settings → API keys.
|
|
27
37
|
|
|
28
38
|
```bash
|
|
29
39
|
driftless login --key drift_xxx
|
|
30
|
-
driftless login --key drift_xxx --url https://api.driftless.icu/api/v1
|
|
31
40
|
```
|
|
32
41
|
|
|
33
|
-
Auth is stored in `~/.driftless/config.json`. You can also set `DRIFTLESS_API_KEY` as an env var.
|
|
42
|
+
Auth is stored in `~/.driftless/config.json`. You can also set `DRIFTLESS_API_KEY` as an env var instead.
|
|
43
|
+
|
|
44
|
+
**Default API URL:** `https://api.driftless.icu/api/v1` — no need to specify it unless you're running a self-hosted instance.
|
|
34
45
|
|
|
35
46
|
---
|
|
36
47
|
|
|
@@ -39,7 +50,7 @@ Auth is stored in `~/.driftless/config.json`. You can also set `DRIFTLESS_API_KE
|
|
|
39
50
|
Full repo initialization. Runs a 3-pass scan:
|
|
40
51
|
|
|
41
52
|
1. **Identity** — detects framework, system type, auth patterns (zero tokens)
|
|
42
|
-
2. **AST extraction** — extracts endpoints, guards, services, modules, and their relations (zero tokens)
|
|
53
|
+
2. **AST extraction** — extracts endpoints, guards, services, modules, DTOs with fields + validations, and their relations (zero tokens)
|
|
43
54
|
3. **Upload** — sends baseline + components + relations to Cloud
|
|
44
55
|
|
|
45
56
|
```bash
|
|
@@ -224,12 +235,14 @@ All output is JSON by default, making it easy for agents to parse and use as con
|
|
|
224
235
|
|
|
225
236
|
## Architecture
|
|
226
237
|
|
|
227
|
-
The CLI is bundled with esbuild into a single distributable binary. The `@driftless/scanner` lib (
|
|
238
|
+
The CLI is bundled with esbuild into a single distributable binary. The `@driftless/scanner` lib (TypeScript Compiler API parser) is bundled inside the CLI at build time. This avoids publishing the scanner as a separate npm package and keeps `workspace:*` deps internal.
|
|
239
|
+
|
|
240
|
+
The scanner uses `ts.createSourceFile()` per file — no global Project, no LanguageService, no OOM risk. ~300ms, ~35MB for 260 files. Detects controllers, endpoints, guards, services, modules, DTOs with fields + validations, and builds a dependency graph from imports.
|
|
228
241
|
|
|
229
242
|
```
|
|
230
243
|
driftless init
|
|
231
244
|
├── Pass 1: Identity (package.json, tsconfig, folder structure)
|
|
232
|
-
├── Pass 2: AST extraction (
|
|
245
|
+
├── Pass 2: AST extraction (TypeScript Compiler API → endpoints, guards, services, DTOs, relations)
|
|
233
246
|
└── Pass 3: Upload to Cloud (baseline + components + relations)
|
|
234
247
|
|
|
235
248
|
driftless scan
|
package/dist/index.js
CHANGED
|
@@ -215722,7 +215722,7 @@ function pad2(s, n) {
|
|
|
215722
215722
|
}
|
|
215723
215723
|
|
|
215724
215724
|
// src/index.ts
|
|
215725
|
-
var VERSION = "0.1.
|
|
215725
|
+
var VERSION = "0.1.16";
|
|
215726
215726
|
var HELP_TEXT = `Driftless CLI v${VERSION} \u2014 Context integrity for AI engineering teams
|
|
215727
215727
|
|
|
215728
215728
|
Install: npm install -g @driftless-sh/cli
|