When restart has removed the old container and the new one does not come up, it
now prints a start command with the same port, image, persist dir, services and
namespace. When the new container is running but did not become ready, it says to
check logs and run wait instead, because start refuses a running container.
The commands name their tree, because a bare floci follows the configured default
product. They keep a typed --endpoint, and --persist prints the directory a local
daemon would mount, so a retry from another directory finds the same state.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
The Python client ignores SECRET_MANAGER_EMULATOR_HOST and still targets
secretmanager.googleapis.com, so the skill's claim that client libraries skip
credentials when these variables are set was wrong for it. Add a recipe with the
REST transport, an explicit endpoint and anonymous credentials, and link it from
the README and the Docker reference.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Commands printed by errors, env and doctor now carry --profile, --container and
an explicit --endpoint, so pasting one acts on the same instance. After a failed
pull, the suggested start also keeps the --port, --image, --persist, --services
and --namespace you typed.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* docs(skill): publish the floci agent skill for the CLI and the four emulators
skills/floci/ teaches an AI agent to run, wire up and troubleshoot the AWS,
GCP, Azure and OCI emulators through floci-cli, docker run or Docker Compose.
- SKILL.md with the lifecycle, the hard rules (fake credentials only, verify
the endpoint, name the tree, parse -o json) and one reference per cloud.
- references/docs.md sends the agent to the published documentation of each
emulator instead of copying coverage lists that go stale.
- references/docker.md and assets/compose/ give docker run equivalents of
'floci <tree> start' and a ready Compose template per cloud, plus one with
all four on a network.
- scripts/install-floci.sh and scripts/ensure-running.sh.
- .claude-plugin/marketplace.json publishes it as a Claude Code plugin and the
root plugin.json as a Kiro power (Agent Plugins format).
- SkillDocsTest checks every floci command and flag the skill quotes against
the real command tree, its links, its frontmatter and both manifests.
- README: an "AI agents" section with the install commands, a Privacy section
on what the CLI and the skill send over the network, and support links.
- AGENTS.md: a command, flag, env output or exit code change updates the
skill in the same change.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* docs(skill): bind published ports to loopback and make the helper fail safely
Addresses the review of #69.
- The Compose templates and the docker run examples publish the emulator on
127.0.0.1. The emulators accept fake credentials, so a plain 4566:4566
exposed local resources to the network. docker.md says when to drop it and
that 'floci <tree> start' still publishes on every interface.
- ensure-running.sh no longer replaces a stopped container: it exits 3 and
leaves it alone unless FLOCI_REPLACE_STOPPED=1, because start removes the
container and, without a profile, its settings.
- The documented call is now 'exports="$(...)" && eval "$exports"'. The
one-step eval succeeded when the helper failed, so later commands ran with
missing or stale wiring.
- The templates say that container name, namespace and network name are per
project and change together.
- docker.md lists the network settings to copy into the multi-cloud file
when an app reaches child containers by name.
- ci.md installs into a user-writable directory instead of assuming
/usr/local/bin or sudo.
- SkillDocsTest now reads commands inside assignments and across continued
lines, with a test that a wrong flag is found in each form. The helper's
own status and env calls were not being checked.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(cli): honour --json and -o json in config profile, config default-product and the snapshot commands
config profile show, create, edit and delete, config default-product and snapshot save, load and delete accepted --json and printed text. They now print one document: show uses the same keys as a row of list, and the action commands report what they did and to which file or endpoint.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(cli): keep an editor's output off stdout when config profile edit prints JSON
The editor shared the command's stdout, so anything it or its wrapper printed landed in front of the result document. With structured output its stdout now goes to stderr. The README no longer lists env among the text-only commands: it prints a map in JSON and YAML.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* docs(readme): say which commands print a document when they exit 1
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(cli): exit 2 for every rejected value, not 1 in some commands
config default-product, config profile (unknown action, missing name, --port out of range), update --version, an invalid snapshot name, an invalid az setup container name and an unusable --persist path returned 1, the code for a command that ran and failed. They now return 2 like every other rejected value. A persist directory that cannot be created is still 1.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* test(restart): pin exit 2 for an unusable persist path before anything is stopped
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(reset): reset the server a profile or FLOCI_ENDPOINT names, not a local container of the default name
With no container selected, an endpoint that came from a profile or the environment was replaced by the port of a container running locally under the default name, so reset --yes could wipe the wrong instance. Such an endpoint is now used as given, like a typed one.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(reset): reset nothing when the configured endpoint and a running default container are different servers
A profile carries a container name next to its endpoint, and every created profile is seeded with the default one. Using the endpoint outright could then reset a server other than a container the profile also names. When the two disagree neither is picked; the user says which with --endpoint or --container.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(reset): require a configured container to be running and to agree with a configured endpoint
A container that a profile or FLOCI_CONTAINER supplies is selected even when it has the default name, so a missing or stopped one resets nothing instead of falling back to the endpoint. A configured container and endpoint must be the same server. For a remote Docker host the published port is on the daemon's machine, so the endpoint is compared with that host, and a remote container without an endpoint is not reset through localhost.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(reset): treat a Docker daemon on this machine reached over TCP as local
tcp://127.0.0.1:2375 is this machine's daemon, so its published ports are local and a reset goes ahead as with a socket. The README sentence about exiting 1 now covers only the cases where reset refuses.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(reset): keep a Docker daemon reached over SSH remote, loopback address or not
ssh://user@127.0.0.1:2222 is a forwarded port to a VM or another machine. Treating it as local would let reset --yes go to localhost on this machine.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* docs: add an exit-code table and generated --help snapshots
README gains the exit codes scripts can rely on, per command. docs/help holds the --help text of every command in every tree, and HelpSnapshotTest fails when the files and the commands drift apart.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* docs: say which rejected values exit 1 and pin the documented exit codes with a test
The table promised 2 for every unusable value, but three commands report a rejected value with 1. The wording is narrowed, the three are named, and ExitCodeTableTest pins the rows that need neither Docker nor a server.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* test: keep the exit-code test off the developer's saved profiles
The profile commands build their own store under the home directory, so the test now runs with a temporary home.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(cli): add --json, --no-emoji, config profile edit and a warning for servers too old for the CLI
--json is shorthand for --output json. Marks are plain ASCII with --no-emoji, when output is piped and under NO_COLOR. config profile edit opens a profile in VISUAL or EDITOR and checks it still reads. status and version warn on stderr when the AWS server is older than the minimum the CLI supports.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(cli): keep the upgrade hint on the selected instance and read quoted editor commands
The old-server hint names the instance it is about and suggests a restart, which keeps that instance's settings. The update notice follows --no-emoji and NO_COLOR. VISUAL and EDITOR are split like a shell would, so a quoted path with spaces works.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(cli): keep Windows paths in editor values and say what to do for a pinned image
A backslash in VISUAL or EDITOR is an escape only before a space or a quote, so Windows paths come through intact. The old-server hint explains that restart keeps a pinned tag and how to change it.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(config): let profile edit open a profile that no longer parses
edit asked the store to parse the profile before opening it, so the one profile that needed repairing could not be opened. A file holding YAML's null is now reported as a profile without settings instead of failing with an exception.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(config): validate Compose files by their structure, with -o json and three more checks
config validate now parses the Compose file and checks the emulator's own service: any host port mapped to the emulator port is accepted (5566:4566 was rejected), -o json and -o yaml report the findings, and it flags a read-only or file-bound data volume, a data volume without persistent storage mode (and the reverse), and an image tag older than the supported minimum.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(config): check the socket target, TCP mappings and bind types, and report unparsable files as JSON
The socket has to land at /var/run/docker.sock in the container, a UDP mapping no longer counts, a long-form bind with a bare name is checked as a path, an env_file makes the storage mode unknown, and a file that cannot be parsed still gets a structured report.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(cli): structured output for start, stop and restart, and a status exit code scripts can use
start, stop and restart print one document with -o json or -o yaml and keep progress off stdout. status exits 1 when the instance is not up (it always exited 0). logs stays plain text and says so when -o is passed.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(cli): report the container's real state after start and stop
start reads the state back, so a container that exited during the readiness wait is not reported as running, and stop reports a container docker removed on its own (--rm) as removed. The tests now reject anything after the one document on stdout.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
The help listed fish and powershell, which only produced an error; an unsupported shell is now a usage error (exit 2) with nothing on stdout. Container details are read from docker's inspect JSON instead of a pipe-delimited template, which a value containing the delimiter could shift.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(update): follow symlinked installs, pick arm64 under Rosetta and tell a failed check from a pending update
floci update replaces the real binary behind a symlink, moves an x86_64 build on Apple Silicon to the arm64 build, refuses a --version that is not a release version, and accepts upper-case checksums. --check now exits 2 when the check itself fails (1 still means an update is available) and on Windows points at the installer instead of 'floci update'. A failed background update check is recorded too, so the next command does not retry it and wait at exit.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(update): record a check attempt before the request and bound the Rosetta probe
The update check marks its attempt before asking GitHub, so a command that exits while the request is still waiting does not start it again on every run; an attempt is retried after an hour rather than a day and never overwrites a result another process just stored. The sysctl probe waits with its limit before reading. Adds a test for updating through a symlink.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(reset): add floci reset to delete every resource in a running emulator
floci reset (and floci gcp/az/oci reset) calls the emulator's state reset endpoint, so a test run can start clean without restarting the container. It asks for confirmation on a terminal; --yes skips the prompt and is required when there is no terminal. A server without the endpoint (floci-az today) gets a 'not available' message.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(reset): never guess which server to reset
A typed --endpoint is used as given instead of being replaced by a local container's port, and a container the user selected has to be found running: a missing or stopped one resets nothing rather than falling back to the default instance. The confirmation goes through a seam, with tests for every answer.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(reset): stop when a selected container publishes no port for the emulator
A selected container that is running without a matching published port has nothing to be found by, and the configured endpoint may be another instance.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(reset): find a selected instance by the emulator's port, not the configured host port
A profile for an instance on its own host port names that port in its endpoint, while the container still listens on the emulator's; reset matched the wrong one and refused such instances.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
doctor --fix only hid the hint text and services --mode filtered nothing, because the server does not report service modes. Both flags are removed rather than kept as promises; doctor's summary now points at the Fix line under each failed check. services --mode can return once the server exposes service metadata (BL-065).
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(docker): time-limit docker calls and pass names after --
Non-streaming docker calls are killed after 30 s (docker run after 10 minutes, stop after its own timeout plus 30 s) with a message naming the stalled command; any abnormal exit kills the process, streaming calls included; container and image names are passed after -- so a name starting with '-' is never read as a flag.
* fix(docker): time-limit the daemon probe and let stop --timeout -1 wait indefinitely
The doctor's daemon probe and the install probe now share the time limit and cleanup of every other docker call. A negative stop timeout is docker's wait-indefinitely (checked against Docker 29.8.2), so that call is no longer cut off after 29 seconds. Adds tests for the probe, both stop cases and interrupted streaming calls.
`--profile <name>` was declared on the shared GlobalOptions mixin but only
ConfigShowCommand ever read it. Every other command, `start` included, fell
through to the built-in defaults, so a profile's container, image, port,
persistDir and services were silently dropped.
The worst consequence was silent data loss: the `-v <dir>:/app/data` mount and
`FLOCI_STORAGE_MODE=persistent` were gated on the `--persist` flag alone, so a
profile with `persistDir` set produced neither. The image declares
`VOLUME /app/data`, so every start attached a fresh anonymous volume and the
server stayed in-memory.
A profile is now applied by a single picocli IDefaultValueProvider registered in
FlociCli.buildCommandLine(). Picocli consults it only for options the user did
not pass, and only after that command's arguments are processed, which gives the
documented precedence without per-command plumbing:
command-line flag > --profile <name> > FLOCI_* env var > product default
Behaviour changes:
- An unknown, unreadable or invalid profile is now an error (exit 2) rather than
a silent fall back to the defaults. `--help` still works with a bad profile.
- `restart --profile <name>` re-applies the profile's persistDir, image, port
and services. It builds its StartCommand programmatically, so it carries the
profile across by hand.
- `config show` merges instead of replacing, so an explicit --endpoint /
--container / -o is no longer discarded when --profile resolves. It now also
reports the profile's start-only fields.
- `config profile create` seeds the file from the tree it was run under;
previously every tree wrote AWS values.
- Profile names are validated, closing a path traversal
(`config profile delete ../../foo` resolved the raw name).
- Reads accept the `.yml` spelling that `config profile list` has always
listed, and `list` backfills a missing `name:` from the file name.
- The readiness poll after `start` keeps the endpoint's host when swapping in
the bound port, instead of always rewriting it to localhost.
Adds 64 tests, including the first coverage of ProfileStore.
Closes#22
`floci az env` printed the semicolon-separated Azure connection string
unquoted, so `eval $(floci az env)` set only
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=http and ran the
remaining segments as commands — `az` then reported "Invalid connection
string".
`floci env` and `floci gcp env` carried a byte-identical copy of the same
unquoted emitter (their values are `;`-free URLs today, so nobody hit it),
and the aws.cli.endpoint / az.cli.connection-string doctor checks suggested
export lines with the same flaw.
Extract the correct emitter that `floci oci env` already had into
io.floci.cli.output.ShellExport and use it everywhere: values are single
quoted with per-shell escaping for bash, fish, and PowerShell, so `;`, `$`,
backticks, and quotes can neither break nor inject through `eval`.
OciEnvFormatTest becomes ShellExportTest, keeping its four assertions and
adding the connection-string regression from the issue.
Closes#18
* refactor!: unify the four product command trees behind ProductProfile
Every shared command now has ONE implementation in commands/,
parameterized by ProductProfile (the single source of per-product
config: endpoint, container, image, env prefix, control prefix,
display name). The gcp/az/oci command classes become ~8-line shims
(GcpStartCommand extends StartCommand { super(ProductProfile.GCP); })
that carry only their per-product help description; the three
near-identical *GlobalOptions clones are deleted. Each product tree
drops from ~1,360 to ~530 lines and copy-drift becomes impossible.
Mechanics: per-product option defaults are constructor-set field
values rendered in help via ${DEFAULT-VALUE} (annotation defaults are
compile-time constants); commands pre-initialize their GlobalOptions
mixin with the profile (picocli uses a non-null mixin field instance
as-is). Verified against a captured baseline of 480 CLI outputs
(every --help x 5 trees, env/status/doctor JSON, exit codes, routing)
plus new pinning tests: ProductProfileTest, ProductTreesParsingTest,
DoctorCheckListTest, GlobalOptionsTest.
Behavior changes, all deliberate:
- snapshot commands in gcp/az/oci trees now perform the real
/snapshots API calls with graceful degradation and exit 1 while the
server lacks the endpoints (previously: note + exit 0)
- product logs/services gained --service/--mode, and services now
resolves the endpoint from the container port mapping in all trees
- the AWS tree brands itself 'Floci AWS' in banners and help,
matching the other products
- snapshot errors link the product issue tracker instead of TODO.md
- completion generates from spec.root() instead of a hardcoded
FlociCli instance (output unchanged)
BREAKING CHANGE: 'floci gcp|az|oci snapshot export/import' (and bare
'floci snapshot ...' with a non-AWS default product) now exit 1
instead of 0 while server-side snapshot support is pending; CI
scripts relying on the silent success of stubbed snapshot commands
will fail.
* fix: snapshot save/load/list/delete resolve the container host port
Same port auto-detection status/services/wait use — a container started
with --port <n> is now reachable by the snapshot commands without an
explicit --endpoint. Applies to all four trees via the unified base
commands.
* feat(oci): add floci oci command group for the Floci OCI emulator
Adds the fourth product tree targeting floci-oci (port 4599, container
floci-oci, control prefix /_floci-oci, FLOCI_OCI_* env overrides):
start/stop/restart/status/logs/wait/version/services/doctor/env/config
plus stub snapshot commands, mirroring the GCP/Azure trees.
- 'floci oci env' exports OCI_CLI_ENDPOINT, FLOCI_OCI_ENDPOINT, and
TF_VAR_CLIENT_HOST_OVERRIDES for the OCI CLI, the ocilocal wrapper,
and the oracle/oci Terraform provider; also OCI_CLI_PROFILE=FLOCI
when that profile exists.
- 'floci oci setup' generates an RSA-2048 API signing key with a real
computed fingerprint and writes a throwaway [FLOCI] profile to
~/.oci/config (idempotent, never touches existing profiles) — the
OCI CLI/SDKs refuse to run without them.
- FlociHttpClient now accepts both health 'services' shapes: the array
reported by AWS/GCP/Azure servers and the {name: status} object
reported by floci-oci.
- 'floci config default-product oci' routes bare commands to the tree.
* fix(oci): address review findings on env, services, and setup profile
- Single-quote 'oci env' exports with per-shell escaping (bash/fish/
PowerShell) so endpoint values containing shell metacharacters cannot
inject commands through the documented 'eval $(floci oci env)' flow.
- 'oci services' resolves the endpoint from the container port mapping
like status/wait/env, so a container started with --port <n> is found
without passing --endpoint.
- 'oci env' exports OCI_CLI_PROFILE for whichever profile 'oci setup'
wrote (detected via its key_file marker) instead of only the
hardcoded FLOCI name; DEFAULT is skipped as the CLI uses it
implicitly.
* fix: align ContainerInfo fields with inspect format template
* feat(update): add self-update command with checksum verification
* fix(update): harden self-update checksum, cleanup, and exit code
* feat(update): notify when a new release is available
* fix(update): validate release tag, avoid pre-release downgrades, clarify empty-body error
* feat(update): notify when a new release is available
* fix(cli): exempt update from default-product routing
* docs: add AGENTS.md, CONTRIBUTING.md, PR template; document GCP and self-update
- AGENTS.md (tracked): canonical agent guidance — architecture incl. the
three product trees table, doctor check structure per tree, native-image
constraints, code style rules, updated scope rules (self-update now in
scope, must never auto-run)
- CONTRIBUTING.md: build/test setup, Conventional Commits, hand-maintained
Keep-a-Changelog policy, PR guidelines, tag-driven release process
- .github/pull_request_template.md: adapted from the server repo with a
'product trees affected' checklist
- README: document the floci gcp command group (quick start, command
reference, global flags, gcp env variables, CI usage), floci update,
Java 25+ fat-JAR requirement; drop the unwired snapshot --message flag
from examples
- CHANGELOG: backfill [Unreleased] with #12 (self-update) and #11
(ContainerInfo field alignment); document these docs changes
- release.yml: release notes said the fat JAR needs Java 21+, but it is
built with --release 25 — corrected to Java 25+
* docs(changelog): use standard Keep a Changelog headings for Unreleased
The Documentation section is not one of the six types defined by Keep a
Changelog 1.1.0. New docs (AGENTS.md, CONTRIBUTING.md, README GCP section)
move under Added; the incorrect Java 21+ runtime claim moves under Fixed.
Resolve the Docker endpoint from DOCKER_HOST (with the legacy DOCKER_SOCK
override and an OS default fallback) so Podman, rootless setups, and remote
Docker contexts work without assuming /var/run/docker.sock.
start/az start/gcp start bind-mount the resolved unix socket or pass a remote
tcp:// daemon through via DOCKER_HOST; doctor's docker.socket check reports the
resolved endpoint. Adds DockerHostResolveTest and README documentation.
Closes#3