anfra docsAlpha

Publish to anfra BI

Publish a project from anfra Core to your organization on anfra BI Cloud with anfra publish, and pull what teammates published

anfra Core runs on your machine. You build and preview data apps there. anfra BI Cloud is the hosted anfra BI, at us.anfra.ai. It adds sign-in, members with roles, and connections kept by the organization. To share your apps with your team, publish the project to your organization on anfra BI Cloud.

Publish with a coding agent

The anfra-publish skill teaches a coding agent the steps on this page. The agent asks you for anything it needs. See Set up your coding agent.

Use the anfra-publish skill. Publish this project to anfra BI Cloud.

Before you publish

You need:

  • An organization on anfra BI Cloud, where you're an Analyst or Admin. See Create an organization and Permissions. Your organization's address looks like https://us.anfra.ai/o/<org>.
  • Connections in the organization for the ones your models use. The publish can add them for you. See Add connections.
  • anfra 0.22 or later. Run anfra update to get it. Older versions don't publish .anfra/config.yml.
  • A project that validates. Run anfra validate first. A publish validates again and stops on any error.

Publish your project

Run these commands from the project folder:

anfra auth login https://us.anfra.ai/o/acme   # 1. sign in
anfra publish check                           # 2. preview what will be sent
anfra publish --set-org https://us.anfra.ai/o/acme   # 3. publish
  1. Sign in. Your browser opens to approve the login. There, you can pick a different organization than the one in the address. anfra saves the login in ~/.anfra/credentials.json. Keep that file private and out of Git.
  2. Check. anfra publish check lists the files a publish would send, and where to. It doesn't sign in or change anything.
  3. Publish. --set-org saves the address in .anfra/config.yml as org.url. Commit that file, so the whole team publishes to the same organization. Next time, run anfra publish on its own. If no organization is set, it lists the ones you're signed in to and asks you to pick.

No organization address yet? Run anfra auth login without a URL to pick your region's server. See Regions.

What gets published

A publish sends your project's files as they are in the folder now, committed or not. It replaces everything published before. A file you deleted locally is deleted on anfra BI Cloud too.

Only three things are sent: .aml files, everything under apps/, and the project's settings in .anfra/config.yml. Everything else stays on your machine: the rest of .anfra/, .env files, node_modules and any folder starting with a dot. So your credentials in .anfra/data_sources.yml are never sent. .gitignore has no effect on what is published.

Symlinks aren't published. If the project has one, the publish stops and names it. Replace it with a copy of the file.

Each publish records a message in the organization's history. In a Git repository, the default is the latest commit's message. Pass -m to write your own:

anfra publish -m "Add churn dashboard"

Connections

The organization keeps its own connections. A published model queries the organization's connection with the same name. When the organization lacks one, the publish asks whether to create it from your .anfra/data_sources.yml, credentials included. Only an Admin can add connections. For anyone else, the publish continues and names the connections to ask an Admin to add. A DuckDB file is offered an upload to MotherDuck instead. See Add connections and Connections.

Settings

The settings in .anfra/config.yml, such as the origins data apps may load from, apply on the organization too. Only an Admin can publish a change to a setting. An Admin can also override a setting on the organization: a publish that changes it then warns you that the change takes no effect there. See Repo settings and Allowed origins.

Publish with your team

A publish replaces everything the organization has. So before you publish, you need what teammates published. If a teammate published since your last pull or publish, anfra publish stops with pull_required. It doesn't stop if their changes are already in your folder.

Teams share changes in one of two ways:

  • With Git. Merge your change into a shared branch, such as main, and publish from it. See Version control with Git.
  • Without Git. Pull, then publish, as below.

Pull, then publish

Without Git, the organization holds the shared copy. Each person works in their own folder. anfra pull brings in what others published. anfra publish sends your changes.

anfra publish status   # see what's incoming and unpublished; changes nothing
anfra pull             # bring in what teammates published
anfra publish --pull   # or both in one go: pull if needed, then publish

anfra pull only writes the files a publish sends: .aml files and apps/. Changes that don't overlap with yours are merged into your files for you. Run anfra validate after a pull, before you build on the changes.

Resolve conflicts

If you and a teammate changed the same lines of a file, anfra pull leaves conflict markers in it:

