@appilots/cli 0.1.0
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/LICENSE +21 -0
- package/README.md +96 -0
- package/dist/cli/index.js +4178 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.mts +891 -0
- package/dist/index.d.ts +891 -0
- package/dist/index.js +3109 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3070 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Appilots Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# appilots
|
|
2
|
+
|
|
3
|
+
CLI that analyzes your React Native project and syncs its structure (screens, navigation, forms, actions) with the Appilots platform — enabling AI agents to understand and operate your app.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Global (recommended)
|
|
9
|
+
npm install -g @appilots/cli
|
|
10
|
+
|
|
11
|
+
# Or run directly with npx
|
|
12
|
+
npx appilots init --api-key ak_xxx
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
appilots init --api-key ak_xxx # configure project (saves .appilotsrc)
|
|
19
|
+
appilots sync # analyze code + upload to Appilots
|
|
20
|
+
appilots watch # re-sync automatically on file changes
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## All commands
|
|
24
|
+
|
|
25
|
+
| Command | Description |
|
|
26
|
+
|---------|-------------|
|
|
27
|
+
| `appilots init --api-key <key>` | Configure project, validate credentials, create `.appilotsrc` |
|
|
28
|
+
| `appilots sync` | Analyze source, generate context document, upload to Appilots |
|
|
29
|
+
| `appilots sync --force` | Force upload even if nothing changed |
|
|
30
|
+
| `appilots watch` | Watch for file changes and auto-sync |
|
|
31
|
+
| `appilots generate` | Generate context document locally (no upload) |
|
|
32
|
+
| `appilots status` | Show local config and remote project status |
|
|
33
|
+
|
|
34
|
+
## Configuration (`.appilotsrc`)
|
|
35
|
+
|
|
36
|
+
Created by `appilots init`. Supports these fields:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"apiKey": "ak_xxx",
|
|
41
|
+
"projectId": "proj_xxx",
|
|
42
|
+
"serverUrl": "http://localhost:4000",
|
|
43
|
+
"outputDir": ".appilots",
|
|
44
|
+
"autoActivate": true,
|
|
45
|
+
"strictScreens": false,
|
|
46
|
+
"screenPatterns": ["**/*Screen.{ts,tsx}", "**/screens/**/*.{ts,tsx}"],
|
|
47
|
+
"include": ["src/**/*.{ts,tsx}"],
|
|
48
|
+
"exclude": ["**/__tests__/**"],
|
|
49
|
+
"navigationInclude": ["**/routing/**/*.{ts,tsx}"],
|
|
50
|
+
"navigationExclude": []
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**`strictScreens`** — defaults to `true`. Only files that call `registerScreen()` or match `screenPatterns` are included as screens. This keeps components, hooks, config files, and utilities out of the agent's screen map.
|
|
55
|
+
|
|
56
|
+
> **⚠️ `.appilotsrc` contains your API key — never commit it.** `appilots init` adds it to your `.gitignore` automatically when one exists; double-check if you manage ignores elsewhere.
|
|
57
|
+
|
|
58
|
+
## Environment variables (CI/CD)
|
|
59
|
+
|
|
60
|
+
All commands accept configuration via environment variables, so CI pipelines can run without a `.appilotsrc`:
|
|
61
|
+
|
|
62
|
+
| Variable | Overrides |
|
|
63
|
+
|----------|-----------|
|
|
64
|
+
| `APPILOTS_API_KEY` | `apiKey` |
|
|
65
|
+
| `APPILOTS_PROJECT_ID` | `projectId` |
|
|
66
|
+
| `APPILOTS_SERVER_URL` | `serverUrl` |
|
|
67
|
+
|
|
68
|
+
Precedence: command-line flags > environment variables > `.appilotsrc`.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# CI example — no .appilotsrc needed
|
|
72
|
+
APPILOTS_API_KEY=ak_xxx appilots sync
|
|
73
|
+
# or with flags
|
|
74
|
+
appilots sync --api-key ak_xxx --server https://api.appilots.com
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## How it works
|
|
78
|
+
|
|
79
|
+
1. Babel AST analysis extracts screens, navigation graph, forms, and actions from your React Native source
|
|
80
|
+
2. `registerScreen()` calls (from `@appilots/sdk`) are the primary metadata source; JSX analysis enriches anything not declared
|
|
81
|
+
3. A context document (JSON) is generated with a SHA-256 checksum
|
|
82
|
+
4. On `sync`, the document is uploaded to Appilots only if the checksum changed (skip with `--force`)
|
|
83
|
+
5. The Appilots backend uses this document to give AI agents full awareness of your app structure
|
|
84
|
+
|
|
85
|
+
## Recommended project structure
|
|
86
|
+
|
|
87
|
+
The CLI works best with these conventions (but is configurable via `.appilotsrc`):
|
|
88
|
+
|
|
89
|
+
- Screens in `src/screens/` or files named `*Screen.tsx`
|
|
90
|
+
- Navigation in `src/navigation/` or files named `navigator*` / `routes*`
|
|
91
|
+
- Each screen calls `registerScreen()` from `@appilots/sdk` with metadata
|
|
92
|
+
|
|
93
|
+
## Links
|
|
94
|
+
|
|
95
|
+
- [Appilots SDK docs](https://docs.appilots.com)
|
|
96
|
+
- [Getting started guide](https://docs.appilots.com/getting-started)
|