Stacks

Run Atlas Headless in CI for F# Projects in 2026

Updated 8 min read

F# developers in 2026 can run Atlas headless in CI pipelines by invoking `atlas run` with a specific prompt, ensuring machine-readable output by passing the `--format json` flag, and pre-approving necessary tools like `bash` and `edit` in the Atlas permission configuration to avoid interactive prompts.

How to Run Atlas Headless in F# CI Pipelines

In 2026, F# developers can execute Atlas non-interactively within CI pipelines using the `atlas run` command. This default mode sends a single prompt, streams events to standard output, and exits automatically when the session becomes idle, providing a streamlined approach for automated F# code tasks.

Running Atlas headless in a F# CI pipeline is achieved by invoking the `atlas run` command directly. This command is specifically designed for non-interactive environments, allowing F# projects to leverage Atlas's capabilities without human intervention. When `atlas run` is executed, it processes a single prompt provided as an argument, then streams all session events to `stdout`. This event stream is crucial for CI systems, as it provides a real-time log of Atlas's operations. For subsequent pipeline steps that require programmatic parsing of Atlas's output, F# developers must include the `--format json` flag. This ensures that the event stream is emitted as structured JSON, making it easily consumable by other tools or scripts within the CI environment. Atlas, when operating on a F# codebase, intelligently indexes code by AST declarations using tree-sitter, respecting the file order defined in the `.fsproj` file and understanding F# constructs like discriminated unions and computation expressions. This deep understanding allows Atlas to perform precise modifications and analyses within your F# project, from adding `Expecto` tests to refactoring `Option` pipelines.

Configuring Atlas Permissions for Automated F# Workflows

To ensure a smooth, non-interactive experience for Atlas in F# CI pipelines, developers must pre-approve all necessary tools in the Atlas permission configuration. A headless run has no human operator to answer 'ask' prompts, making explicit 'allow' rules for tools like `bash`, `read`, `edit`, and `todowrite` critical for successful execution in 2026.

Atlas employs a robust permission-gating system for every tool call, which is evaluated against `allow`, `ask`, and `deny` rules before execution. In a headless CI environment for F# projects, the 'ask' rule is effectively a 'deny' because there is no interactive terminal to solicit user approval. Therefore, F# developers must explicitly configure 'allow' rules for all tools Atlas might need to use during its session. Common tools required for F# development workflows include `bash` for executing shell commands, `read` for accessing file contents, `edit` for modifying source files, and `todowrite` for creating new files or updating existing ones. For instance, if Atlas is tasked with adding `Expecto` tests to a F# test project or running `fantomas` over changed `.fs` files, it will require `bash` to invoke `dotnet test` or `fantomas`, and `edit` to apply the changes. Pre-approving these tools in the Atlas configuration ensures that the agent can proceed with its plan without interruption, maintaining the non-interactive nature of the CI pipeline.

Integrating Atlas with F# Tooling: dotnet test, NuGet, and fantomas

Atlas integrates deeply with the F# toolchain, understanding `.fsproj` files to respect compilation order and leveraging familiar commands. In 2026, Atlas can be configured to run `dotnet test (Expecto)` for validating changes, manage dependencies with `NuGet (dotnet add package)`, and ensure code style with `fantomas` on modified `.fs` files, all within a CI pipeline.

Atlas is designed to be deeply aware of the F# ecosystem, making it an invaluable asset for CI pipelines. It begins by building its code index with AST declarations using tree-sitter, specifically parsing `.fsproj` files to understand the crucial file order in which F# compiles. This allows Atlas to accurately map F# constructs such as discriminated unions, modules, and entry points for frameworks like Giraffe or Fable. When tasked with code modifications, Atlas can be instructed to perform actions that directly involve the F# toolchain. For example, it can replace a null check with an `Option` pipeline, or add new `Expecto` tests to a F# test project. Before committing any changes, Atlas can run `dotnet test` to validate the modifications, with the execution of `dotnet test (Expecto)` being permission-gated for safety. After applying edits, Atlas can also be configured to run `fantomas` over the changed `.fs` files, ensuring that all new or modified F# code adheres to established formatting standards. Dependency management is also supported, with Atlas capable of interacting with `NuGet` via `dotnet add package` commands if required by a task.

Reviewing and Rolling Back Atlas Changes in F# Projects

Every modification made by Atlas in a F# project generates a unified diff, providing transparency and control over automated changes. In 2026, F# developers can review these diffs before approval, and Atlas snapshots file changes as git patches, enabling easy rollback of any edits, ensuring robust safety even in headless CI environments.

Even in a headless CI setup for F# projects, Atlas maintains a high degree of transparency and control over its actions. Before any file is written, Atlas computes a unified diff for every proposed edit and surfaces it for approval. While direct interactive approval is not possible in a headless CI, this mechanism ensures that the diffs are available in the `--format json` output stream, allowing subsequent pipeline steps to programmatically review or log the changes. Atlas drafts its initial plan in a read-only plan agent, asking for confirmation before switching to a build agent that can execute modifications. This two-stage process provides an inherent safety layer. Furthermore, Atlas snapshots all file changes as git patches. This capability is invaluable for F# developers, as it means any edits made by the agent to `.fs` files, `.fsproj` files, or other project assets can be easily diffed against the original state and rolled back if necessary. This robust version control integration ensures that automated changes, even those from a non-interactive Atlas session, can be managed with confidence and precision within your F# codebase.