<<<<<<< local
  label: 'Revenue (net)'
||||||| base
  label: 'Revenue'
=======
  label: 'Total revenue'
>>>>>>> org ([email protected], 2026-11-08 16:20)

The markers split the file into three versions:

  • local is your version.
  • base is the version you both started from.
  • org is the organization's version, with who published it and when.

The base shows what each side meant to change. Here, you both renamed the label.

To resolve a conflict, edit the file so it says what it should. Delete the base block and all four marker lines: <<<<<<<, |||||||, ======= and >>>>>>>. Once the markers are gone, the conflict is resolved. There's no command to run.

To keep one side of a whole file, run anfra pull --take local <path> or anfra pull --take org <path>. Files that can't hold markers, such as images, always need --take. If one side deleted a file and the other changed it, delete it yourself or use --take.

When every conflict is resolved, run anfra validate and anfra publish. Until then, anfra pull and anfra publish stop with conflicts_unresolved and name each file.

To undo the pull, run anfra pull --abort. It restores every file the pull changed. Edits you made to those files since the pull are lost.

Join an existing project

To work on a project a teammate already published, sign in, set up an empty folder, and pull the project into it:

anfra auth login https://us.anfra.ai/o/acme
anfra init --yes
anfra pull --set-org https://us.anfra.ai/o/acme

The pull lists the connections the project uses that your .anfra/data_sources.yml lacks, with their types. Add them with your own credentials. See Connect your data.

Then work as above: make your changes, run anfra validate, and publish with anfra publish --pull.

If your team keeps the project in Git, clone the repository instead. See Version control with Git.

Publish from a script

Without a terminal, or with --non-interactive, anfra publish never asks a question. It needs:

  • An organization, set in .anfra/config.yml or passed with --set-org.
  • A saved login for that organization, from anfra auth login. Login needs a browser, so headless machines such as CI runners aren't supported yet.
  • --pull, if a teammate may have published since. Without it, the publish stops with pull_required. A conflict still stops it.
  • --create-data-sources, to add the connections the organization lacks. This sends them, credentials included, to anfra BI Cloud. DuckDB files are never uploaded this way.

anfra pull runs the same way. It needs only the organization and the login.

Pass --json for a machine-readable result. anfra pull and anfra publish status accept it too. A pull that leaves conflicts still exits with 0. The conflicts are its result.

anfra publish --non-interactive --json --pull

Command reference

CommandWhat it does
anfra auth login [<org URL>]Sign in to an organization through your browser. Without a URL, pick your region's anfra BI Cloud server, or enter your organization's URL. Regions not open yet show as upcoming.
anfra auth statusList the organizations you're signed in to, and which one the project publishes to.
anfra auth logout [<org URL>]Sign out of an organization, and revoke the login on anfra BI Cloud.
anfra publish checkList the files a publish would send. Publishes nothing.
anfra publish statusShow what a pull would bring in, what a publish would send, and any conflicts left. Changes nothing.
anfra publishValidate the project and publish it.
anfra pullBring in what teammates published to the organization.
anfra publish flagDescription
--set-org <org URL>Set the organization, save it in .anfra/config.yml, and publish there.
-m, --messageThe message for the organization's history.
--pullIf a teammate published since, pull their changes first, then publish. Stops on a conflict.
--create-data-sourcesAdd missing connections without asking.
--yesDeprecated. Use --pull.
anfra pull flagDescription
--set-org <org URL>Set the organization, save it in .anfra/config.yml, and pull from there.
--take local|org <path>...Resolve a conflict by keeping your version, or the organization's, of each whole file.
--abortUndo the last pull, putting back every file it changed.

--non-interactive, --json and --yaml work on every anfra command. See Publish from a script.

Troubleshooting

A login stops working. Run anfra auth login <org URL> again. If you signed out and anfra couldn't revoke the login, revoke it yourself in Settings → Personal → Connections on anfra BI Cloud.

A publish stops with pull_required. See Pull, then publish. In a Git repository, see When a publish asks you to pull.

A publish stops with conflicts_unresolved. See Resolve conflicts.

The project is too large. An organization limits how many files a project can have, how large each file can be, and how large they are together. The publish names the file or the count that's over the limit. See Limits.

See also the CLI reference for every anfra command.

On this page