From d50b3187e50f142e6c3b08a4fe709854288c0c4f Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 30 Mar 2026 12:41:25 -0400 Subject: [PATCH] Remove deprecated `fabro init` command Users should use `fabro repo init` instead. The deprecation shim has been in place long enough; remove it and update all docs references. Co-Authored-By: Claude Opus 4.6 (1M context) --- AGENTS.md | 12 ++++- README.md | 2 +- docs/getting-started/quick-start.mdx | 2 +- docs/reference/cli.mdx | 4 -- lib/crates/fabro-cli/src/args.rs | 4 -- lib/crates/fabro-cli/src/main.rs | 5 -- lib/crates/fabro-cli/tests/it/cmd/fabro.rs | 63 +++++++++++----------- lib/crates/fabro-cli/tests/it/cmd/init.rs | 25 --------- lib/crates/fabro-cli/tests/it/cmd/mod.rs | 1 - 9 files changed, 45 insertions(+), 73 deletions(-) delete mode 100644 lib/crates/fabro-cli/tests/it/cmd/init.rs diff --git a/AGENTS.md b/AGENTS.md index 6dd3dc8fe..5d629c233 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -50,7 +50,7 @@ The OpenAPI spec at `docs/api-reference/fabro-api.yaml` is the source of truth f Fabro is an AI-powered workflow orchestration platform. Workflows are defined as Graphviz graphs, where each node is a stage (agent, prompt, command, conditional, human, parallel, etc.) executed by the workflow engine. ### Rust crates (`lib/crates/`) -- **fabro-cli** — CLI entry point. Commands: `run`, `exec`, `serve`, `validate`, `parse`, `cp`, `model`, `doctor`, `init`, `install`, `ps`, `system prune`, `llm` +- **fabro-cli** — CLI entry point. Commands: `run`, `exec`, `serve`, `validate`, `parse`, `cp`, `model`, `doctor`, `install`, `ps`, `system prune`, `llm` - **fabro-workflow** — Core workflow engine. Parses Graphviz graphs, runs stages, manages checkpoints/resume, hooks, retros, and human-in-the-loop interactions - **fabro-agent** — AI coding agent with tool use (Bash, Read, Write, Edit, Glob, Grep, WebFetch). `Sandbox` trait abstracts execution environments - **fabro-server** — Axum HTTP server. Routes for runs, sessions, models, completions, usage. SSE event streaming. Demo mode via header @@ -92,6 +92,16 @@ When interpolating values into shell command strings (in `fabro-workflow`), alwa - **Functions**: import the parent module, call as `module::function()` — `use fabro_workflow::operations; operations::create(...)` - **No glob imports** in production code (`use foo::*`). Globs are acceptable in test modules and preludes. Enforced by clippy `wildcard_imports` lint. +## Snapshot tests (insta) + +Many CLI tests use `insta` inline snapshots. When a snapshot needs updating: + +1. Run `cargo insta pending-snapshots` to list what changed +2. Verify each pending snapshot is expected +3. Run `cargo insta accept` to accept all, or `cargo insta accept --snapshot ` for a specific one + +Never run `cargo insta accept` without first checking what's pending — it accepts *all* pending snapshots, which may include unrelated changes. + ## Testing workflows - `fabro run ` — run a workflow by name (resolves `fabro/workflows//workflow.toml`), e.g. `fabro run repl` diff --git a/README.md b/README.md index 4ccea8c5a..7a9fe2e39 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ Then initialize Fabro in your project: fabro install # one-time setup cd my-project -fabro init # per project +fabro repo init # per project ``` --- diff --git a/docs/getting-started/quick-start.mdx b/docs/getting-started/quick-start.mdx index e9eed957e..6fcd44250 100644 --- a/docs/getting-started/quick-start.mdx +++ b/docs/getting-started/quick-start.mdx @@ -34,7 +34,7 @@ Fabro has two modes: ```bash cd my-repo/ -fabro init +fabro repo init ``` This creates a default workflow and configuration in your project directory. diff --git a/docs/reference/cli.mdx b/docs/reference/cli.mdx index 77aac0977..aed773d69 100644 --- a/docs/reference/cli.mdx +++ b/docs/reference/cli.mdx @@ -648,10 +648,6 @@ The command must be run inside a git repository. It creates: After creating files, it checks whether the GitHub App is installed for the repository. If the app is not installed and the repository owner differs from the app owner, it warns that the app may need to be [made public](/integrations/github#github-app-is-private-but-this-repo-belongs-to-a-different-owner) first. - -The old `fabro init` still works but prints a deprecation warning. Use `fabro repo init` instead. - - ## `fabro repo deinit` Remove Fabro from a project by deleting `fabro.toml` and the `fabro/` directory. Fails with an error if the project is not initialized. diff --git a/lib/crates/fabro-cli/src/args.rs b/lib/crates/fabro-cli/src/args.rs index 560150fb8..ebaea83d9 100644 --- a/lib/crates/fabro-cli/src/args.rs +++ b/lib/crates/fabro-cli/src/args.rs @@ -777,9 +777,6 @@ pub(crate) enum Commands { #[arg(long)] dry_run: bool, }, - /// Initialize a new project (deprecated: use `repo init`) - #[command(hide = true)] - Init, /// Set up the Fabro environment (LLMs, certs, GitHub) Install { /// Base URL for the web UI (used for OAuth callback URLs) @@ -865,7 +862,6 @@ impl Commands { RepoCommand::Init { .. } => "repo init", RepoCommand::Deinit => "repo deinit", }, - Self::Init => "init", Self::Install { .. } => "install", Self::Pr(ns) => match &ns.command { PrCommand::Create(_) => "pr create", diff --git a/lib/crates/fabro-cli/src/main.rs b/lib/crates/fabro-cli/src/main.rs index 7b1da5eb8..d1ad7e77a 100644 --- a/lib/crates/fabro-cli/src/main.rs +++ b/lib/crates/fabro-cli/src/main.rs @@ -158,7 +158,6 @@ async fn main_inner() -> (String, Result<()>) { Commands::RunCmd(RunCommands::Run(_) | RunCommands::Create(_)) | Commands::Exec(_) | Commands::Repo(_) - | Commands::Init | Commands::Install { .. } ) { commands::upgrade::spawn_upgrade_check(globals.no_upgrade_check, upgrade_check_enabled) @@ -207,10 +206,6 @@ async fn main_inner() -> (String, Result<()>) { open::that("https://docs.fabro.sh/")?; } Commands::Repo(ns) => commands::repo::dispatch(ns).await?, - Commands::Init => { - fabro_util::warn_user!("`fabro init` is deprecated, use `fabro repo init` instead"); - commands::repo::init::run_init().await?; - } Commands::Install { web_url } => { commands::install::run_install(&web_url).await?; } diff --git a/lib/crates/fabro-cli/tests/it/cmd/fabro.rs b/lib/crates/fabro-cli/tests/it/cmd/fabro.rs index 0d643c60c..82d873394 100644 --- a/lib/crates/fabro-cli/tests/it/cmd/fabro.rs +++ b/lib/crates/fabro-cli/tests/it/cmd/fabro.rs @@ -12,37 +12,38 @@ fn help() { Usage: fabro [OPTIONS] Commands: - run Launch a workflow run - create Create a workflow run (allocate run dir, persist spec) - start Start a created workflow run (spawn engine process) - attach Attach to a running or finished workflow run - logs View the event log of a workflow run - resume Resume an interrupted workflow run - rewind Rewind a workflow run to an earlier checkpoint - fork Fork a workflow run from an earlier checkpoint into a new run - wait Block until a workflow run completes - preflight Validate run configuration without executing - validate Validate a workflow - graph Render a workflow graph as SVG or PNG - asset Inspect and copy run assets (screenshots, reports, traces) - store Export store-backed run state for debugging - rm Remove one or more workflow runs - inspect Show detailed information about a workflow run - model List and test LLM models - doctor Check environment and integration health - install Set up the Fabro environment (LLMs, certs, GitHub) - pr Pull request operations - secret Manage secrets in ~/.fabro/.env - settings Inspect merged configuration - workflow Workflow operations - discord Open the Discord community in the browser - docs Open the docs website in the browser - upgrade Upgrade fabro to the latest version - repo Repository commands - provider Provider operations - sandbox Sandbox operations (cp, ssh, preview) - system System maintenance commands - help Print this message or the help of the given subcommand(s) + run Launch a workflow run + create Create a workflow run (allocate run dir, persist spec) + start Start a created workflow run (spawn engine process) + attach Attach to a running or finished workflow run + logs View the event log of a workflow run + resume Resume an interrupted workflow run + rewind Rewind a workflow run to an earlier checkpoint + fork Fork a workflow run from an earlier checkpoint into a new run + wait Block until a workflow run completes + preflight Validate run configuration without executing + validate Validate a workflow + graph Render a workflow graph as SVG or PNG + asset Inspect and copy run assets (screenshots, reports, traces) + store Export store-backed run state for debugging + rm Remove one or more workflow runs + inspect Show detailed information about a workflow run + model List and test LLM models + doctor Check environment and integration health + install Set up the Fabro environment (LLMs, certs, GitHub) + pr Pull request operations + secret Manage secrets in ~/.fabro/.env + settings Inspect merged configuration + workflow Workflow operations + discord Open the Discord community in the browser + docs Open the docs website in the browser + upgrade Upgrade fabro to the latest version + repo Repository commands + provider Provider operations + sandbox Sandbox operations (cp, ssh, preview) + completion Generate shell completions + system System maintenance commands + help Print this message or the help of the given subcommand(s) Options: --debug Enable DEBUG-level logging (default is INFO) [env: FABRO_DEBUG=] diff --git a/lib/crates/fabro-cli/tests/it/cmd/init.rs b/lib/crates/fabro-cli/tests/it/cmd/init.rs deleted file mode 100644 index 560047540..000000000 --- a/lib/crates/fabro-cli/tests/it/cmd/init.rs +++ /dev/null @@ -1,25 +0,0 @@ -use fabro_test::{fabro_snapshot, test_context}; - -#[test] -fn help() { - let context = test_context!(); - let mut cmd = context.init_cmd(); - cmd.arg("--help"); - fabro_snapshot!(context.filters(), cmd, @" - success: true - exit_code: 0 - ----- stdout ----- - Initialize a new project (deprecated: use `repo init`) - - Usage: fabro init [OPTIONS] - - Options: - --debug Enable DEBUG-level logging (default is INFO) [env: FABRO_DEBUG=] - --no-upgrade-check Disable automatic upgrade check [env: FABRO_NO_UPGRADE_CHECK=true] - --quiet Suppress non-essential output [env: FABRO_QUIET=] - --verbose Enable verbose output [env: FABRO_VERBOSE=] - --storage-dir Storage directory (default: ~/.fabro) [env: FABRO_STORAGE_DIR=[STORAGE_DIR]] - -h, --help Print help - ----- stderr ----- - "); -} diff --git a/lib/crates/fabro-cli/tests/it/cmd/mod.rs b/lib/crates/fabro-cli/tests/it/cmd/mod.rs index 7a425733d..2331b54d3 100644 --- a/lib/crates/fabro-cli/tests/it/cmd/mod.rs +++ b/lib/crates/fabro-cli/tests/it/cmd/mod.rs @@ -16,7 +16,6 @@ mod exec; mod fabro; mod fork; mod graph; -mod init; mod inspect; mod install; mod llm;