Step by step

  1. 01Ensure your F# project is ready for Atlas: Verify your solution contains a `.fsproj` file, as Atlas reads this to understand F# compilation order and map constructs like discriminated unions and modules.
  2. 02Pre-approve Atlas tools in configuration: Modify your Atlas configuration to explicitly `allow` tools such as `bash`, `read`, `edit`, and `todowrite`. This is crucial for headless runs, as Atlas will not be able to `ask` for permission to run `dotnet test (Expecto)` or `fantomas` in CI.
  3. 03Specify the Atlas model for the CI run: Set the active model explicitly using the `provider/model` format, for example, `atlas run --model ollama/codellama:7b-instruct-q4_K_M`, as GitHub paths and other formats are rejected in headless mode.
  4. 04Execute Atlas non-interactively with a F# prompt: Run `atlas run "Add Expecto tests for the `MyModule.calculate` function in `src/MyProject/MyModule.fs`." --format json` to send a single prompt, stream machine-readable JSON events to `stdout`, and exit when the session goes idle.
  5. 05Process the machine-readable Atlas output: Capture the JSON event stream from `stdout` in a subsequent CI pipeline step. This output can be parsed to review unified diffs generated by Atlas for `.fs` files or to log tool calls like `dotnet test (Expecto)` or `fantomas`.
  6. 06Review and manage proposed F# code changes: Examine the unified diffs provided in the JSON output. Atlas snapshots file changes as git patches, allowing you to inspect proposed modifications to your F# codebase and decide whether to stage and create commits or roll back edits.
  7. 07Optionally, resume or fork a prior Atlas session: If a F# job needs to build on an earlier run, use `atlas run --continue <session-id>` or `atlas run --fork <session-id>` to pick up where a previous F# CI run left off.

Frequently asked questions

How do I run dotnet test (Expecto) with Atlas in CI?
Configure Atlas to `allow` the `bash` tool, then prompt Atlas to run `dotnet test` within your F# project. Atlas will execute `dotnet test (Expecto)` and surface the results.
Can Atlas format my F# code with fantomas in a pipeline?
Yes, ensure `fantomas` is installed and Atlas has `allow` permission for `bash` and `edit`. You can then prompt Atlas to run `fantomas` over changed `.fs` files.
How does Atlas handle F# .fsproj files in CI?
Atlas indexes code by AST declarations using tree-sitter, reading your `.fsproj` file to understand F# compilation order and map modules, discriminated unions, and entry points.
What output format does Atlas provide for F# CI pipelines?
Atlas streams events to `stdout`. For machine-readable output, use `atlas run --format json`, which provides a structured JSON event stream for programmatic parsing by other CI steps.
How do I prevent Atlas from asking for permissions in F# CI?
In a headless F# CI environment, you must pre-approve all necessary tools (e.g., `bash`, `read`, `edit`) in your Atlas permission configuration, as there is no interactive prompt to answer 'ask' rules.
Can Atlas resume a failed F# CI session?
Yes, Atlas supports resuming or forking prior sessions. Use `atlas run --continue <session-id>` or `atlas run --fork <session-id>` to pick up where a previous F# CI run left off.
How can I review Atlas's F# code changes before they are committed in CI?
Atlas computes a unified diff for every file edit and surfaces it in the `--format json` output. It also snapshots changes as git patches, allowing you to review and roll back modifications to your F# codebase.

Try Atlas in your terminal

The terminal-native AI coding agent. Free core, single binary.

Install Atlas

Related guides

Run Atlas Headless in CI with Atlas (2026 Workflow)

How to run Atlas headless in CI in 2026: atlas run sends one prompt and exits when the session goes idle, with --format json, --command, and --continue for pipeline steps.

Atlas for F#: A Terminal-Native AI Coding Agent for .fsproj Solutions in 2026

Atlas is a terminal-native AI coding agent for F# in 2026. It respects .fsproj file order, maps discriminated unions, runs dotnet test behind a prompt, and runs Fantomas.

Automate GitHub Issue and Pull Request Triage in F# with Atlas in 2026

Streamline GitHub issue and pull request triage in your F# projects with Atlas in 2026. Leverage Atlas's AI to respond safely, run dotnet test (Expecto), and format with fantomas for trusted F# workflows.

Review a Pull Request in F# with Atlas in 2026

In 2026, F# developers use Atlas to review pull requests, leveraging its deep understanding of .fsproj files, discriminated unions, and dotnet test (Expecto) to catch subtle bugs.

Trace a runtime bug from a stack trace in F# with Atlas in 2026

In 2026, F# developers can use Atlas to trace runtime bugs from production stack traces directly to the responsible line of code and apply a fix, all without attaching a debugger. Atlas integrates with your F#

Upgrade a Dependency and Fix Breakage in F# with Atlas in 2026

Upgrade F# dependencies in 2026 with Atlas. direct bump NuGet packages, fix compile errors, and repair Expecto test failures using dotnet add package and fantomas for a smooth migration.

Audit an F# Repository with Parallel Subagents in Atlas in 2026

Audit F# repositories in 2026 with Atlas's parallel subagents. Sweep code for problems using `dotnet test (Expecto)` and `fantomas` without blowing your main session's context window.

Self-review your working diff before committing in F# with Atlas in 2026

Catch F# coding mistakes before CI. Atlas helps F# developers in 2026 self-review uncommitted diffs, run `dotnet test (Expecto)`, and apply `fantomas` formatting, all from your terminal.

Browse this resource hub