Skip to content

Commit 4f006ff

Browse files
author
Manus AI
committed
docs: Update README with developer account commands and registration guide
1 parent 1a758a2 commit 4f006ff

File tree

1 file changed

+237
-46
lines changed

1 file changed

+237
-46
lines changed

README.md

Lines changed: 237 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ FLB (Fleetbase CLI) is a command-line interface tool designed for managing Fleet
44

55
## Features
66

7-
- Publish Fleetbase Extensions to a specified registry.
8-
- Unpublish Extensions from the registry.
9-
- Automatically convert `composer.json` to `package.json` for PHP packages.
10-
- Scaffold new Fleetbase extensions.
11-
- Set registry token to a fleetbase instance.
12-
- Install and Uninstall extensions.
13-
- Flexible registry configuration.
7+
- Register and manage Registry Developer Accounts for self-hosted instances
8+
- Publish Fleetbase Extensions to a specified registry
9+
- Unpublish Extensions from the registry
10+
- Install Fleetbase using Docker
11+
- Automatically convert `composer.json` to `package.json` for PHP packages
12+
- Scaffold new Fleetbase extensions
13+
- Set registry token to a Fleetbase instance
14+
- Install and Uninstall extensions
15+
- Flexible registry configuration
1416

1517
## Installation
1618

@@ -20,8 +22,148 @@ To install FLB, run the following command:
2022
npm install -g @fleetbase/cli
2123
```
2224

25+
## Quick Start: Developer Account Registration
26+
27+
If you're using a self-hosted Fleetbase instance and want to publish or install extensions, you'll need to register a Registry Developer Account. Follow these steps:
28+
29+
### Step 1: Register Your Account
30+
31+
```bash
32+
flb register --host localhost:8000
33+
```
34+
35+
You'll be prompted for:
36+
- **Username**: Your desired username (alphanumeric, hyphens, and underscores only)
37+
- **Email**: Your email address
38+
- **Password**: A secure password (minimum 8 characters)
39+
- **Name**: Your display name (optional)
40+
41+
### Step 2: Verify Your Email
42+
43+
Check your email for a verification code, then run:
44+
45+
```bash
46+
flb verify -e your@email.com -c 123456 --host localhost:8000
47+
```
48+
49+
Or use the command provided in the verification email. Upon successful verification, you'll receive your registry token.
50+
51+
### Step 3: Set Your Registry Token
52+
53+
Use the token from the verification step:
54+
55+
```bash
56+
flb set-auth flb_your_token_here --registry http://localhost:8000
57+
```
58+
59+
### Step 4: You're Ready!
60+
61+
You can now publish extensions, install extensions, and manage your Fleetbase instance through the CLI.
62+
63+
**Note:** If you need to regenerate your token later, use:
64+
65+
```bash
66+
flb generate-token -e your@email.com --host localhost:8000
67+
```
68+
2369
## Usage
2470

71+
### Registry Developer Account Commands
72+
73+
#### Register a Developer Account
74+
75+
Create a new Registry Developer Account for publishing and installing extensions on self-hosted instances.
76+
77+
```bash
78+
flb register
79+
```
80+
81+
**Options:**
82+
- `-u, --username <username>`: Username for your account
83+
- `-e, --email <email>`: Email address
84+
- `-p, --password <password>`: Password (minimum 8 characters)
85+
- `-n, --name <name>`: Display name (optional)
86+
- `-h, --host <host>`: API host (default: `https://api.fleetbase.io`)
87+
88+
**Example:**
89+
```bash
90+
flb register --host localhost:8000
91+
flb register -u myusername -e my@email.com -p mypassword --host localhost:8000
92+
```
93+
94+
#### Verify Email Address
95+
96+
Verify your email address using the code sent to your email.
97+
98+
```bash
99+
flb verify
100+
```
101+
102+
**Options:**
103+
- `-e, --email <email>`: Email address
104+
- `-c, --code <code>`: Verification code from email
105+
- `-h, --host <host>`: API host (default: `https://api.fleetbase.io`)
106+
107+
**Example:**
108+
```bash
109+
flb verify -e my@email.com -c 123456 --host localhost:8000
110+
```
111+
112+
#### Resend Verification Code
113+
114+
Request a new verification code if the previous one expired.
115+
116+
```bash
117+
flb resend-verification
118+
```
119+
120+
**Options:**
121+
- `-e, --email <email>`: Email address
122+
- `-h, --host <host>`: API host (default: `https://api.fleetbase.io`)
123+
124+
**Example:**
125+
```bash
126+
flb resend-verification -e my@email.com --host localhost:8000
127+
```
128+
129+
#### Generate or Regenerate Registry Token
130+
131+
Generate a new registry authentication token or regenerate an existing one. Useful for existing accounts created before automatic token generation, or if you need to regenerate your token for security reasons.
132+
133+
```bash
134+
flb generate-token
135+
```
136+
137+
**Options:**
138+
- `-e, --email <email>`: Email address
139+
- `-p, --password <password>`: Password
140+
- `-h, --host <host>`: API host (default: `https://api.fleetbase.io`)
141+
142+
**Example:**
143+
```bash
144+
flb generate-token -e my@email.com --host localhost:8000
145+
```
146+
147+
**Note:** This command requires your account to be verified. Each time you generate a token, it replaces the previous one.
148+
149+
### Installing Fleetbase
150+
151+
Install Fleetbase using Docker with a single command.
152+
153+
```bash
154+
flb install-fleetbase
155+
```
156+
157+
**Options:**
158+
- `--host <host>`: Host or IP address to bind to (default: `localhost`)
159+
- `--environment <environment>`: Environment: `development` or `production` (default: `development`)
160+
- `--directory <directory>`: Installation directory (default: current directory)
161+
162+
**Example:**
163+
```bash
164+
flb install-fleetbase --host 0.0.0.0 --environment production --directory /opt/fleetbase
165+
```
166+
25167
### Publishing a Extension
26168

