mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-11-22 21:50:47 -05:00
docs: adopt the Floci family README layout and a no-dash writing rule (#40)
This commit is contained in:
1 parent
9b340934ae
commit
2dd2e7fa25
3 files changed
+107
-41
No files matched your search
@@ -23,6 +23,6 @@
|
||||
- [ ] `mvn test` passes locally
|
||||
- [ ] New or updated tests added (or explained below why not needed)
|
||||
- [ ] `README.md` updated (if a command or flag changed)
|
||||
- [ ] Native binary verified (`mvn package -Pnative`) — required if Jackson serialization or dependencies changed
|
||||
- [ ] Commit messages / PR title follow [Conventional Commits](https://www.conventionalcommits.org/) — a `feat`/`fix`/`perf` subject becomes the release note, so `CHANGELOG.md` needs no hand edit
|
||||
- [ ] Native binary verified (`mvn package -Pnative`), required if Jackson serialization or dependencies changed
|
||||
- [ ] Commit messages / PR title follow [Conventional Commits](https://www.conventionalcommits.org/): a `feat`/`fix`/`perf` subject becomes the release note, so `CHANGELOG.md` needs no hand edit
|
||||
- [ ] I have no more than 2 open, non-draft pull requests and no more than 4 open pull requests in total (drafts included) in this repository (maintainers and dependency bots are exempt).
|
||||
@@ -8,11 +8,11 @@ This file defines repository-specific operating rules for autonomous or semi-aut
|
||||
|
||||
## Project Overview
|
||||
|
||||
`floci-cli` is the official command-line interface for [Floci](https://floci.io) — the free, open-source local cloud emulator for AWS, GCP, and Azure. It manages emulator lifecycle (start/stop/status/logs), configuration profiles, diagnostics (`doctor`), and state snapshots.
|
||||
`floci-cli` is the official command-line interface for [Floci](https://floci.io), the free, open-source local cloud emulator for AWS, GCP, and Azure. It manages emulator lifecycle (start/stop/status/logs), configuration profiles, diagnostics (`doctor`), and state snapshots.
|
||||
|
||||
- Stack: Java 25, Picocli 4.7.x, Jackson (JSON + YAML), JUnit 5
|
||||
- Distribution: GraalVM native binaries (linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64) + fat-JAR fallback
|
||||
- No frameworks beyond Picocli — plain `java.net.http.HttpClient` and `docker` CLI subprocesses
|
||||
- No frameworks beyond Picocli: plain `java.net.http.HttpClient` and `docker` CLI subprocesses
|
||||
|
||||
---
|
||||
|
||||
@@ -44,15 +44,15 @@ java -jar target/floci.jar <command>
|
||||
|
||||
Bare commands (`floci start`) route to the configured default product (`aws` unless changed via `floci config default-product aws|gcp|az|oci`). Explicit product groups are `floci aws` (same classes as the root tree), `floci gcp`, `floci az`, and `floci oci`.
|
||||
|
||||
### The unified product tree — CRITICAL
|
||||
### The unified product tree (CRITICAL)
|
||||
|
||||
There is ONE implementation of every shared command, in `commands/`, parameterized by `ProductProfile` (`io.floci.cli.ProductProfile`) — the single source of per-product config:
|
||||
There is ONE implementation of every shared command, in `commands/`, parameterized by `ProductProfile` (`io.floci.cli.ProductProfile`), the single source of per-product config:
|
||||
|
||||
| Profile | Default endpoint | Container | Env prefix | Control prefix |
|
||||
|---------|------------------|-----------|------------|----------------|
|
||||
| `AWS` (root tree) | `http://localhost:4566` | `floci` | `FLOCI_*` | `/_floci` |
|
||||
| `GCP` | `http://localhost:4588` | `floci-gcp` | `FLOCI_GCP_*` | `/_floci-gcp` |
|
||||
| `AZ` | `http://localhost:4577` | `floci-az` | `FLOCI_AZ_*` | `/_floci` (same as AWS — intentional) |
|
||||
| `AZ` | `http://localhost:4577` | `floci-az` | `FLOCI_AZ_*` | `/_floci` (same as AWS, intentional) |
|
||||
| `OCI` | `http://localhost:4599` | `floci-oci` | `FLOCI_OCI_*` | `/_floci-oci` |
|
||||
|
||||
The `commands/gcp/`, `commands/az/`, and `commands/oci/` leaf classes are **~8-line shims**: `GcpStartCommand extends StartCommand { super(ProductProfile.GCP); }` with their own `@Command` annotation carrying the per-product description. `ProductProfileTest` pins every profile field; `ProductTreesParsingTest` pins each tree's defaults.
|
||||
@@ -61,15 +61,15 @@ Rules for the unified tree:
|
||||
|
||||
- **Every parameterized command pre-initializes its mixin in the constructor**: `this.global = new GlobalOptions(profile)`. Picocli uses a non-null `@Mixin` field instance as-is; a command that forgets gets AWS defaults in every tree (the per-tree parse tests catch this).
|
||||
- **Per-product option defaults are constructor-set field values**, not annotation `defaultValue`s (annotation strings are compile-time constants). Use `(default: ${DEFAULT-VALUE})` in the option description to render them in help.
|
||||
- **Never subclass a group command** (`GcpCommand`, `*ConfigCommand`, `*SnapshotCommand` groups): picocli registers the `subcommands` arrays of both super and subclass — instant duplicate-name crash. Groups stay standalone registration-only classes.
|
||||
- **Never subclass a group command** (`GcpCommand`, `*ConfigCommand`, `*SnapshotCommand` groups): picocli registers the `subcommands` arrays of both super and subclass, an instant duplicate-name crash. Groups stay standalone registration-only classes.
|
||||
- Product-varying strings come from the profile: `displayName()` for banners, `commandPrefix()` for hint strings, `envVar("SERVICES")` for container env vars, `controlPrefix()` for `FlociHttpClient`, `serverRepo()` for issue-tracker links.
|
||||
- Only `EnvCommand`/`GcpEnvCommand`/`AzEnvCommand`/`OciEnvCommand` are genuinely product-specific (not shims), plus two product-only `setup` commands: `OciSetupCommand` (the OCI CLI/SDKs require a config file + signing key, so `floci oci setup` scaffolds them) and `AzSetupCommand` (the `az` CLI needs a registered cloud, the emulator's CA trusted and a login, so `floci az setup` does that through `io.floci.cli.azcli`). AWS and GCP need no equivalent. `add-command/checklist.sh setup` reports the shared-tree rows as MISSING for these by design.
|
||||
|
||||
Commands call `global.printer()` at the start of `call()` — never store a `Printer` as a field.
|
||||
Commands call `global.printer()` at the start of `call()`; never store a `Printer` as a field.
|
||||
|
||||
### Two I/O boundaries
|
||||
|
||||
**Docker:** `DockerClient` wraps `docker` CLI subprocesses — no docker-java library. This is a deliberate native-image trade-off. `DockerClient` returns plain records (`ContainerInfo`, `ImageInfo`) and throws `DockerException` on non-zero exit codes.
|
||||
**Docker:** `DockerClient` wraps `docker` CLI subprocesses, with no docker-java library. This is a deliberate native-image trade-off. `DockerClient` returns plain records (`ContainerInfo`, `ImageInfo`) and throws `DockerException` on non-zero exit codes.
|
||||
|
||||
**Floci server:** `FlociHttpClient` wraps `java.net.http.HttpClient` against the Floci REST API. All methods throw `FlociException`. The control-plane prefix is constructor-configurable: AWS and Azure use `/_floci`, GCP uses `/_floci-gcp`. Known live endpoints: `/_floci/health`, `/_floci/info`, `/_floci/init`, and on floci-az only `/_floci/tls-cert` (`tlsCert()`, the PEM CA; 404 when TLS is off). Snapshot endpoints (`/_floci/snapshots/*`) do not exist on the server yet.
|
||||
|
||||
@@ -91,15 +91,15 @@ if (printer.format() != OutputFormat.text) {
|
||||
|
||||
`Check` is a `@FunctionalInterface` taking `(endpoint, container)` and returning `CheckResult`. Order matters: Docker checks run before server checks because later checks depend on Docker being up.
|
||||
|
||||
One `DoctorCommand` serves every tree: `dockerChecks(profile)` builds the 9 Docker/server checks (image and control prefix from the profile), and the constructor appends the product's companion list — `AWS_COMPANION_CHECKS` (AWS CLI checks), `AZ_COMPANION_CHECKS` (az CLI checks), empty for GCP/OCI. `DoctorCheckListTest` pins each product's composition and order.
|
||||
One `DoctorCommand` serves every tree: `dockerChecks(profile)` builds the 9 Docker/server checks (image and control prefix from the profile), and the constructor appends the product's companion list: `AWS_COMPANION_CHECKS` (AWS CLI checks), `AZ_COMPANION_CHECKS` (az CLI checks), empty for GCP/OCI. `DoctorCheckListTest` pins each product's composition and order.
|
||||
|
||||
To add a check: create a class in `doctor/checks/`, then add it to `dockerChecks()` (all products) or the relevant companion list.
|
||||
|
||||
### Config profiles
|
||||
|
||||
`ProfileStore` reads/writes YAML files under `~/.floci/profiles/<name>.yaml` via Jackson. `Profile` is a plain bean — keep it `@JsonIgnoreProperties(ignoreUnknown = true)` to stay forward-compatible. The store is shared by all four product trees (no per-product namespacing). `GlobalConfigStore` persists `~/.floci/config.yaml` (currently just `default-product`).
|
||||
`ProfileStore` reads/writes YAML files under `~/.floci/profiles/<name>.yaml` via Jackson. `Profile` is a plain bean; keep it `@JsonIgnoreProperties(ignoreUnknown = true)` to stay forward-compatible. The store is shared by all four product trees (no per-product namespacing). `GlobalConfigStore` persists `~/.floci/config.yaml` (currently just `default-product`).
|
||||
|
||||
**`--profile` is applied by exactly one class — do not add per-command profile reads.** `ProfileDefaultValueProvider` is a picocli `IDefaultValueProvider` registered once in `FlociCli.buildCommandLine(...)`; picocli propagates it to the whole subcommand tree and consults it *only* for options the user did not pass, *after* that command's arguments have been processed. That yields the documented precedence for free:
|
||||
**`--profile` is applied by exactly one class; do not add per-command profile reads.** `ProfileDefaultValueProvider` is a picocli `IDefaultValueProvider` registered once in `FlociCli.buildCommandLine(...)`; picocli propagates it to the whole subcommand tree and consults it *only* for options the user did not pass, *after* that command's arguments have been processed. That yields the documented precedence for free:
|
||||
|
||||
```
|
||||
command-line flag > --profile <name> > FLOCI_* env var > product default
|
||||
@@ -110,11 +110,11 @@ command-line flag > --profile <name> > FLOCI_* env var > product default
|
||||
Rules when touching this:
|
||||
|
||||
- The field→flag mapping lives in `ProfileDefaults.valueFor` as a pure function, matched on **exact** option names. `--service` (wait/logs/env) is not `--services`; `--profile-name` (`floci oci setup`) is not `--profile`.
|
||||
- The provider is called for positionals and for commands with no `GlobalOptions` mixin (`update`, the group commands, the root) — both guards must stay.
|
||||
- The provider is called for positionals and for commands with no `GlobalOptions` mixin (`update`, the group commands, the root); both guards must stay.
|
||||
- Register it **programmatically**. The annotation form `@Command(defaultValueProvider = ...)` makes picocli instantiate it reflectively and would need a `reflect-config.json` entry.
|
||||
- A bad profile throws `ProfileNotFoundException` (a `ParameterException`), which `FlociCli`'s parameter-exception handler renders without a usage dump and exits 2. The provider returns `null` when `-h`/`-V` was requested so `--help` still works.
|
||||
- A command that reads the profile back after parsing (`RestartCommand` building its `StartCommand`, `ConfigShowCommand`) gets the parse's provider with `ProfileDefaultValueProvider.of(spec)` (an `@Spec CommandSpec spec` field) and passes it to `StartCommand.resolvedFor`. The provider memoizes the profile it resolved, so this reuses the parse's snapshot; never construct a `ProfileStore` or a second provider in a command.
|
||||
- Use `FlociCli.buildCommandLine(ProfileStore)` in tests — `new CommandLine(new FlociCli())` has none of the wiring.
|
||||
- Use `FlociCli.buildCommandLine(ProfileStore)` in tests; `new CommandLine(new FlociCli())` has none of the wiring.
|
||||
|
||||
### Multiple instances
|
||||
|
||||
@@ -136,8 +136,8 @@ An instance is a profile: its container name is its identity, its port is the on
|
||||
|
||||
## Code Style and Good Practices
|
||||
|
||||
- **Prefer `record` for data carriers.** Any DTO, value object, or result type that just holds data should be a `record` (like `ContainerInfo`, `ImageInfo`, `CheckResult`, `HealthInfo`) — not a mutable bean with getters/setters. Exception: Jackson-mapped config beans that must stay forward-compatible and field-name-bound for the native image (`Profile`, `GlobalConfig`) may stay as plain beans; if you do make a Jackson-(de)serialized type a record, it still needs a `reflect-config.json` entry.
|
||||
- **Prefer constructor injection over field mutation.** Collaborators (`DockerClient`, `FlociHttpClient`, `ProfileStore`, check lists) should be passed through the constructor and stored in `final` fields — see `DoctorCommand(List<Check> companionChecks)` for the pattern. Provide a no-arg constructor with defaults for Picocli, and a parameterized one as the test seam. Exception: Picocli requires non-final fields for `@Option`, `@Parameters`, and `@Mixin` — that is framework-mandated and fine.
|
||||
- **Prefer `record` for data carriers.** Any DTO, value object, or result type that just holds data should be a `record` (like `ContainerInfo`, `ImageInfo`, `CheckResult`, `HealthInfo`), not a mutable bean with getters/setters. Exception: Jackson-mapped config beans that must stay forward-compatible and field-name-bound for the native image (`Profile`, `GlobalConfig`) may stay as plain beans; if you do make a Jackson-(de)serialized type a record, it still needs a `reflect-config.json` entry.
|
||||
- **Prefer constructor injection over field mutation.** Collaborators (`DockerClient`, `FlociHttpClient`, `ProfileStore`, check lists) should be passed through the constructor and stored in `final` fields; see `DoctorCommand(List<Check> companionChecks)` for the pattern. Provide a no-arg constructor with defaults for Picocli, and a parameterized one as the test seam. Exception: Picocli requires non-final fields for `@Option`, `@Parameters`, and `@Mixin`; that is framework-mandated and fine.
|
||||
- **Import classes; don't fully-qualify inline.** Add an `import` and use the simple name instead of writing `io.floci.cli.output.Printer` (or `java.util.List`, etc.) inline in signatures and bodies. Avoid wildcard imports except the existing `picocli.CommandLine.*` convention.
|
||||
- Keep fields `final` wherever possible; prefer immutable collections (`List.of`, `List.copyOf`) over mutable ones exposed outside a method.
|
||||
|
||||
@@ -146,8 +146,8 @@ An instance is a profile: its container name is its identity, its port is the on
|
||||
## Native Image Constraints
|
||||
|
||||
- **No new reflection-heavy dependencies.** If adding a library, verify it works under `--no-fallback`.
|
||||
- **New Jackson DTOs** (anything `ObjectMapper` serializes/deserializes by field name) must be added to `src/main/resources/META-INF/native-image/io.floci/floci-cli/reflect-config.json`. Prefer passing `Map`/`JsonNode` to `printer.structured(...)` — those need no registration.
|
||||
- **`@Command` classes** do not need manual reflect-config entries — `picocli-codegen` (the annotation processor in `pom.xml`) generates them automatically at compile time.
|
||||
- **New Jackson DTOs** (anything `ObjectMapper` serializes/deserializes by field name) must be added to `src/main/resources/META-INF/native-image/io.floci/floci-cli/reflect-config.json`. Prefer passing `Map`/`JsonNode` to `printer.structured(...)`; those need no registration.
|
||||
- **`@Command` classes** do not need manual reflect-config entries: `picocli-codegen` (the annotation processor in `pom.xml`) generates them automatically at compile time.
|
||||
- **Do not remove** `--enable-url-protocols=http,https` from `native-image.properties`; `java.net.http.HttpClient` requires it.
|
||||
- The native profile builds with `-Os` (about 17% smaller with GraalVM Community, about 35% with Oracle GraalVM, for about 10 ms more startup). `ci.yml` fails the native job when the linux/arm64 binary exceeds `NATIVE_SIZE_BUDGET_MB`; raise the budget deliberately in the PR that needs the room, and say why.
|
||||
|
||||
@@ -157,8 +157,8 @@ An instance is a profile: its container name is its identity, its port is the on
|
||||
|
||||
- **No cloud resource commands.** This CLI manages Floci itself (lifecycle, config, diagnostics, state). Resource operations belong to the vendor CLIs pointed at the emulator: `aws` + `AWS_ENDPOINT_URL`, `gcloud`/SDK emulator-host vars, `az` + connection string.
|
||||
- **No telemetry, no TUI, no Floci Cloud commands.**
|
||||
- **Self-update is in scope** (`floci update`) — but it must never auto-run; updates happen only on explicit user invocation.
|
||||
- **Snapshot commands:** the AWS `save/load/list/delete` call `/_floci/snapshots/*` and degrade gracefully (404/501 → "not available"); `export/import` and the entire GCP/Azure/OCI snapshot subtrees are stubs pending server-side endpoints in `floci-io/floci`, `floci-io/floci-gcp`, `floci-io/floci-az`, and `floci-io/floci-oci`. Do not invent client-side snapshot behavior — the server API contract comes first.
|
||||
- **Self-update is in scope** (`floci update`), but it must never auto-run; updates happen only on explicit user invocation.
|
||||
- **Snapshot commands:** the AWS `save/load/list/delete` call `/_floci/snapshots/*` and degrade gracefully (404/501 → "not available"); `export/import` and the entire GCP/Azure/OCI snapshot subtrees are stubs pending server-side endpoints in `floci-io/floci`, `floci-io/floci-gcp`, `floci-io/floci-az`, and `floci-io/floci-oci`. Do not invent client-side snapshot behavior: the server API contract comes first.
|
||||
|
||||
---
|
||||
|
||||
@@ -175,5 +175,7 @@ printer.error("Container 'floci' not found.\nRun 'floci start' to launch one.");
|
||||
## Documentation Rules
|
||||
|
||||
- `README.md` documents all four product trees (AWS, GCP, Azure, OCI). If you add/change a command or flag, update the README in the same change.
|
||||
- `CHANGELOG.md` is generated by semantic-release from Conventional Commit messages — **never edit it by hand**. A `feat`, `fix` or `perf` subject (or a breaking change) becomes a release note verbatim, so write those from the user's point of view: what was broken or what is new, not how it was implemented. The other accepted types (`docs`, `chore`, `refactor`, `test`, `build`, `ci`) pass CI but produce no release and no entry. `changelog-guard.yml` fails any PR that touches the file; genuine corrections to history need the `changelog-edit` label.
|
||||
- The README header (logo, tagline, badges, nav row), the `The Floci emulators` table and the closing Testcontainers / Community / License / trademark footer follow the Floci family pattern, with `floci-io/testcontainers-floci`'s README as the reference. Keep them in step with it rather than restyling them here.
|
||||
- `CHANGELOG.md` is generated by semantic-release from Conventional Commit messages; **never edit it by hand**. A `feat`, `fix` or `perf` subject (or a breaking change) becomes a release note verbatim, so write those from the user's point of view: what was broken or what is new, not how it was implemented. The other accepted types (`docs`, `chore`, `refactor`, `test`, `build`, `ci`) pass CI but produce no release and no entry. `changelog-guard.yml` fails any PR that touches the file; genuine corrections to history need the `changelog-edit` label.
|
||||
- **No em or en dashes** (U+2014, U+2013) in tracked Markdown or in issue and PR text: use a colon, semicolon, comma, parentheses or a new sentence instead. `CHANGELOG.md` is exempt (generated from commit subjects).
|
||||
- `CLAUDE.md` is gitignored (maintainer-local); this file (`AGENTS.md`) is the tracked source of truth for agent guidance. Update it here.
|
||||
@@ -1,6 +1,37 @@
|
||||
# floci-cli
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/floci-io/.github/main/floci.svg#gh-light-mode-only" alt="Floci" width="500" />
|
||||
<img src="https://github.com/user-attachments/assets/edfff8b3-926c-471e-9549-77fb90a21b49#gh-dark-mode-only" alt="Floci" width="500" />
|
||||
</p>
|
||||
|
||||
Official command-line interface for [Floci](https://floci.io) — the free, open-source local cloud emulator for AWS, GCP, Azure, and OCI.
|
||||
<p align="center">
|
||||
<strong>Any Cloud. Locally.</strong><br />
|
||||
Light, fluffy, and always free: the Floci command-line interface<br />
|
||||
No account. No auth token. No feature gates.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/floci-io/floci-cli/releases/latest"><img src="https://img.shields.io/github/v/release/floci-io/floci-cli?label=release&color=blue" alt="Latest release"></a>
|
||||
<a href="https://github.com/floci-io/floci-cli/actions/workflows/ci.yml"><img src="https://github.com/floci-io/floci-cli/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI"></a>
|
||||
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-green" alt="License: MIT"></a>
|
||||
<a href="https://github.com/floci-io/floci-cli/stargazers"><img src="https://img.shields.io/github/stars/floci-io/floci-cli?style=flat" alt="GitHub Stars"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="#installation">Install</a> ·
|
||||
<a href="#quick-start">Quick Start</a> ·
|
||||
<a href="#command-reference">Commands</a> ·
|
||||
<a href="#the-floci-emulators">Emulators</a> ·
|
||||
<a href="https://floci.io">Docs</a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
## What is this?
|
||||
|
||||
`floci-cli` is the official command-line interface for [Floci](https://github.com/floci-io), the free, open-source
|
||||
local cloud emulators. It starts, stops, configures and diagnoses the emulator containers, and prints the
|
||||
environment your cloud CLI or SDK needs to talk to them. It does not manage cloud resources itself; your usual
|
||||
`aws`, `gcloud`, `az` and `oci` tools do that against the emulator (see [Scope](#scope)).
|
||||
|
||||
```sh
|
||||
# AWS (default)
|
||||
@@ -27,6 +58,18 @@ eval $(floci oci env)
|
||||
oci os ns get
|
||||
```
|
||||
|
||||
### The Floci emulators
|
||||
|
||||
floci-cli drives every member of the [Floci](https://github.com/floci-io) emulator family. Floci is named after
|
||||
[floccus](https://en.wikipedia.org/wiki/Cirrocumulus_floccus), the cloud formation that looks like popcorn.
|
||||
|
||||
| Emulator | Cloud | Port | CLI tree |
|
||||
|----------------------------------------------------|-------|:----:|----------------------------------|
|
||||
| [floci](https://github.com/floci-io/floci) | AWS | 4566 | `floci` / `floci aws` (default) |
|
||||
| [floci-az](https://github.com/floci-io/floci-az) | Azure | 4577 | `floci az` |
|
||||
| [floci-gcp](https://github.com/floci-io/floci-gcp) | GCP | 4588 | `floci gcp` |
|
||||
| [floci-oci](https://github.com/floci-io/floci-oci) | OCI | 4599 | `floci oci` |
|
||||
|
||||
## Installation
|
||||
|
||||
### Homebrew (macOS / Linux)
|
||||
@@ -71,7 +114,7 @@ floci update --check # exit 0: up to date, exit 1: update available
|
||||
floci update # download, verify checksum, replace the binary
|
||||
```
|
||||
|
||||
Homebrew and Scoop installs are updated through their package manager (`brew upgrade floci`) — `floci update` detects Homebrew-managed binaries and refuses to touch them.
|
||||
Homebrew and Scoop installs are updated through their package manager (`brew upgrade floci`); `floci update` detects Homebrew-managed binaries and refuses to touch them.
|
||||
|
||||
---
|
||||
|
||||
@@ -183,7 +226,7 @@ floci config default-product aws # revert to aws
|
||||
|
||||
## Command Reference
|
||||
|
||||
Commands are organized into four product groups — `floci aws` (or bare `floci`), `floci gcp`, `floci az`, and `floci oci`. All groups expose the same lifecycle commands.
|
||||
Commands are organized into four product groups: `floci aws` (or bare `floci`), `floci gcp`, `floci az`, and `floci oci`. All groups expose the same lifecycle commands.
|
||||
|
||||
### Shared commands (product-independent)
|
||||
|
||||
@@ -328,7 +371,7 @@ Explicit flags override the profile; the profile overrides the environment varia
|
||||
|
||||
Explicit flags override the profile; the profile overrides the environment variables.
|
||||
|
||||
> **Port auto-detection** — `status`, `version`, `wait`, and `env` automatically derive the correct
|
||||
> **Port auto-detection:** `status`, `version`, `wait`, and `env` automatically derive the correct
|
||||
> endpoint from the container's port mapping. You don't need to pass `--endpoint` when using
|
||||
> a non-default port, as long as `--container` points to the right container.
|
||||
|
||||
@@ -404,9 +447,9 @@ floci start
|
||||
|
||||
Resolution precedence:
|
||||
|
||||
1. **`DOCKER_HOST`** — the standard Docker/Podman variable (`unix://` socket, `tcp://` daemon, or `npipe://` on Windows)
|
||||
2. **`DOCKER_SOCK`** — legacy override (a bare socket path)
|
||||
3. **OS default** — `/var/run/docker.sock` on Linux/macOS, or the Docker named pipe on Windows
|
||||
1. **`DOCKER_HOST`**: the standard Docker/Podman variable (`unix://` socket, `tcp://` daemon, or `npipe://` on Windows)
|
||||
2. **`DOCKER_SOCK`**: legacy override (a bare socket path)
|
||||
3. **OS default**: `/var/run/docker.sock` on Linux/macOS, or the Docker named pipe on Windows
|
||||
|
||||
For a `unix://` socket the resolved path is bind-mounted into the container; for a
|
||||
remote `tcp://` daemon the `DOCKER_HOST` value is passed through to the container
|
||||
@@ -434,7 +477,7 @@ Prints AWS environment variables pointing at the running Floci instance. The def
|
||||
hostname is `localhost.floci.io` (resolves to `127.0.0.1`, enables virtual-hosted S3 bucket names).
|
||||
|
||||
```sh
|
||||
eval $(floci env) # bash/zsh — sets all four AWS vars
|
||||
eval $(floci env) # bash/zsh: sets all four AWS vars
|
||||
floci env --shell fish | source # fish
|
||||
floci env --shell powershell | Invoke-Expression # PowerShell
|
||||
|
||||
@@ -580,11 +623,11 @@ Variables exported:
|
||||
| `OCI_CLI_ENDPOINT` | Default `--endpoint` for the `oci` CLI |
|
||||
| `FLOCI_OCI_ENDPOINT` | Used by this CLI and the `ocilocal` wrapper |
|
||||
| `TF_VAR_CLIENT_HOST_OVERRIDES` | Per-client host overrides for the `oracle/oci` Terraform provider |
|
||||
| `OCI_CLI_PROFILE` | The profile `floci oci setup` wrote (default `FLOCI`) — only exported when detected in `~/.oci/config`, and skipped for `DEFAULT` |
|
||||
| `OCI_CLI_PROFILE` | The profile `floci oci setup` wrote (default `FLOCI`); only exported when detected in `~/.oci/config`, and skipped for `DEFAULT` |
|
||||
|
||||
### `floci oci setup`
|
||||
|
||||
The OCI CLI and SDKs refuse to run without a config file and an API signing key — even
|
||||
The OCI CLI and SDKs refuse to run without a config file and an API signing key, even
|
||||
against an emulator that never validates them. `floci oci setup` creates both in one step:
|
||||
a locally generated RSA-2048 key at `~/.oci/floci_key.pem` and a `[FLOCI]` profile in
|
||||
`~/.oci/config` with the emulator's canonical throwaway tenancy. Existing profiles are
|
||||
@@ -711,7 +754,7 @@ the keys a profile can set.
|
||||
Values are interpolated by the CLI, so `persistDir: ${env:HOME}/floci-data` expands as you would
|
||||
expect.
|
||||
|
||||
> Profiles are shared by all four product trees — there is one `~/.floci/profiles/` directory, not
|
||||
> Profiles are shared by all four product trees: there is one `~/.floci/profiles/` directory, not
|
||||
> one per product. A profile created under `floci gcp` carries GCP defaults, so passing it to the
|
||||
> AWS tree will start a GCP container; name them accordingly.
|
||||
|
||||
@@ -779,7 +822,7 @@ floci snapshot export <name> -f tarball.tar.gz
|
||||
floci snapshot import tarball.tar.gz
|
||||
```
|
||||
|
||||
> GCP, Azure, and OCI snapshots (`floci gcp snapshot` / `floci az snapshot` / `floci oci snapshot`) require server-side endpoints not yet implemented in Floci GCP / Floci Azure / Floci OCI — until then those commands report the missing API and exit 1. `floci snapshot export|import` (AWS) are also pending server support and exit 1.
|
||||
> GCP, Azure, and OCI snapshots (`floci gcp snapshot` / `floci az snapshot` / `floci oci snapshot`) require server-side endpoints not yet implemented in Floci GCP / Floci Azure / Floci OCI. Until then, those commands report the missing API and exit 1. `floci snapshot export|import` (AWS) are also pending server support and exit 1.
|
||||
|
||||
### `floci completion`
|
||||
|
||||
@@ -800,7 +843,7 @@ floci update --version 0.1.7 # install a specific version
|
||||
floci update --check || floci update # script-friendly: update only when stale
|
||||
```
|
||||
|
||||
Homebrew installs are managed by brew and are detected and refused — use `brew upgrade floci` there instead.
|
||||
Homebrew installs are managed by brew and are detected and refused; use `brew upgrade floci` there instead.
|
||||
|
||||
When run from an interactive terminal, floci also checks for new releases in the
|
||||
background (at most once per 24h, cached in `~/.floci/update-check.json`) and prints a
|
||||
@@ -835,7 +878,7 @@ services:
|
||||
|
||||
> Using Podman or a non-default daemon? Swap the host side of the socket mount for
|
||||
> your daemon's socket (e.g. `/run/user/1000/podman/podman.sock:/var/run/docker.sock`).
|
||||
> With the CLI, setting `DOCKER_HOST` is enough — see
|
||||
> With the CLI, setting `DOCKER_HOST` is enough; see
|
||||
> [Docker daemon resolution](#docker-daemon-resolution-podman-rootless-remote-contexts).
|
||||
|
||||
### GCP CI
|
||||
@@ -914,12 +957,33 @@ Use `aws` with `AWS_ENDPOINT_URL`, `gcloud`/SDKs with the emulator host variable
|
||||
|
||||
---
|
||||
|
||||
## Contributing
|
||||
## Testcontainers
|
||||
|
||||
Contributions are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md) for how to build, test, and submit changes.
|
||||
Running Floci in tests? Use the Testcontainers module for your language instead of scripting the CLI:
|
||||
|
||||
---
|
||||
| Language | Repository |
|
||||
|---|---|
|
||||
| Java | [testcontainers-floci](https://github.com/floci-io/testcontainers-floci) |
|
||||
| Node.js / TypeScript | [testcontainers-floci-node](https://github.com/floci-io/testcontainers-floci-node) |
|
||||
| Python | [testcontainers-floci-python](https://github.com/floci-io/testcontainers-floci-python) |
|
||||
| Go | [testcontainers-floci-go](https://github.com/floci-io/testcontainers-floci-go) |
|
||||
| .NET | [testcontainers-floci-dotnet](https://github.com/floci-io/testcontainers-floci-dotnet) |
|
||||
|
||||
## Community
|
||||
|
||||
- 💬 [Slack](https://join.slack.com/t/floci/shared_invite/zt-3tjn02s3q-A00kEjJ1cZxsg_imTfy6Cw): quick questions and community chat
|
||||
- 🗣️ [GitHub Discussions](https://github.com/orgs/floci-io/discussions): ideas, design tradeoffs, and proposals
|
||||
- [CONTRIBUTING.md](CONTRIBUTING.md) · [SECURITY.md](https://github.com/floci-io/.github/blob/main/SECURITY.md) · [CODE_OF_CONDUCT.md](https://github.com/floci-io/.github/blob/main/CODE_OF_CONDUCT.md) · [MAINTAINERS.md](MAINTAINERS.md)
|
||||
|
||||
## License
|
||||
|
||||
MIT — see [LICENSE](LICENSE).
|
||||
MIT. See [LICENSE](LICENSE).
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
Floci™ is a trademark of Hector Ventura. Code is MIT-licensed; see
|
||||
[TRADEMARK.md](https://github.com/floci-io/.github/blob/main/TRADEMARK.md) for name and logo use.
|
||||
|
||||
</div>
|
||||
Reference in new issue
Block a user