sloss-cli 1.1.0 → 1.2.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/README.md +173 -36
- package/package.json +15 -4
- package/skills/sloss/SKILL.md +171 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# sloss-cli
|
|
2
2
|
|
|
3
|
-
Command-line interface for [Sloss](https://github.com/aualdrich/sloss) — a self-hosted
|
|
3
|
+
Command-line interface for [Sloss](https://github.com/aualdrich/sloss) — a self-hosted build distribution server for Expo apps. Supports iOS and Android.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -11,43 +11,167 @@ npm install -g sloss-cli
|
|
|
11
11
|
Or as a project dependency:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install sloss-cli
|
|
14
|
+
npm install --save-dev sloss-cli
|
|
15
15
|
# or
|
|
16
|
-
bun add sloss-cli
|
|
16
|
+
bun add --dev sloss-cli
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Setup
|
|
20
|
+
|
|
21
|
+
### 1. Create a Sloss account
|
|
22
|
+
|
|
23
|
+
Sign up at your team's Sloss instance (e.g. `https://sloss.example.com/signup`). After signing up, you'll receive an API key on the onboarding page. You can also find it under **Settings → API Key**.
|
|
24
|
+
|
|
25
|
+
### 2. Authenticate the CLI
|
|
20
26
|
|
|
21
27
|
```bash
|
|
22
|
-
# Authenticate (saves API key to ~/.config/sloss/credentials.json)
|
|
23
28
|
sloss login
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This prompts for your email and password, fetches your API key, and saves it to `~/.config/sloss/credentials.json`. You only need to do this once per machine.
|
|
32
|
+
|
|
33
|
+
Alternatively, set the `SLOSS_API_KEY` environment variable or pass `--api-key` to any command.
|
|
34
|
+
|
|
35
|
+
### 3. Add `.sloss.json` to your Expo project
|
|
36
|
+
|
|
37
|
+
Create a `.sloss.json` file in your Expo project root (next to `app.json`):
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"type": "expo",
|
|
42
|
+
"app_name": "MyApp",
|
|
43
|
+
"bundle_id": "com.mycompany.myapp",
|
|
44
|
+
"version_file": "app.version.json",
|
|
45
|
+
"profiles": {
|
|
46
|
+
"development": {
|
|
47
|
+
"bundle_id_suffix": ".dev"
|
|
48
|
+
},
|
|
49
|
+
"preview": {
|
|
50
|
+
"bundle_id_suffix": ".preview"
|
|
51
|
+
},
|
|
52
|
+
"production": {
|
|
53
|
+
"bundle_id_suffix": ""
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
| Field | Description |
|
|
60
|
+
|-------|-------------|
|
|
61
|
+
| `type` | Always `"expo"` |
|
|
62
|
+
| `app_name` | Display name for the build on Sloss |
|
|
63
|
+
| `bundle_id` | Base bundle identifier |
|
|
64
|
+
| `version_file` | Path to a JSON file containing `version` and `buildNumber` (relative to project root) |
|
|
65
|
+
| `profiles` | Build profile config — `bundle_id_suffix` is appended to `bundle_id` per profile |
|
|
66
|
+
|
|
67
|
+
### 4. Create `app.version.json`
|
|
68
|
+
|
|
69
|
+
Sloss reads version info from a dedicated file so the build agent can bump versions independently:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"version": "1.0.0",
|
|
74
|
+
"buildNumber": "1"
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Reference this in your `app.json` / `app.config.js` so Expo picks it up:
|
|
79
|
+
|
|
80
|
+
```js
|
|
81
|
+
// app.config.js
|
|
82
|
+
const version = require('./app.version.json');
|
|
83
|
+
|
|
84
|
+
module.exports = {
|
|
85
|
+
expo: {
|
|
86
|
+
version: version.version,
|
|
87
|
+
ios: { buildNumber: String(version.buildNumber) },
|
|
88
|
+
android: { versionCode: parseInt(version.buildNumber, 10) },
|
|
89
|
+
// ... rest of your config
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Usage
|
|
95
|
+
|
|
96
|
+
### Queue a build
|
|
97
|
+
|
|
98
|
+
From your Expo project directory:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# iOS development build (default)
|
|
102
|
+
sloss build
|
|
103
|
+
|
|
104
|
+
# Android preview build
|
|
105
|
+
sloss build --platform android --profile preview
|
|
106
|
+
|
|
107
|
+
# Production build with minor version bump
|
|
108
|
+
sloss build --profile production --bump minor
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The CLI packages your project via `git archive`, uploads it to Sloss, and a build agent picks it up. You'll get a link to the build page with live logs.
|
|
112
|
+
|
|
113
|
+
#### Build options
|
|
114
|
+
|
|
115
|
+
| Flag | Default | Description |
|
|
116
|
+
|------|---------|-------------|
|
|
117
|
+
| `--platform <platform>` | `ios` | `ios` or `android` |
|
|
118
|
+
| `--profile <profile>` | `development` | `development`, `preview`, or `production` |
|
|
119
|
+
| `--bump <type>` | `patch` | Version bump for production builds: `patch`, `minor`, or `major` |
|
|
120
|
+
| `--dir <path>` | `.` | Project directory (if not running from project root) |
|
|
24
121
|
|
|
25
|
-
|
|
122
|
+
### List builds
|
|
123
|
+
|
|
124
|
+
```bash
|
|
26
125
|
sloss list
|
|
126
|
+
sloss list --limit 20
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Get build details
|
|
27
130
|
|
|
131
|
+
```bash
|
|
132
|
+
sloss info <build-id>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Upload a pre-built artifact
|
|
136
|
+
|
|
137
|
+
If you already have an IPA or APK (e.g. from a local build):
|
|
138
|
+
|
|
139
|
+
```bash
|
|
28
140
|
# Upload an IPA
|
|
29
|
-
sloss upload
|
|
141
|
+
sloss upload ./build/MyApp.ipa --platform ios --profile preview
|
|
30
142
|
|
|
31
143
|
# Upload an APK
|
|
32
|
-
sloss upload
|
|
144
|
+
sloss upload ./build/app-release.apk --platform android --profile production
|
|
145
|
+
```
|
|
33
146
|
|
|
34
|
-
|
|
35
|
-
sloss info <build-id>
|
|
147
|
+
#### Upload options
|
|
36
148
|
|
|
37
|
-
|
|
149
|
+
| Flag | Description |
|
|
150
|
+
|------|-------------|
|
|
151
|
+
| `--platform <platform>` | **Required.** `ios` or `android` |
|
|
152
|
+
| `--profile <profile>` | Build profile: `development`, `preview`, or `production` |
|
|
153
|
+
| `--app-name <name>` | App display name |
|
|
154
|
+
| `--version <version>` | Version string |
|
|
155
|
+
| `--build-number <number>` | Build number |
|
|
156
|
+
|
|
157
|
+
### Delete a build
|
|
158
|
+
|
|
159
|
+
```bash
|
|
38
160
|
sloss delete <build-id>
|
|
39
161
|
```
|
|
40
162
|
|
|
41
163
|
## Authentication
|
|
42
164
|
|
|
43
165
|
API key resolution order (highest → lowest priority):
|
|
166
|
+
|
|
44
167
|
1. `--api-key` CLI flag
|
|
45
168
|
2. `SLOSS_API_KEY` environment variable
|
|
46
169
|
3. `~/.config/sloss/credentials.json` (saved by `sloss login`)
|
|
47
170
|
|
|
48
171
|
## Server URL
|
|
49
172
|
|
|
50
|
-
URL resolution order:
|
|
173
|
+
URL resolution order (highest → lowest priority):
|
|
174
|
+
|
|
51
175
|
1. `--url` CLI flag
|
|
52
176
|
2. `SLOSS_URL` environment variable
|
|
53
177
|
3. `~/.config/sloss/credentials.json`
|
|
@@ -55,40 +179,53 @@ URL resolution order:
|
|
|
55
179
|
|
|
56
180
|
## Global Options
|
|
57
181
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
182
|
+
| Flag | Description |
|
|
183
|
+
|------|-------------|
|
|
184
|
+
| `--api-key <key>` | Override API key |
|
|
185
|
+
| `--url <url>` | Override server URL |
|
|
186
|
+
| `--json` | Output as JSON |
|
|
187
|
+
| `--version` | Show CLI version |
|
|
188
|
+
| `--help` | Show help |
|
|
189
|
+
|
|
190
|
+
## How It Works
|
|
191
|
+
|
|
192
|
+
1. `sloss build` reads `.sloss.json` from your project root
|
|
193
|
+
2. Your committed source is packaged into a tarball via `git archive`
|
|
194
|
+
3. The tarball is uploaded to your Sloss server
|
|
195
|
+
4. A build agent picks up the job and builds it locally using Xcode (iOS) or Gradle (Android)
|
|
196
|
+
5. The finished IPA/APK is uploaded back to Sloss
|
|
197
|
+
6. You get a build page with install links and QR codes for on-device installation
|
|
198
|
+
|
|
199
|
+
## OpenClaw Skill
|
|
200
|
+
|
|
201
|
+
This package includes an [OpenClaw](https://openclaw.ai) skill so your AI agent can use the Sloss CLI. After installing `sloss-cli`, add the skill directory to your OpenClaw config:
|
|
202
|
+
|
|
203
|
+
```json5
|
|
204
|
+
// ~/.openclaw/openclaw.json
|
|
205
|
+
{
|
|
206
|
+
skills: {
|
|
207
|
+
load: {
|
|
208
|
+
extraDirs: ["./node_modules/sloss-cli/skills"]
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
64
212
|
```
|
|
65
213
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Prerequisites:
|
|
69
|
-
- An [npm](https://www.npmjs.com) account with publish access
|
|
70
|
-
- An npm access token (Granular token with "Bypass 2FA" enabled, or an Automation classic token)
|
|
214
|
+
Or copy the skill into your workspace:
|
|
71
215
|
|
|
72
216
|
```bash
|
|
73
|
-
|
|
74
|
-
echo "//registry.npmjs.org/:_authToken=YOUR_TOKEN" > ~/.npmrc
|
|
75
|
-
|
|
76
|
-
# Bump version (patch/minor/major)
|
|
77
|
-
npm version patch
|
|
78
|
-
|
|
79
|
-
# Publish
|
|
80
|
-
npm publish --access public
|
|
217
|
+
cp -r ./node_modules/sloss-cli/skills/sloss <workspace>/skills/sloss
|
|
81
218
|
```
|
|
82
219
|
|
|
83
|
-
The
|
|
220
|
+
The skill is also available on [ClawHub](https://clawhub.com):
|
|
84
221
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
222
|
+
```bash
|
|
223
|
+
clawhub install sloss
|
|
224
|
+
```
|
|
88
225
|
|
|
89
226
|
## Related
|
|
90
227
|
|
|
91
|
-
- **[Sloss Server](https://github.com/aualdrich/sloss)** — The distribution server
|
|
228
|
+
- **[Sloss Server](https://github.com/aualdrich/sloss)** — The self-hosted distribution server
|
|
92
229
|
|
|
93
230
|
## License
|
|
94
231
|
|
package/package.json
CHANGED
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sloss-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "CLI for Sloss — a self-hosted IPA/APK distribution server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"sloss": "
|
|
7
|
+
"sloss": "bin/sloss.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"bin/",
|
|
11
11
|
"src/",
|
|
12
|
+
"skills/",
|
|
12
13
|
"README.md"
|
|
13
14
|
],
|
|
14
|
-
"keywords": [
|
|
15
|
+
"keywords": [
|
|
16
|
+
"sloss",
|
|
17
|
+
"ios",
|
|
18
|
+
"android",
|
|
19
|
+
"ipa",
|
|
20
|
+
"apk",
|
|
21
|
+
"build",
|
|
22
|
+
"distribution",
|
|
23
|
+
"testflight",
|
|
24
|
+
"diawi"
|
|
25
|
+
],
|
|
15
26
|
"author": "Front Porch Software",
|
|
16
27
|
"license": "MIT",
|
|
17
28
|
"repository": {
|
|
18
29
|
"type": "git",
|
|
19
|
-
"url": "https://github.com/aualdrich/sloss-cli.git"
|
|
30
|
+
"url": "git+https://github.com/aualdrich/sloss-cli.git"
|
|
20
31
|
},
|
|
21
32
|
"engines": {
|
|
22
33
|
"node": ">=18.0.0"
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sloss
|
|
3
|
+
description: "Build, distribute, and manage Expo app builds (iOS & Android) via the Sloss CLI. Use when queuing builds, listing builds, uploading artifacts, checking build status, or managing the Sloss build server."
|
|
4
|
+
homepage: https://github.com/aualdrich/sloss-cli
|
|
5
|
+
metadata: {"openclaw":{"emoji":"🏭","requires":{"bins":["sloss"]},"install":[{"id":"npm","kind":"node","package":"sloss-cli","bins":["sloss"],"label":"Install Sloss CLI (npm)"}]}}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Sloss — Build Distribution for Expo Apps
|
|
9
|
+
|
|
10
|
+
Sloss is a self-hosted build distribution server for Expo apps (iOS & Android). The `sloss` CLI queues builds, uploads artifacts, and manages builds from the terminal.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
1. `sloss` CLI installed (`sloss --version` to verify)
|
|
15
|
+
2. A Sloss server instance (self-hosted)
|
|
16
|
+
3. An account on the Sloss server with an API key
|
|
17
|
+
|
|
18
|
+
## Authentication
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Login once — saves API key to ~/.config/sloss/credentials.json
|
|
22
|
+
sloss login
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
API key resolution (highest → lowest priority):
|
|
26
|
+
1. `--api-key` flag
|
|
27
|
+
2. `SLOSS_API_KEY` environment variable
|
|
28
|
+
3. `~/.config/sloss/credentials.json`
|
|
29
|
+
|
|
30
|
+
Server URL resolution (highest → lowest priority):
|
|
31
|
+
1. `--url` flag
|
|
32
|
+
2. `SLOSS_URL` environment variable
|
|
33
|
+
3. `~/.config/sloss/credentials.json`
|
|
34
|
+
|
|
35
|
+
## Queue a Build
|
|
36
|
+
|
|
37
|
+
Run from the Expo project root (requires `.sloss.json` config file):
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# iOS development build (default)
|
|
41
|
+
sloss build
|
|
42
|
+
|
|
43
|
+
# Android preview build
|
|
44
|
+
sloss build --platform android --profile preview
|
|
45
|
+
|
|
46
|
+
# Production build with minor version bump
|
|
47
|
+
sloss build --profile production --bump minor
|
|
48
|
+
|
|
49
|
+
# Build from a different directory
|
|
50
|
+
sloss build --dir /path/to/expo/project
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Build options
|
|
54
|
+
|
|
55
|
+
| Flag | Default | Values |
|
|
56
|
+
|------|---------|--------|
|
|
57
|
+
| `--platform` | `ios` | `ios`, `android` |
|
|
58
|
+
| `--profile` | `development` | `development`, `preview`, `production` |
|
|
59
|
+
| `--bump` | `patch` | `patch`, `minor`, `major` |
|
|
60
|
+
| `--dir` | `.` | Path to project root |
|
|
61
|
+
|
|
62
|
+
### Build flow
|
|
63
|
+
|
|
64
|
+
1. CLI reads `.sloss.json` from the project root
|
|
65
|
+
2. Source is packaged via `git archive` (respects `.gitignore`)
|
|
66
|
+
3. Tarball is uploaded to the Sloss server
|
|
67
|
+
4. A build agent picks up the job and builds locally (Xcode for iOS, Gradle for Android)
|
|
68
|
+
5. The finished IPA/APK is uploaded back to Sloss
|
|
69
|
+
6. A build page with live logs and install links is available on the server
|
|
70
|
+
|
|
71
|
+
## List Builds
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
sloss list
|
|
75
|
+
sloss list --limit 20
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Build Details
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
sloss info <build-id>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Upload a Pre-Built Artifact
|
|
85
|
+
|
|
86
|
+
If you already have an IPA or APK:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Upload an IPA
|
|
90
|
+
sloss upload ./App.ipa --platform ios --profile preview
|
|
91
|
+
|
|
92
|
+
# Upload an APK
|
|
93
|
+
sloss upload ./app.apk --platform android --profile development
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Upload options:
|
|
97
|
+
|
|
98
|
+
| Flag | Description |
|
|
99
|
+
|------|-------------|
|
|
100
|
+
| `--platform` | **Required.** `ios` or `android` |
|
|
101
|
+
| `--profile` | `development`, `preview`, or `production` |
|
|
102
|
+
| `--app-name` | App display name |
|
|
103
|
+
| `--version` | Version string |
|
|
104
|
+
| `--build-number` | Build number |
|
|
105
|
+
|
|
106
|
+
## Delete a Build
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
sloss delete <build-id>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Project Configuration
|
|
113
|
+
|
|
114
|
+
### `.sloss.json`
|
|
115
|
+
|
|
116
|
+
Place in the Expo project root:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"type": "expo",
|
|
121
|
+
"app_name": "MyApp",
|
|
122
|
+
"bundle_id": "com.example.myapp",
|
|
123
|
+
"version_file": "app.version.json",
|
|
124
|
+
"profiles": {
|
|
125
|
+
"development": { "bundle_id_suffix": ".dev" },
|
|
126
|
+
"preview": { "bundle_id_suffix": ".preview" },
|
|
127
|
+
"production": { "bundle_id_suffix": "" }
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### `app.version.json`
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"version": "1.0.0",
|
|
137
|
+
"buildNumber": "1"
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Reference this in `app.config.js` so Expo picks it up:
|
|
142
|
+
|
|
143
|
+
```js
|
|
144
|
+
const version = require('./app.version.json');
|
|
145
|
+
module.exports = {
|
|
146
|
+
expo: {
|
|
147
|
+
version: version.version,
|
|
148
|
+
ios: { buildNumber: String(version.buildNumber) },
|
|
149
|
+
android: { versionCode: parseInt(version.buildNumber, 10) },
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Global Flags
|
|
155
|
+
|
|
156
|
+
| Flag | Description |
|
|
157
|
+
|------|-------------|
|
|
158
|
+
| `--api-key <key>` | Override API key |
|
|
159
|
+
| `--url <url>` | Override server URL |
|
|
160
|
+
| `--json` | JSON output |
|
|
161
|
+
| `--version` | Show CLI version |
|
|
162
|
+
| `--help` | Show help |
|
|
163
|
+
|
|
164
|
+
## Output Formats
|
|
165
|
+
|
|
166
|
+
All commands support `--json` for structured JSON output:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
sloss list --json
|
|
170
|
+
sloss info <build-id> --json
|
|
171
|
+
```
|