Skip to content

Commit 0134485

Browse files
committed
multiple docs improvements
1 parent ebf0e45 commit 0134485

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+6072
-1547
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@
5555
"gutterIcon": true
5656
}
5757
},
58-
"cSpell.words": ["lttle", "typesense"]
58+
"cSpell.words": ["lttle", "Nixpacks", "typesense"]
5959
}

docs/CLI.mdx

Lines changed: 339 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,339 @@
1+
---
2+
toc_max_heading_level: 4
3+
---
4+
5+
import CommonAuthentication from "./parts/_authentication.md";
6+
import CommonInstallingTheCli from "./parts/_installing-the-cli.md";
7+
import CommonSubcommandNamespace from "./parts/_subcommand_namespace.md";
8+
9+
# CLI
10+
11+
The `lttle` CLI is a command-line interface tool that allows you to interact with the lttle.cloud platform directly from your terminal. It provides various commands to manage your resources, deploy applications, and perform other tasks related to lttle.cloud.
12+
13+
## Installing
14+
15+
<CommonInstallingTheCli />
16+
17+
## Updating
18+
19+
There is no automatic update mechanism yet. You need to re-run the install script to update to the latest version.
20+
21+
## Commands
22+
23+
| Command | Description | Usage |
24+
| ----------------------------- | ------------------------------------------- | ------------------------------------------------ |
25+
| [`login`](#login) | Authenticate with your JWT token. | `lttle login --api https://eu.lttle.cloud <JWT>` |
26+
| [`whoami`](#whoami) | Show the currently authenticated user. | `lttle whoami` |
27+
| [`profile`](#profile) | Manage CLI profiles. | `lttle profile <subcommand>` |
28+
| [`gadget`](#gadget) | AI assistant to help onboard projects. | `lttle gadget init` |
29+
| [`import`](#import) | Import existing resources into lttle.cloud. | `lttle import <subcommand>` |
30+
| [`deploy`](#deploy) | Deploy resources to lttle.cloud. | `lttle deploy [OPTIONS] [PATH]` |
31+
| [`namespace`](#namespace) | Manage namespaces. | `lttle namespace <subcommand>` |
32+
| [`app`](#app) | Manage applications. | `lttle app <subcommand>` |
33+
| [`machine`](#machine) | Manage machines. | `lttle machine <subcommand>` |
34+
| [`volume`](#volume) | Manage volumes. | `lttle volume <subcommand>` |
35+
| [`service`](#service) | Manage services. | `lttle service <subcommand>` |
36+
| [`certificate`](#certificate) | Manage certificates. | `lttle certificate <subcommand>` |
37+
| [`query`](#query) | Query resources. | `lttle query [OPTIONS] <EXPRESSION>` |
38+
| [`docker`](#docker) | Docker management. | `lttle docker <subcommand>` |
39+
| [`completion`](#completion) | Generate shell completion scripts. | `lttle completion <SHELL>` |
40+
41+
### `login`
42+
43+
<CommonAuthentication />
44+
45+
### `whoami`
46+
47+
You can check to see what user you are authenticated as by running:
48+
49+
```plaintext command="lttle whoami"
50+
// lttle-good-output-next-line
51+
Current profile: default
52+
// lttle-good-output-next-line
53+
You are logged in as your-username (tenant: your-tenant)
54+
```
55+
56+
Replace `your-username` and `your-tenant` with your actual username and tenant.
57+
58+
### `profile`
59+
60+
:::note What is a profile?
61+
62+
:::
63+
64+
### `gadget`
65+
66+
This is our AI assistant that can help you onboard your projects faster.
67+
68+
You can invoke it by running `lttle gadget init` inside your project folder. It will analyze your project and create the necessary configuration files to get you started with deploying to lttle.cloud.
69+
70+
---
71+
72+
Here is an example of how it looks when running it inside a folder with just an index.html file:
73+
74+
```plaintext command="lttle gadget init"
75+
// lttle-good-output-next-line
76+
Gadget is working on getting your project ready for lttle.cloud
77+
// lttle-green-output-next-line
78+
Will use reasoning model with default reasoning effort
79+
// highlight-next-line
80+
// lttle-good-output-next-line
81+
Created lttle.yaml
82+
// highlight-next-line
83+
// lttle-good-output-next-line
84+
Created .vscode/settings.json
85+
// highlight-next-line
86+
// lttle-good-output-next-line
87+
Created .vscode/extensions.json
88+
warning: Repository contains a single static file (index.html). Deployed as an nginx static site exposing HTTPS on port 80. If you intended a different build (React/Next.js) or need environment variables, provide the project source code or .env files.
89+
// lttle-good-output-next-line
90+
Gadget has finished initializing your project
91+
// lttle-good-output-next-line
92+
Next steps:
93+
// highlight-next-line
94+
→ Deploy your app with `lttle deploy`
95+
// highlight-next-line
96+
→ Check on your machine with `lttle machine get static-site --ns test`
97+
// highlight-next-line
98+
→ Check on your app with `lttle app get static-site --ns test`
99+
→ See more things you can do with `lttle --help`
100+
🎉 Happy clouding!
101+
```
102+
103+
And you will see that it has
104+
105+
1. Created or updated `.vscode/settings.json` and `.vscode/extensions.json` to help you work with the project in VSCode.
106+
- `settings.json` will contain recommended settings for working with lttle projects.
107+
- `extensions.json` will recommend installing recommended extensions
108+
2. Created `lttle.yaml` with a basic configuration for your project.
109+
110+
For our example with just an `index.html` file, it created a static site project for us that will deploy the static file using nginx.
111+
112+
```yaml {3,4} title="lttle.yaml"
113+
app:
114+
namespace: test
115+
name: static-site
116+
image: nginx:alpine
117+
resources:
118+
cpu: 1
119+
memory: 256
120+
mode:
121+
flash:
122+
strategy:
123+
listen-on-port: 80
124+
environment:
125+
PORT: "80"
126+
expose:
127+
http:
128+
port: 80
129+
external:
130+
protocol: https
131+
```
132+
133+
### `import`
134+
135+
### `deploy`
136+
137+
The `lttle deploy` command is used to deploy or update your resources defined in a configuration file to lttle.cloud.
138+
139+
Usage:
140+
141+
```sh
142+
lttle deploy [OPTIONS] [PATH]
143+
```
144+
145+
| Option | Description | Usage |
146+
| --------------------------- | --------------------------------------------------------------- | ---------------------------------------- |
147+
| `--env <ENV_FILE>` | Specify an environment file to load environment variables from. | `lttle deploy --env .env.production` |
148+
| `--vars <VAR_FILE>` | Specify a variables file to load variables from. | `lttle deploy --vars vars.yaml` |
149+
| `--var <KEY=VALUE>` | Specify a single variable to override. | `lttle deploy --var version=1.2.3` |
150+
| `--no-env-ambient-override` | Disable ambient environment variable overrides. | `lttle deploy --no-env-ambient-override` |
151+
152+
### `namespace`
153+
154+
Resources within lttle.cloud are organized into **namespaces**. You can read more about namespaces in the [namespaces documentation](./building-and-deploying/namespaces.md).
155+
156+
| Subcommand | Description | Usage |
157+
| ---------------------- | ----------------------------------------- | ------------------------------------ |
158+
| `list` (short: `ls`) | List all namespaces you have access to. | `lttle namespace list` |
159+
| `delete` (short: `rm`) | Delete a namespace and all its resources. | `lttle namespace delete <NAMESPACE>` |
160+
161+
:::danger irreversible
162+
163+
The `delete` subcommand is irreversible. By default it will not delete namespaces.
164+
165+
To delete a namespace you also need to use the `--yes` (short: `-y`) flag to confirm you want to delete all resources within the namespace.
166+
167+
```sh
168+
lttle namespace delete your-namespace --yes
169+
```
170+
171+
:::
172+
173+
### `app`
174+
175+
| Subcommand | Description | Usage |
176+
| ---------------------- | ------------------------------------- | ----------------------------- |
177+
| `list` (short: `ls`) | List all applications | `lttle app list |
178+
| `get` | Get details of a specific application | `lttle app get <APP_NAME>` |
179+
| `delete` (short: `rm`) | Delete a specific application | `lttle app delete <APP_NAME>` |
180+
181+
<CommonSubcommandNamespace />
182+
183+
:::danger irreversible action
184+
185+
The `delete` subcommand is irreversible. By default it will not delete namespaces.
186+
187+
To delete a namespace you also need to use the `--yes` (short: `-y`) flag to confirm you want to delete all resources within the namespace.
188+
189+
```sh
190+
lttle namespace delete your-namespace --yes
191+
```
192+
193+
:::
194+
195+
### `machine`
196+
197+
| Subcommand | Description | Usage |
198+
| ----------------------- | --------------------------------------- | ------------------------------------------------------- |
199+
| `list` (short: `ls`) | List all machines | `lttle machine list` |
200+
| `get` | Get details of a specific machine | `lttle machine get <MACHINE_NAME>` |
201+
| [`logs`](#machine-logs) | Get logs of a specific machine | `lttle machine logs <MACHINE_NAME> [OPTIONS]` |
202+
| [`exec`](#machine-exec) | Execute a command on a specific machine | `lttle machine exec [OPTIONS] <MACHINE_NAME> [COMMAND]` |
203+
| `delete` (short: `rm`) | Delete a specific machine | `lttle machine delete <MACHINE_NAME>` |
204+
| `restart` | Restart a specific machine | `lttle machine restart <MACHINE_NAME>` |
205+
206+
<CommonSubcommandNamespace />
207+
208+
:::danger irreversible action
209+
210+
The `delete` subcommand is irreversible. By default it will not delete machines.
211+
212+
To delete a machine you also need to use the `--yes` (short: `-y`) flag to confirm you want to delete the machine.
213+
214+
```sh
215+
lttle machine delete your-machine --yes
216+
```
217+
218+
:::
219+
220+
#### `logs` {#machine-logs}
221+
222+
| Options | Description | Usage |
223+
| ------------------------------------------------- | --------------------------------------------------------- | -------------------------------------------- |
224+
| `--since <DURATION>` (default: `1d`, short: `-s`) | Show logs since a specific duration (eg. 1d, 1h, 1m, 10s) | `lttle machine logs my-machine --since 1h` |
225+
| `--timestamps` (short: `-t`) | Show timestamps in the log output | `lttle machine logs my-machine --timestamps` |
226+
| `--follow` (short: `-f`) | Follow the log output | `lttle machine logs my-machine --follow` |
227+
| `--elapsed` (short: `-e`) | Show elapsed time since the log entry | `lttle machine logs my-machine --elapsed` |
228+
| `--follow` (short: `-f`) | Follow the log output | `lttle machine logs my-machine --follow` |
229+
230+
#### `exec` {#machine-exec}
231+
232+
| Options | Description | Usage |
233+
| ----------------------- | ------------------------------------------- | ------------------------------------------ |
234+
| `--stdin` (short: `-i`) | Pass `stdin` to the container (interactive) | `lttle machine exec -i my-machine /bin/sh` |
235+
| `--tty` (short: `-t`) | `stdin` is a TTY (allocate pseudo-terminal) | `lttle machine exec -t my-machine /bin/sh` |
236+
237+
Examples:
238+
239+
- Run an interactive shell on the machine:
240+
241+
```sh
242+
lttle machine exec -it my-machine /bin/sh
243+
```
244+
245+
- Run a command non-interactively:
246+
247+
```sh
248+
lttle machine exec my-machine ls /path/to/directory
249+
```
250+
251+
### `volume`
252+
253+
| Subcommand | Description | Usage |
254+
| ---------------------- | -------------------------------- | ----------------------------------- |
255+
| `list` (short: `ls`) | List all volumes | `lttle volume list` |
256+
| `get` | Get details of a specific volume | `lttle volume get <VOLUME_NAME>` |
257+
| `delete` (short: `rm`) | Delete a specific volume | `lttle volume delete <VOLUME_NAME>` |
258+
259+
<CommonSubcommandNamespace />
260+
261+
:::danger irreversible action
262+
263+
The `delete` subcommand is irreversible. By default it will not delete volumes.
264+
265+
To delete a volume you also need to use the `--yes` (short: `-y`) flag to confirm you want to delete the volume.
266+
267+
```sh
268+
lttle volume delete your-volume --yes
269+
```
270+
271+
:::
272+
273+
### `service`
274+
275+
| Subcommand | Description | Usage |
276+
| ---------------------- | --------------------------------- | ------------------------------------- |
277+
| `list` (short: `ls`) | List all services | `lttle service list` |
278+
| `get` | Get details of a specific service | `lttle service get <SERVICE_NAME>` |
279+
| `delete` (short: `rm`) | Delete a specific service | `lttle service delete <SERVICE_NAME>` |
280+
281+
<CommonSubcommandNamespace />
282+
283+
:::danger irreversible action
284+
285+
The `delete` subcommand is irreversible. By default it will not delete services.
286+
287+
To delete a service you also need to use the `--yes` (short: `-y`) flag to confirm you want to delete the service.
288+
289+
```sh
290+
lttle service delete your-service --yes
291+
```
292+
293+
:::
294+
295+
### `certificate`
296+
297+
| Subcommand | Description | Usage |
298+
| ---------------------- | ------------------------------------- | --------------------------------------------- |
299+
| `list` (short: `ls`) | List all certificates | `lttle certificate list` |
300+
| `get` | Get details of a specific certificate | `lttle certificate get <CERTIFICATE_NAME>` |
301+
| `delete` (short: `rm`) | Delete a specific certificate | `lttle certificate delete <CERTIFICATE_NAME>` |
302+
303+
<CommonSubcommandNamespace />
304+
305+
:::danger irreversible action
306+
307+
The `delete` subcommand is irreversible. By default it will not delete services.
308+
309+
To delete a service you also need to use the `--yes` (short: `-y`) flag to confirm you want to delete the service.
310+
311+
```sh
312+
lttle service delete your-service --yes
313+
```
314+
315+
:::
316+
317+
### `query`
318+
319+
:::note TODO
320+
321+
:::
322+
323+
### `docker`
324+
325+
| Subcommand | Description | Usage |
326+
| ---------- | ---------------------------------- | -------------------- |
327+
| `login` | Login to the lttle Docker registry | `lttle docker login` |
328+
329+
### `completion`
330+
331+
You can enable autocompletion for your shell by adding the following line to your shell configuration file:
332+
333+
We currently support `bash`, `zsh`, `fish`, `elvish` and `powershell`. Run the following command to get the exact command for your shell:
334+
335+
```sh
336+
lttle completion <SHELL>
337+
```
338+
339+
The command will try to update your shell configuration file automatically, but if it fails you can follow the instructions printed in the terminal.

docs/advanced/snapshotting.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# Snapshotting
6+
7+
This document refers to the how and when a machine will be snapshotted when combining [machine mode](../resources/machines.mdx#mode) and [service connection tracking](../resources/services.mdx#connection-tracking).

0 commit comments

Comments
 (0)