27169
To publish a extension, navigate to the extension directory and run:
@@ -46,31 +188,44 @@ flb unpublish [extension]
46188

47189
### Setup Registry Auth Token
48190

49-
To install purchased extensions you must setup authorization first which is linked to your Fleetbase account. You can generate a registry token at [https://console.fleetbase.io/extensions/developers/credentials](https://console.fleetbase.io/extensions/developers/credentials)
191+
To install purchased extensions you must setup authorization first which is linked to your Fleetbase account. For cloud users, you can generate a registry token at [https://console.fleetbase.io/extensions/developers/credentials](https://console.fleetbase.io/extensions/developers/credentials). For self-hosted users, use the `flb register` and `flb verify` commands to get your token.
50192

51193
To setup registry auth use:
52194

53195
```bash
54-
flb set-auth [token] --path /fleetbase
196+
flb set-auth [token]
55197
```
56198

57-
- `-p, --path`: (Optional) The path to the fleetbase instance directory. Defaults to the current directory.
199+
**Options:**
200+
- `-p, --path <path>`: Path of the Fleetbase instance to install setup for (default: `.`)
201+
- `-r, --registry <url>`: Registry URL the credentials are for (default: `https://registry.fleetbase.io`)
202+
203+
**Example:**
204+
```bash
205+
flb set-auth flb_your_token_here --registry http://localhost:8000
206+
```
58207

59208
### Login to the Fleetbase Registry
60209

61210
Login to the Fleetbase registry. This command authenticates you with the Fleetbase registry by saving your credentials to your local `.npmrc` file.
62211

63212
```bash
64-
flb login [options]
213+
flb login
65214
```
66215

67-
- `-u, --username <username>`: Username for the registry.
68-
- `-p, --password <password>`: Password for the registry.
69-
- `-e, --email <email>`: Email associated with your account.
70-
- `-r, --registry <registry>`: Registry URL (default: `https://registry.fleetbase.io`).
71-
- `--scope <scope>`: Scope for the registry (optional).
72-
- `--quotes <quotes>`: Quotes option for `npm-cli-login` (optional).
73-
- `--config-path <configPath>`: Path to the npm config file (optional).
216+
**Options:**
217+
- `-u, --username <username>`: Username for the registry
218+
- `-p, --password <password>`: Password for the registry
219+
- `-e, --email <email>`: Email associated with your account
220+
- `-r, --registry <registry>`: Registry URL (default: `https://registry.fleetbase.io`)
221+
- `--scope <scope>`: Scope for the registry (optional)
222+
- `--quotes <quotes>`: Quotes option for `npm-cli-login` (optional)
223+
- `--config-path <configPath>`: Path to the npm config file (optional)
224+
225+
**Example:**
226+
```bash
227+
flb login -u myusername -r http://localhost:8000
228+
```
74229

75230
### Scaffolding a Extension
76231

@@ -82,36 +237,49 @@ To scaffold a extension, use:
82237
flb scaffold
83238
```
84239

85-
- `-p, --path`: The path to place the scaffold extension.
86-
- `-n, --name`: The name of the extension to scaffold.
87-
- `-d, --description`: The description of the extension to scaffold.
88-
- `-a, --author`: The name of the extension author.
89-
- `-e, --email`: The email of the extension author.
90-
- `-k, --keywords`: The keywords of the extension to scaffold.
91-
- `-n, --namespace`: The PHP Namespace of the extension to scaffold.
92-
- `-r, --repo`: The Repository URL of the extension to scaffold.
240+
**Options:**
241+
- `-p, --path`: The path to place the scaffold extension
242+
- `-n, --name`: The name of the extension to scaffold
243+
- `-d, --description`: The description of the extension to scaffold
244+
- `-a, --author`: The name of the extension author
245+
- `-e, --email`: The email of the extension author
246+
- `-k, --keywords`: The keywords of the extension to scaffold
247+
- `-n, --namespace`: The PHP Namespace of the extension to scaffold
248+
- `-r, --repo`: The Repository URL of the extension to scaffold
93249

94250
### Installing a Extension
95251

96252
To install a extension, use:
97253

98254
```bash
99-
flb install [extension] --path /fleetbase
255+
flb install [extension]
100256
```
101257

102-
- `[extension]`: The name of the extension to install.
103-
- `-p, --path`: (Optional) The path to the fleetbase instance directory. Defaults to the current directory.
258+
**Options:**
259+
- `[extension]`: The name of the extension to install
260+
- `-p, --path`: (Optional) The path to the fleetbase instance directory. Defaults to the current directory
261+
262+
**Example:**
263+
```bash
264+
flb install @fleetbase/storefront-api --path /opt/fleetbase
265+
```
104266

105267
### Uninstalling a Extension
106268

107269
To uninstall a extension, use:
108270

109271
```bash
110-
flb uninstall [extension] --path /fleetbase
272+
flb uninstall [extension]
111273
```
112274

113-
- `[extension]`: The name of the extension to install.
114-
- `-p, --path`: (Optional) The path to the fleetbase instance directory. Defaults to the current directory.
275+
**Options:**
276+
- `[extension]`: The name of the extension to uninstall
277+
- `-p, --path`: (Optional) The path to the fleetbase instance directory. Defaults to the current directory
278+
279+
**Example:**
280+
```bash
281+
flb uninstall @fleetbase/storefront-api --path /opt/fleetbase
282+
```
115283

116284
### Bundling a Extension
117285

@@ -127,10 +295,11 @@ or to bundle and upload the created bundle, use:
127295
flb bundle --upload
128296
```
129297

130-
- `-p, --path <path>`: Path of the Fleetbase extension (default: `.`).
131-
- `--upload`: After bundling, upload the bundle to the Fleetbase registry using your authentication token.
132-
- `--auth-token <token>`: Auth token for uploading the bundle (used with `--upload` option).
133-
- `-r, --registry <registry>`: Registry URL (default: `https://registry.fleetbase.io`).
298+
**Options:**
299+
- `-p, --path <path>`: Path of the Fleetbase extension (default: `.`)
300+
- `--upload`: After bundling, upload the bundle to the Fleetbase registry using your authentication token
301+
- `--auth-token <token>`: Auth token for uploading the bundle (used with `--upload` option)
302+
- `-r, --registry <registry>`: Registry URL (default: `https://registry.fleetbase.io`)
134303

135304
### Uploading a Extension Bundle
136305

@@ -140,10 +309,11 @@ To upload an extension bundle, use:
140309
flb bundle-upload
141310
```
142311

143-
- `[bundleFile]`: Path to the bundle file to upload. If not provided, it will look for the bundle in the current directory.
144-
- `-p, --path <path>`: Path where the bundle is located (default: `.`).
145-
- `--auth-token <token>`: Auth token for uploading the bundle. If not provided, the token will be read from the `.npmrc` file.
146-
- `-r, --registry <registry>`: Registry URL (default: `https://registry.fleetbase.io`).
312+
**Options:**
313+
- `[bundleFile]`: Path to the bundle file to upload. If not provided, it will look for the bundle in the current directory
314+
- `-p, --path <path>`: Path where the bundle is located (default: `.`)
315+
- `--auth-token <token>`: Auth token for uploading the bundle. If not provided, the token will be read from the `.npmrc` file
316+
- `-r, --registry <registry>`: Registry URL (default: `https://registry.fleetbase.io`)
147317

148318
### Version Bump and Extension
149319

@@ -153,11 +323,12 @@ To bump the version on an extension, use:
153323
flb version-bump
154324
```
155325

156-
- `-p, --path <path>`: Path of the Fleetbase extension (default: `.`).
157-
- `--major`: Bump major version (e.g., `1.0.0``2.0.0`).
158-
- `--minor`: Bump minor version (e.g., `1.0.0``1.1.0`).
159-
- `--patch`: Bump patch version (e.g., `1.0.0``1.0.1`). This is the default if no flag is provided.
160-
- `--pre-release [identifier]`: Add a pre-release identifier (e.g., `1.0.0``1.0.0-beta`).
326+
**Options:**
327+
- `-p, --path <path>`: Path of the Fleetbase extension (default: `.`)
328+
- `--major`: Bump major version (e.g., `1.0.0``2.0.0`)
329+
- `--minor`: Bump minor version (e.g., `1.0.0``1.1.0`)
330+
- `--patch`: Bump patch version (e.g., `1.0.0``1.0.1`). This is the default if no flag is provided
331+
- `--pre-release [identifier]`: Add a pre-release identifier (e.g., `1.0.0``1.0.0-beta`)
161332

162333
### Setting a Custom Registry
163334

@@ -172,7 +343,27 @@ flb unpublish -r http://my-registry.com
172343

173344
FLB can be configured via command-line options. The most common options include:
174345

175-
- `-r, --registry [url]`: Specify a custom registry URL.
346+
- `-r, --registry [url]`: Specify a custom registry URL
347+
- `-h, --host [url]`: Specify the API host for developer account operations
348+
349+
## Self-Hosted vs Cloud
350+
351+
### Self-Hosted Users
352+
353+
If you're running Fleetbase on your own infrastructure:
354+
355+
1. Use `flb register` to create a Registry Developer Account
356+
2. Verify your email with `flb verify`
357+
3. Use the provided token with `flb set-auth`
358+
4. Specify `--host` parameter for all commands to point to your instance
359+
360+
### Cloud Users
361+
362+
If you're using Fleetbase Cloud (console.fleetbase.io):
363+
364+
1. Generate a registry token from the Console at [Extensions > Developers > Credentials](https://console.fleetbase.io/extensions/developers/credentials)
365+
2. Use the token with `flb set-auth`
366+
3. No need to specify `--host` parameter (defaults to cloud)
176367

177368
## Contributing
178369

0 commit comments

Comments
 (0)