Skip to content
safran

Type to search. Enter opens the first result.

    Set-up commands

    Five commands take you from nothing to a profile you can trust: safran init writes a starter profile, safran profile check validates it, safran doctor checks the machine around it, safran plugins lists the connector types you can use, and safran discover drafts the parts of the profile that are tedious to write by hand. This page documents each one with its flags, real output and JSON shape. Global options, exit codes and the --json contract are on the CLI overview.

    $ safran init --yes --company acme --language tr --tracker jira --set tracker.url=https://jira.acme.example --set tracker.projects=PAY,MOB,WEB --host local --set host.path=repos
    ✔ Wrote safran.yaml
    
    Set these environment variables, in your shell or in a .env file next to the profile:
      JIRA_EMAIL  ! not set
      JIRA_TOKEN  ! not set
    
    Next
      safran profile check  validate the profile and every connector
      safran doctor         check git, the embedder and the index
      safran sync           clone or read the repositories and index them
      safran discover       draft groups, teams and glossary from merged pull requests
      safran setup claude   print the command that connects Claude Code

    safran init

    safran init [options]

    Writes a starter profile. Interactive by default: it asks for the company slug, the language tickets are written in, the trackers, code hosts and doc sources (one after the other, until you answer none), the embedder, each with the fields it needs, and finally whether agents may write. With --yes (or --json) it asks nothing and takes everything from flags and defaults.

    It only writes the profile file (creating its directory if needed). It contacts no service and stores no secret: fields ending in _env hold the name of an environment variable. The file goes to the profile path of the run, so --profile <file> chooses where.

    FlagValueDefaultMeaning
    --company <slug>lowercase letters, digits, dashesthe current directory's name, slugifiedCompany slug (company: in the profile).
    --language <code>two-letter ISO 639-1 codeenLanguage tickets are written in (languages.tickets).
    --code-language <code>two-letter codeenLanguage of identifiers and comments (languages.code).
    --tracker <type> …a tracker plugin type, or none; repeatablenoneA tracker entry to write; repeat for several. Its id is the type name.
    --host <type> …a code host plugin type, or none; repeatablenoneA code host entry to write; repeat for several. Its id is the type name.
    --docs <type> …a doc source type, or none; repeatablenoneDoc source plugin type (confluence). Repeat for several entries.
    --embedder <type>an embedder plugin typeollamaThe embeddings: entry.
    --set <section.field=value> …repeatableOne connector field. Sections are tracker, host, docs and embeddings; the second entry of a kind is tracker.2.url=….
    --me <name>textthe owner of the tracker's tokenYour name as the trackers show it: who "my work" means in the work views. Written to me.name.
    --me-account <id=name> …repeatableThe name one tracker or code host knows you by, where it differs: jira=e.demir. Written to me.accounts.
    --pin-board <tracker:board> …repeatableA board to pin: shown first and kept in the dashboard's sidebar, for example jira:12. Written to work.boards.pinned.
    --writes <kind> …repeatable, comma listnoneLet agents write, for these kinds only: ticket.comment, ticket.create_child, pull_request.comment, pull_request.reply. Without it the profile is written with writes off.
    --plugin <module> …repeatable; package name or path relative to the profileA third-party plugin module to list under plugins:. The module is imported, so its types can be chosen.
    --yes, -ynoneoffAsk nothing; use the flags and defaults.
    --forcenoneoffOverwrite an existing profile.

    The fields --set (and the wizard) knows for each built-in type:

    TypeFieldsDefaults used with --yes
    tracker jiraurl (required), deployment (cloud or datacenter), email_env, token_env, projectsdeployment=cloud, email_env=JIRA_EMAIL, token_env=JIRA_TOKEN
    tracker azure-boardsorganization (required), projects, token_envtoken_env=AZURE_DEVOPS_PAT
    tracker lineartoken_env, projectstoken_env=LINEAR_API_KEY
    tracker github-issuesowner (required), repos, token_env
    host azure-reposorganization (required), projects, token_envtoken_env=AZURE_DEVOPS_PAT
    host githubowner (required), token_env
    host gitlabgroup (required), url, token_envurl=https://gitlab.com
    host localpath, or repos (comma-separated directories); one of the two is required
    doc source confluenceurl (required), deployment (cloud or datacenter), email_env, token_env, spacesdeployment=cloud, email_env=CONFLUENCE_EMAIL, token_env=CONFLUENCE_TOKEN
    embedder ollamamodel, urlmodel=bge-m3, url=http://localhost:11434
    embedder openai-compatibleurl (required), model (required), token_env

    List fields (projects, repos) take comma-separated values. Paths of the local host are made absolute against the directory you ran the command in. A value that equals the schema default (deployment: cloud, the default GitLab and Ollama URLs) is left out of the file to keep it short. Every connector also takes id and token_expires, and every code host include and exclude. Anything init does not ask for, such as groups, teams, glossary and conventions, you add with safran profile add, safran profile set or by editing the file; see the profile reference.

    The command at the top of this page wrote this file (the local host's path was given as repos and resolved against /work/acme):

    # Safran profile for acme. Written by `safran init`; edit freely.
    # Secrets never go here: *_env fields name the environment variable that holds a token.
    # Validate with `safran profile check`. Groups, teams and glossary: `safran discover` drafts them.
    version: 1
    company: acme
    languages:
      tickets: tr
      code: en
    trackers:
      - id: jira
        type: jira
        url: https://jira.acme.example
        email_env: JIRA_EMAIL
        token_env: JIRA_TOKEN
        projects:
          - PAY
          - MOB
          - WEB
    code:
      hosts:
        - id: local
          type: local
          path: /work/acme/repos
    embeddings:
      type: ollama
      model: bge-m3

    Before writing, init runs the same two validations createSafran runs (the profile schema and each connector's own schema), so a file it writes is one safran profile check accepts. The exception is a type that comes from a --plugin module: init does not know its fields, writes a stub entry with a # TODO comment, and says so.

    Several connectors, doc sources and writes

    --tracker, --host and --docs may be repeated; each repetition writes one entry. --set tracker.url=… addresses the first tracker, --set tracker.2.projects=… the second. An entry's id is its type name (numbered when a type appears twice) unless you set it: --set host.id=azure.

    $ safran init --yes --company acme --language tr --tracker jira --set tracker.url=https://jira.acme.example --set tracker.projects=PAY,MOB,WEB --tracker linear --set tracker.2.projects=OPS --host azure-repos --set host.organization=acme --set host.projects=Platform --set 'host.exclude=*-archive' --docs confluence --set docs.url=https://jira.acme.example --set docs.spaces=PAY --writes ticket.comment
    ✔ Wrote safran.yaml
    ! Writes are enabled for: ticket.comment. What an agent posts appears under the token's account, notifies people, and cannot be edited or deleted by Safran.
      Each write is previewed and confirmed. They apply only when the profile is named (--profile) or --allow-writes is passed → safran writes status
    
    Set these environment variables, in your shell or in a .env file next to the profile:
      AZURE_DEVOPS_PAT  ! not set
      CONFLUENCE_EMAIL  ! not set
      CONFLUENCE_TOKEN  ! not set
      JIRA_EMAIL        ! not set
      JIRA_TOKEN        ! not set
      LINEAR_API_KEY    ! not set
    
    Next
      safran profile check  validate the profile and every connector
      safran doctor         check git, the embedder and the index
      safran sync           clone or read the repositories and index them
      safran discover       draft groups, teams and glossary from merged pull requests
      safran setup claude   print the command that connects Claude Code
    # Safran profile for acme. Written by `safran init`; edit freely.
    # Secrets never go here: *_env fields name the environment variable that holds a token.
    # Validate with `safran profile check`. Groups, teams and glossary: `safran discover` drafts them.
    version: 1
    company: acme
    languages:
      tickets: tr
      code: en
    trackers:
      - id: jira
        type: jira
        url: https://jira.acme.example
        email_env: JIRA_EMAIL
        token_env: JIRA_TOKEN
        projects:
          - PAY
          - MOB
          - WEB
      - id: linear
        type: linear
        token_env: LINEAR_API_KEY
        projects:
          - OPS
    code:
      hosts:
        - id: azure-repos
          type: azure-repos
          organization: acme
          projects:
            - Platform
          token_env: AZURE_DEVOPS_PAT
          exclude:
            - "*-archive"
    docs:
      - id: confluence
        type: confluence
        url: https://jira.acme.example
        email_env: CONFLUENCE_EMAIL
        token_env: CONFLUENCE_TOKEN
        spaces:
          - PAY
    embeddings:
      type: ollama
      model: bge-m3
    writes:
      enabled: true
      allow:
        - ticket.comment

    --writes names the kinds of write agents may perform; without it (and when the last question of the wizard is answered no) the profile is written with writes off, which is how Safran starts. The warning above is the risk in one sentence. Writing the section into the file is not enough to make a server write: see the trust rule.

    For Confluence, docs.spaces is the question not to skip: it is the allow-list of space keys agents may read, and empty means every space the token can see.

    JSON

    --json implies --yes. trackers, hosts and doc_sources list the entries written with their ids (tracker and host name the first of each), writes what the profile says about writes, stubs the types written as stubs, env the variables the new profile refers to and whether each is set, next the commands to run next.

    {
      "profile_file": "/work/acme/safran.yaml",
      "company": "acme",
      "tracker": null,
      "host": "local",
      "embedder": "ollama",
      "trackers": [],
      "hosts": [
        {
          "id": "local",
          "type": "local"
        }
      ],
      "doc_sources": [],
      "writes": {
        "enabled": false,
        "allow": []
      },
      "stubs": [],
      "env": [],
      "next": [
        "safran profile check",
        "safran doctor",
        "safran sync",
        "safran discover",
        "safran setup claude"
      ]
    }

    Exit codes and mistakes

    init exits with 0 when the file was written and with 2 for a command line it refuses (1 when a --plugin module cannot be loaded). The file is written in one step at the end, after validation.

    $ safran init --yes
    ✘ safran.yaml already exists
    → Pass --force to overwrite it, --profile <file> to write somewhere else, or change it with `safran profile set`.
    $ safran init --yes --force --tracker jira
    ✘ jira needs a value that --yes cannot guess: --set tracker.url=<url>
    $ safran init --yes --force --host gitlb
    ✘ No code-host plugin has the type "gitlb"
    → Did you mean gitlab? Available: azure-repos, github, gitlab, local.
    • Putting a secret in a _env field. --set tracker.token_env=… takes the name of a variable (JIRA_TOKEN). A value that is not a valid variable name is rejected.
    • --set without a type. --set tracker.url=… without --tracker <type> is an error under --yes, because the default tracker is none.
    • A field init does not know. --set only accepts the fields in the table above; edit the file for the rest.
    • Piping answers that run out. In interactive mode, input that ends before the last question stops the command with exit code 2 and nothing is written.

    safran profile check

    safran profile check [file] [options]

    Loads the profile, validates it against the profile schema and every connector's own schema, builds every connector, and prints a summary: connectors, groups, teams, glossary size, the environment variables the profile names and whether each is set, and the team mappings that still carry confidence: low.

    Offline by default: connectors are built but not called, so it needs no network and no tokens. A missing token shows up as not set here and becomes an error only when the connector is used. --online makes one cheap call per tracker (list projects) and per code host (list repositories). It writes nothing. The profile can be given as an argument instead of --profile.

    FlagValueDefaultMeaning
    --onlinenoneoffAlso make one call per tracker and per code host, and report each result.
    $ safran profile check --online
    ✔ safran.yaml is valid
    
      company      acme
      languages    tickets tr, code en
      trackers     jira
      code hosts   azure (azure-repos)
      doc sources  none
      groups       backend (2) — 2 repos
      teams        Payments, Mobile
      glossary     2 terms
      conventions  1
      embeddings   ollama (bge-m3)
      writes       off — the profile has `writes.enabled: false` (the default)
      data         data
    
    ! Low-confidence team mappings to confirm by hand: Mobile
      → Check their `projects` and `repos`, then delete `confidence: low` from the entry.
    
    Environment variables
      name        status  used by
      JIRA_TOKEN  set     trackers.jira.token_env
    
    Online check
      ✔ tracker jira: 1 project visible
      ✔ code-host azure: 2 repos listed

    A connector is shown as id (type), or as the id alone when the two are the same. When a token is missing, the offline check still passes and tells you; the online check fails for the connector that needs it:

    $ safran profile check --online
    ✔ safran.yaml is valid
    
      company      acme
      languages    tickets tr, code en
      trackers     jira
      code hosts   local
      doc sources  none
      groups       none
      teams        none
      glossary     0 terms
      conventions  0
      embeddings   ollama (bge-m3)
      writes       off — the profile has `writes.enabled: false` (the default)
      data         data
    
    Environment variables
      name        status   used by
      JIRA_EMAIL  not set  trackers.jira.email_env
      JIRA_TOKEN  not set  trackers.jira.token_env
    ! JIRA_EMAIL, JIRA_TOKEN are not set; the connectors that use them will fail when called.
      → Export them in your shell, or put them in a .env file next to the profile.
    
    Online check
      ✘ tracker jira: Environment variable JIRA_TOKEN is not set
        → Export JIRA_TOKEN in your shell, or put it in the .env file next to the profile.
      ✔ code-host local: 1 repo listed

    An invalid profile is not summarised at all: the command stops with every problem and its path. The messages are explained in validation errors.

    $ safran profile check
    ✘ The profile has 3 configuration problems:
      - trackers.0.url: Invalid input: expected string, received undefined
      - trackers.0.token_env: Invalid input: expected string, received undefined
      - trackers.0: Unrecognized key: "urll"
    → Fix these entries in the profile. `safran plugins` lists the available types and their fields.

    JSON

    The offline document of the profile safran init wrote above. With --online it also has an online array of { kind, id, type, ok, detail, hint? }, and ok is false when any of them failed.

    {
      "ok": true,
      "profile_file": "/work/acme/safran.yaml",
      "data_dir": "/work/acme/data",
      "company": "acme",
      "languages": {
        "tickets": "tr",
        "code": "en"
      },
      "trackers": [
        {
          "id": "jira",
          "type": "jira",
          "projects": [
            "PAY",
            "MOB",
            "WEB"
          ]
        }
      ],
      "hosts": [
        {
          "id": "local",
          "type": "local",
          "include": [],
          "exclude": []
        }
      ],
      "doc_sources": [],
      "groups": [],
      "teams": [],
      "glossary_terms": 0,
      "conventions": 0,
      "embeddings": {
        "type": "ollama"
      },
      "plugins": [],
      "to_confirm": [],
      "env": [
        {
          "name": "JIRA_EMAIL",
          "set": false,
          "used_by": [
            "trackers.jira.email_env"
          ]
        },
        {
          "name": "JIRA_TOKEN",
          "set": false,
          "used_by": [
            "trackers.jira.token_env"
          ]
        }
      ]
    }

    groups entries are { name, repos } with repos a count; teams entries are { name, projects, repos, confidence } with confidence null when the entry has none.

    Exit codes and mistakes

    CodeWhen
    0The profile is valid (and, with --online, every connector answered). Unset variables and low-confidence teams are reported but do not fail the check.
    1The profile is missing or invalid, or a connector failed its online call.
    • Reading "valid" as "working". The offline check proves the file is well formed. Only --online or safran doctor touch a service.
    • A profile with plugins: in the current directory. It is refused unless you name it or pass --allow-plugins; see plugin modules and trust.

    safran profile set

    safran profile set <path> <value> [<path> <value> …]

    Changes values of the profile through the validator: the file is written only when the result is a valid profile, by the same checks safran profile check makes. Otherwise the problems are listed and the file is left exactly as it was. All pairs of one command are applied together or not at all. It contacts no service.

    <path> is dotted: languages.tickets, writes.enabled, embeddings.model, code.groups.backend. Entries of a list are named by their id, name or term (trackers.jira.projects, teams.Payments.repos, glossary.iade.code) or by position (trackers.0.url). Under trackers, code.hosts, docs and tool_packs, an id that does not exist yet starts a new entry, so a whole connector is added in one command.

    <value>: true / false and numbers are read as such; a,b,c is a list where the profile expects one; [a, b] and {k: v} are read as YAML; a value in YAML quotes ('"[BE]"') is exactly that text. A field ending in _env takes the name of an environment variable; anything that looks like a secret is refused and not echoed.

    It has no options of its own.

    $ safran profile set languages.tickets tr
    ✔ Updated safran.yaml
      = languages.tickets: tr  (was en)
      The file as it was before this first edit is kept as safran.yaml.bak.
    $ safran profile set trackers.jira.token_expires 2027-03-31 code.groups.backend payments-api,ledger
    ✔ Updated safran.yaml
      = trackers.jira.token_expires: 2027-03-31
      = code.groups.backend: [payments-api, ledger]
    $ safran profile set docs.wiki.type confluence docs.wiki.url https://jira.acme.example docs.wiki.token_env CONFLUENCE_TOKEN docs.wiki.email_env JIRA_EMAIL docs.wiki.spaces PAY
    ✔ Updated safran.yaml
      = docs.wiki.type: confluence
      = docs.wiki.url: https://jira.acme.example
      = docs.wiki.token_env: CONFLUENCE_TOKEN
      = docs.wiki.email_env: JIRA_EMAIL
      = docs.wiki.spaces: [PAY]
    $ safran profile set tickets.title_prefixes.backend '"[BE]"' tickets.title_prefixes.mobile '["[iOS]", "[AND]"]'
    ✔ Updated safran.yaml
      = tickets.title_prefixes.backend: ["[BE]"]
      = tickets.title_prefixes.mobile: ["[iOS]", "[AND]"]

    Three things to know before the first edit:

    • Comments are not kept. Only the comment block at the top of the file survives; the YAML writer cannot write the others. The first edit keeps the original file as <file>.bak.
    • The layout is normalised: lists are written one item per line.
    • A running MCP server keeps its old settings until it is restarted. Edits to writes say so.
    $ safran profile set writes.allow ticket.delete
    ✘ The edit would make safran.yaml invalid, so nothing was written:
      - writes.allow.0: Invalid option: expected one of "ticket.comment"|"ticket.create_child"|"pull_request.comment"|"pull_request.reply"
    → Fix the value and run the command again; the file is unchanged.
    $ safran profile set code.hosts.azure.token_expires 2027-01-15
    ✘ The edit would make safran.yaml invalid, so nothing was written:
      - code.hosts.1.type: Invalid input: expected string, received undefined
    → code.hosts.azure would be a NEW entry: give it every field it needs in the same command, or check the name for a typo. The file is unchanged.
    $ safran profile set trackers.jira.token_env s3cr3t-value-123
    ✘ trackers.jira.token_env takes the NAME of an environment variable (for example JIRA_TOKEN), never the secret itself
    → The value you passed was not used and is not shown. If it was a real token, treat it as leaked: it is now in your shell history.

    JSON

    changed is false when the file already said that. changes lists every pair with its previous value; backup is the path of the .bak file when this edit created it; comments_dropped counts the comments that could not be kept; problems holds the validation messages when valid is false. The same shape is printed by unset and add:

    {
      "profile_file": "/work/acme/safran.yaml",
      "changed": true,
      "changes": [
        {
          "action": "unset",
          "path": "conventions.0",
          "value": null,
          "previous": "Branch names follow feature/<TICKET-KEY>-short-description."
        }
      ],
      "backup": null,
      "comments_dropped": 0,
      "valid": true,
      "problems": [],
      "unchecked": []
    }

    Exit codes and mistakes

    0 when the file was written or already said that; 1 when the edit would make the profile invalid; 2 for a usage error, including a secret passed to an _env field.

    • Adding a field to an entry that does not exist. A new id starts a new entry, which then needs every required field in the same command. Check the id for a typo.
    • A list value the shell split. Quote patterns and values with spaces or brackets: '*-archive,sandbox-*'.

    safran profile unset

    safran profile unset <path> [<path> …]

    Removes values or list entries, with the paths of safran profile set. Removing a key returns it to its default; removing a list entry (trackers.linear, teams.Web, conventions.2) drops the entry. The same validation applies: an edit that would leave an invalid profile is refused. It has no options of its own.

    $ safran profile unset teams.Mobile.confidence teams.Mobile.source
    ✔ Updated safran.yaml
      − teams.Mobile.confidence  (was low)
      − teams.Mobile.source  (was 9 ticket-PR links)
    $ safran profile unset writes
    ✔ Updated safran.yaml
      − writes  (was enabled: true, allow: [ticket.comment, pull_request.reply])
      A running MCP server keeps its old settings until it is restarted → safran writes status
    $ safran profile unset trackers.nope
    ✔ trackers.nope is not set in safran.yaml; nothing was written.

    Exit codes are those of profile set. Unsetting something that is not set is not an error.

    safran profile add

    safran profile add <teams | glossary | conventions | groups> <name or sentence> [repo…] [options]

    Adds a team, a glossary term, a convention or a repo group. Adding to something that exists extends it: repos are added to the group, projects and repos to the team, code words to the term. Connectors are added with safran profile set.

    FlagValueDefaultMeaning
    --projects <key> …repeatable, comma listnoneteams: tracker project keys the team owns.
    --repos <name> …repeatable, comma listnoneteams, groups: repositories. groups also takes them as further arguments.
    --confidence <level>low, medium or highnoneteams: for a mapping nobody confirmed yet.
    --source <text>textnoneteams: where the mapping came from.
    --code <word> …repeatable, comma listnoneglossary: the words and identifiers the code uses for the term.
    --note <text>textnoneglossary: a short clarification.
    $ safran profile add teams Payments --projects PAY --repos payments-api,ledger
    ✔ Updated safran.yaml
      + teams.Payments: name: Payments, projects: [PAY], repos: [payments-api, ledger]
    $ safran profile add teams Mobile --projects MOB --repos acme-ios,acme-android --confidence low --source "9 ticket-PR links"
    ✔ Updated safran.yaml
      + teams.Mobile: name: Mobile, projects: [MOB], repos: [acme-ios, acme-android], confidence: low, source: 9 ticket-PR links
    $ safran profile add glossary "İade" --code refund,chargeback
    ✔ Updated safran.yaml
      + glossary.İade: term: İade, code: [refund, chargeback]
    $ safran profile add conventions "Branch names follow feature/<TICKET-KEY>-short-description."
    ✔ Updated safran.yaml
      + conventions.0: Branch names follow feature/<TICKET-KEY>-short-description.
    $ safran profile add groups mobile acme-ios acme-android
    ✔ Updated safran.yaml
      + code.groups.mobile: [acme-ios, acme-android]
    $ safran profile add groups backend ledger
    ✔ safran.yaml already says that; nothing was written.

    The rules that span entries apply here too: a team's project must be listed under a tracker, a glossary term may exist once. Exit codes are those of profile set.

    safran doctor

    safran doctor

    Checks the environment the profile needs, top to bottom, and tells you what to do about each problem.

    FlagValueDefaultMeaning
    --check-remotenoneoffAlso ask each code host whether the clones are behind their default branch (one call per cloned repo).

    It does touch the outside world: it runs git --version, makes one tiny embedding request to the configured embedder (60 second timeout), and lists repositories from the code hosts. It writes nothing; a missing index is reported as missing, not created.

    CheckFails (✘) whenWarns (!) when
    bunBun is older than 1.3.0
    gitgit is not on PATH or does not run
    launchthe CLI was not started through bin/safran and the directory holds a .env or bunfig.toml that Bun may have auto-loaded
    profilethe profile is missing or invalid (the remaining checks are skipped)
    env <NAME>a variable the profile names is not set (one row per variable)
    embedderthe embedder cannot be built, does not answer, or returns no vector
    reposlisting repositories failsthe profile has no code host, or the hosts list no repositories
    indexthe index cannot be opened, or holds repos built with a different embedder than the profile configuresnot built yet; the last sync did not finish for some repos; listed repos are not indexed; a repo's index is older than 7 days
    linksthe link store cannot be readthe store is empty although a code host lists pull requests
    token <id>a connector's token_expires date has passed (one row per entry)the date is within two weeks
    remotewith --check-remote: a clone is behind its default branch on the host
    writeswrites are on for this command line: it names the kinds, the audit command and how to turn them off
    tool packsnever: it lists the configured packs and their tools
    $ safran doctor
    ✔ bun             Bun 1.3.2
    ✔ git             git version 2.50.1 (Apple Git-155)
    ✔ launch          started through bin/safran: Bun loaded no .env or bunfig.toml from this directory
    ✔ profile         safran.yaml (acme): 1 tracker, 1 code host
    ✔ env JIRA_TOKEN  set (used by trackers.jira.token_env)
    ✔ embedder        ollama:bge-m3 answered in 26 ms (1024 dimensions)
    ✔ repos           2 repos listed
    ✔ index           2 repos, 5 chunks, embedder ollama:bge-m3, oldest index just now
    ✔ links           3 pull requests, 2 with a ticket, refreshed just now
    ✔ writes          off — the profile has `writes.enabled: false` (the default)
    ✔ tool packs      none configured
    
    ✔ Everything is in place.

    The same command on the profile safran init just wrote, before any token is set and before the first sync:

    $ safran doctor
    ✔ bun             Bun 1.3.2
    ✔ git             git version 2.50.1 (Apple Git-155)
    ✔ launch          started through bin/safran: Bun loaded no .env or bunfig.toml from this directory
    ✔ profile         safran.yaml (acme): 1 tracker, 1 code host
    ✘ env JIRA_EMAIL  not set (used by trackers.jira.email_env)
                      → Export JIRA_EMAIL in your shell, or put it in the .env file next to the profile.
    ✘ env JIRA_TOKEN  not set (used by trackers.jira.token_env)
                      → Export JIRA_TOKEN in your shell, or put it in the .env file next to the profile.
    ✔ embedder        ollama:bge-m3 answered in 30 ms (1024 dimensions)
    ✔ repos           1 repo listed
    ! index           not built yet
                      → Run `safran sync`.
    ✔ links           not applicable: no code host in the profile lists pull requests
    ✔ writes          off — the profile has `writes.enabled: false` (the default)
    ✔ tool packs      none configured
    
    ✘ 2 checks failed, 1 warning.

    With a token_expires date two weeks away or less, --check-remote, writes enabled and a tool pack configured, the rows that differ look like this (unchanged rows are cut):

    $ safran doctor --check-remote --profile /work/acme/safran.yaml
    …
    ! token jira      The token of tracker "jira" expires in 9 days (2026-12-02).
                      → Create a new token, put it in the environment, and update `token_expires` in the profile.
    …
    ! remote          1 of 2 clones behind the remote default branch: ledger
                      → Run `safran sync --profile /work/acme/safran.yaml`. Search answers from the commit that was indexed.
    ✔ index           2 repos, 5 chunks, embedder ollama:bge-m3, oldest index just now
    ✔ links           3 pull requests, 2 with a ticket, refreshed just now
    ! writes          ON: ticket.comment, pull_request.reply (each one previewed, then confirmed)
                      → Agents using this profile can post under the connector tokens' accounts. Audit: `safran writes log --profile /work/acme/safran.yaml`. Turn off: `safran profile set writes.enabled false --profile /work/acme/safran.yaml`.
    ✔ tool packs      review-notes (review-notes): list_review_notes, add_review_note
    
    ! No failures, 3 warnings.

    Token expiry comes from the token_expires dates in the profile; no token is read. When dates are recorded and none is close, one tokens row says so.

    JSON

    One entry per check, in the order above. status is ok, warn or fail; hint is null when there is nothing to do. The middle of the array is cut here.

    {
      "ok": true,
      "failed": 0,
      "warnings": 0,
      "checks": [
        {
          "name": "bun",
          "status": "ok",
          "detail": "Bun 1.3.2",
          "hint": null
        },
        {
          "name": "embedder",
          "status": "ok",
          "detail": "ollama:bge-m3 answered in 31 ms (1024 dimensions)",
          "hint": null
        },
        {
          "name": "links",
          "status": "ok",
          "detail": "3 pull requests, 2 with a ticket, refreshed just now",
          "hint": null
        }
      ]
    }

    Exit codes and mistakes

    CodeWhen
    0No check failed. Warnings do not change the exit code.
    1At least one check failed.
    • Using it as a liveness probe for trackers. doctor does not call the trackers; it only checks that their variables are set. Use safran profile check --online for that.
    • An "older than 7 days" warning. It means the code has probably moved on since the last sync. Run safran sync; see keeping data fresh.
    • "Built with another embedder". Vectors of different models cannot be compared, so search refuses those repos until they are re-indexed or embeddings: is switched back.

    safran plugins

    safran plugins

    Lists the connector plugins by kind, with the profile key where each type is used: the built-in ones, plus the ones a profile loads through its plugins: list. It has no options of its own, reads the profile if there is one (types the profile uses are marked in use, types from its modules from the profile's plugins), and works without a profile. It contacts no service. Loading a profile's plugin modules imports them, so it follows the trust rule.

    $ safran plugins
    Trackers  trackers[].type
      azure-boards   Azure Boards work items (Azure DevOps Services and Server); comments and child work items can be
                     written when the profile enables writes
      github-issues  GitHub Issues (github.com and GitHub Enterprise Server): issues, sub-issues, milestones, comment and
                     sub-issue writes
      jira           Jira Cloud (REST v3) and Jira Data Center / Server (REST v2); read-only unless the profile enables
                     writes (comments, child tickets)
      linear         Linear issues through the GraphQL API; comments and sub-issues can be written when the profile allows
                     it
    
    Code hosts  code.hosts[].type
      azure-repos  Azure Repos (Azure DevOps Services and Server)
      github       GitHub and GitHub Enterprise Server
      gitlab       GitLab (gitlab.com and self-managed)
      local        Directories on this machine (read in place, no clone)
    
    Doc sources  docs[].type
      confluence  Confluence Cloud and Data Center pages that tickets link to, read-only
    
    Embedders  embeddings.type
      ollama             Local embeddings via Ollama (default model: bge-m3, multilingual)
      openai-compatible  Embeddings from any OpenAI-compatible /embeddings endpoint
    
    No profile at safran.yaml; showing the built-in plugins. Create one with `safran init`.

    Each type has its own page under connectors, with its configuration fields. The command lists types and descriptions, not fields.

    JSON

    One flat list sorted by type. source is built-in, profile (from a module under plugins:) or code; in_profile says whether the profile uses the type. The list is cut after two entries here.

    {
      "plugins": [
        {
          "kind": "tracker",
          "type": "azure-boards",
          "description": "Azure Boards work items (Azure DevOps Services and Server); comments and child work items can be written when the profile enables writes",
          "source": "built-in",
          "in_profile": false
        },
        {
          "kind": "code-host",
          "type": "azure-repos",
          "description": "Azure Repos (Azure DevOps Services and Server)",
          "source": "built-in",
          "in_profile": false
        }
      ]
    }

    Exit codes

    0 when the list was printed; 1 when the profile exists but cannot be read, its plugin modules are not trusted (FORBIDDEN) or a module cannot be loaded (PLUGIN_NOT_FOUND).

    safran discover

    safran discover [options]

    Drafts the knowledge part of the profile, which is groups of repositories, teams and what they own, tracker project keys, glossary candidates, conventions and the ticket language, from merged pull requests and ticket titles. It uses statistics and heuristics, no language model. The result is a draft: every finding carries a confidence, and low-confidence items must be confirmed by a person. The method, its limits and how to review a draft are in the discovery guide.

    What it touches: it lists repositories and tracker projects, refreshes the local link store from the code hosts (unless --no-refresh), and reads a sample of ticket titles from the trackers. It writes one file: the draft, by default safran.draft.yaml next to the profile. Your profile is not modified unless you pass --write --force.

    FlagValueDefaultMeaning
    --out <file>pathsafran.draft.yaml next to the profileWhere to write the draft. An existing draft is replaced.
    --writenoneoffWrite over the profile itself. Needs --force; cannot be combined with --out.
    --forcenoneoffAllow --write to replace the profile.
    --since <date>ISO date, such as 2026-01-0112 months backHow far back to read merged pull requests.
    --no-glossarynoneoffSkip glossary candidates.
    --no-refreshnoneoffUse the local link store as it is; fetch no pull requests.

    The output below comes from a deliberately tiny fixture (two repositories, three merged pull requests), which is why almost every finding says there is too little history. It shows the shape of the report: counts first, then findings by topic with their confidence, then what was added to the draft.

    $ safran discover --no-refresh
    Safran discovery — draft for review (statistics and heuristics, no language model)
    2 repos (2 cloned), 3 merged PRs read, 2 used, 2 with a ticket (0% without), 2 ticket titles
    sampled.
    Ignored PRs: 1 by bots.
    Legend: + added to the draft, · observation only; [high] [med ] [low ] = confidence.
    
    Coverage (2)
      · [high] pull requests ignored as noise
               1 of 3 merged PRs were ignored: 1 by bot accounts, 0 merge/revert PRs, 0 mass changes, 0
               naming many tickets at once, 0 repeats of the same change to another branch.
      · [low ] ticket references in merged PRs
               All 2 merged PRs read reference a ticket.
    
    Repo groups (1)
      · [high] repos already grouped
               2 repos already sit in a group in the profile and were left as written.
    
    Teams (1)
      · [low ] repos with too little history
               Not enough history for 1 repo: fewer than 3 ticket-linked PRs per project (payments-api).
               They were not assigned.
    
    Glossary candidates (1)
      · [low ] glossary candidates
               0 recurring terms in 2 sampled ticket titles: 0 already appear in code or changed paths,
               0 have too few focused PRs to compare, 0 have no path word that stands out, 0 point at a
               code word a commoner term already took; 0 proposed. Single words only; expect misses and
               some wrong pairs.
    
    Languages (1)
      · [low ] languages.tickets
               1 of 2 sampled ticket titles look Turkish, 1 English, 0 another language, 0 undecided.
               Too few to say (10 classified titles needed). Language detection is a heuristic
               (Turkish-only letters and small word lists for tr/en). `languages.tickets` was left as it
               is.
    
    Added to the draft: 0 project key(s), 0 grouped repo(s), 0 team(s), 0 repo(s) on existing teams, 0
    glossary candidate(s), 0 convention(s).
    Findings by confidence: 2 high, 0 medium, 4 low.
    
    ✔ Wrote the draft to safran.draft.yaml
    → It is a draft, not your profile. Review it (start with the items marked low),
      then rename it over safran.yaml and run `safran profile check --profile safran.yaml`.

    Progress (the step being worked on) goes to stderr while it runs.

    JSON

    The document has six keys. stats and one element of findings are shown in full; profile is the complete draft profile as an object (its keys are left exactly as they are in the profile), and a finding's detail is kept as produced.

    {
      "draft_file": "/work/acme/safran.draft.yaml",
      "replaced": true,
      "wrote_profile": false,
      "stats": {
        "repos": 2,
        "cloned_repos": 2,
        "pull_requests": 3,
        "pull_requests_used": 2,
        "dropped": {
          "bot": 1,
          "noise_title": 0,
          "mass_change": 0,
          "many_tickets": 0,
          "duplicate": 0
        },
        "linked_pull_requests": 2,
        "unlinked_share": 0,
        "tickets_sampled": 2,
        "tickets_failed": 0,
        "added": {
          "projects": 0,
          "grouped_repos": 0,
          "teams": 0,
          "team_repos": 0,
          "glossary": 0,
          "conventions": 0,
          "languages": false
        },
        "findings": {
          "low": 3,
          "medium": 0,
          "high": 2
        }
      },
      "findings": [
        {
          "kind": "coverage",
          "subject": "pull requests ignored as noise",
          "confidence": "high",
          "evidence": "1 of 3 merged PRs were ignored: 1 by bot accounts, 0 merge/revert PRs, 0 mass changes, 0 naming many tickets at once, 0 repeats of the same change to another branch.",
          "detail": {
            "applied": false,
            "bot": 1,
            "noiseTitle": 0,
            "massChange": 0,
            "manyTickets": 0,
            "duplicate": 0
          }
        }
      ],
      "profile": {}
    }

    In this listing findings is cut to its first element and profile is emptied; the stats come from a run with --no-glossary, which is why they count one finding fewer than the human output above. The types behind the document are in the @safran/discover reference.

    Exit codes and mistakes

    0 when the draft was written, 1 when discovery stopped with an error, 2 for a wrong command line, 130 when interrupted.

    $ safran discover --write
    ✘ --write replaces your profile with the draft
    → Pass --write --force if that is what you want; without --write the draft goes to safran.draft.yaml for review.
    • Treating the draft as the profile. Nothing reads safran.draft.yaml. Review it, rename it over the profile, then run safran profile check.
    • Running it against local hosts only. Teams and glossary come from merged pull requests; a local host lists none, so there is nothing to infer from.
    • --out pointing at the profile. Refused; replacing the profile is what --write --force is for.
    • Expecting comments to survive. The draft is generated from the parsed profile, with a header comment and # discovered marks on what was added; comments in your own file are not carried over. Keep the profile in version control before replacing it.

    safran setup claude

    safran setup claude [options]

    Prints the command that registers Safran's MCP server in Claude Code, or with --run runs it. The profile is validated first: nothing is printed or run for a profile that does not load. The command always uses this checkout's bin/safran and the absolute path of the profile, because Claude Code starts the server from whatever project you are in, and a named profile is what makes its plugins: and writes: settings apply. Without --run nothing on the machine is changed.

    FlagValueDefaultMeaning
    --scope <scope>local, project or userlocalWhere Claude Code stores the registration.
    --httpnoneoffRegister a running safran mcp --http server instead of starting one over stdio.
    --port <n>port number3939With --http: the server's port.
    --token-env <NAME>variable namenoneWith --http: the variable whose bearer token the server expects.
    --name <name>textsafranName of the server in Claude Code.
    --printnoneonOnly print the command.
    --runnoneoffRun the command with the claude on your PATH.
    $ safran setup claude --profile /work/acme/safran.yaml
    Register the Safran MCP server for acme in Claude Code (scope local: you, in the project you run the command in):
    
      claude mcp add --transport stdio --scope local safran -- /work/safran/bin/safran mcp --profile /work/acme/safran.yaml
    
    Nothing was changed. Run the line above, or let Safran run it: safran setup claude --run --profile /work/acme/safran.yaml
    
    Writes through this server: off: the profile does not enable them, so the server only reads.
    In a session, /mcp shows the server; restart Claude Code if the tools do not appear. Undo: claude mcp remove safran --scope local
    
    Or load the plugin instead: the skills and the same server together. Use one of the two, not both, or every tool is registered twice.
    
      claude --plugin-dir /work/safran/plugin
    
      Its one option, `profile`, takes the absolute path: /work/acme/safran.yaml
      Claude Code asks for it when the plugin is enabled; change it later under /plugin, then reconnect with /mcp.

    /work/safran stands for the Safran checkout. The output ends with the alternative: loading the plugin, which brings the skills and the same server together. Use one of the two, not both.

    The line about writes is the one to read. When the profile enables writes, the registered server applies them, because the command names the profile:

    ! Writes through this server: ON for ticket.comment: the command names the profile, so its `writes:` section applies. For a read-only server add --no-writes after `mcp`.

    Setting Safran up from inside Claude Code, with the /safran:setup skill, is described on setting up.

    JSON

    command is the argument list, command_line the same as one shell line; serve_command_line (HTTP only) starts the server the registration points at; ran is null without --run.

    {
      "profile_file": "/work/acme/safran.yaml",
      "launcher": "/work/safran/bin/safran",
      "transport": "http",
      "scope": "local",
      "name": "safran",
      "command": [
        "claude",
        "mcp",
        "add",
        "--transport",
        "http",
        "--scope",
        "local",
        "safran",
        "http://127.0.0.1:3939/mcp",
        "--header",
        "Authorization: Bearer $SAFRAN_MCP_TOKEN"
      ],
      "command_line": "claude mcp add --transport http --scope local safran http://127.0.0.1:3939/mcp --header \"Authorization: Bearer $SAFRAN_MCP_TOKEN\"",
      "url": "http://127.0.0.1:3939/mcp",
      "serve_command_line": "/work/safran/bin/safran mcp --profile /work/acme/safran.yaml --http --token-env SAFRAN_MCP_TOKEN",
      "remove_command_line": "claude mcp remove safran --scope local",
      "plugin": {
        "dir": "/work/safran/plugin",
        "command_line": "claude --plugin-dir /work/safran/plugin",
        "option": "profile",
        "option_value": "/work/acme/safran.yaml"
      },
      "writes": {
        "enabled": false,
        "allow": []
      },
      "ran": null
    }

    Exit codes and mistakes

    0 when the command was printed (or ran successfully); 1 when the profile does not load or the claude command fails; 2 for a usage error.

    $ safran setup claude --scope everywhere
    ✘ --scope must be one of local, project, user; got "everywhere"
    • Registering the server and loading the plugin. Every tool is then registered twice. Pick one.
    • A relative profile path in a hand-written command. Claude Code starts the server in the project you are in; setup claude writes the absolute path for that reason.
    • --http without a running server. The command registers a URL; start safran mcp --http yourself (the JSON output has the line).