bridge.yaml is the project-local configuration file for Bridge. It tells the CLI what your project is called and which named providers an agent can read from.
Bridge keeps the config intentionally small:
- one file
- one project name
- one map of named providers
Where Bridge looks for configuration
Bridge readsbridge.yaml from the current working directory.
That means:
bridge initcreatesbridge.yamlin the directory where you run itbridge read,bridge ls,bridge status, andbridge connectexpect the file to exist in the current directory- Bridge does not currently search parent directories for a config file
Minimal configuration
Runningbridge init creates a minimal config like this:
bridge init uses the current directory name as the default project name. If bridge.yaml already exists, the command does not overwrite it.
A real example
Most projects will start with one local provider and one database provider:filesis a filesystem provider rooted at./docslocaldbis a SQLite provider backed by a local file and allowed to create it on first usedbis a Postgres provider whose connection string comes from an environment variable
Top-level fields
| Field | Type | Required | What it does |
|---|---|---|---|
version | string | yes | Configuration format version. Bridge currently writes "1". |
name | string | yes | Project name. bridge init defaults this to the current directory name. |
providers | map | yes | Named provider definitions keyed by provider alias such as files or db. |
Provider entries
Each entry underproviders is keyed by the name you want agents and humans to use at the command line.
- is chosen by you
- is what you pass to
--from - should be short and memorable
| Field | Type | Required | What it does |
|---|---|---|---|
type | string | yes | Provider type such as filesystem, sqlite, or postgres |
uri | string | yes | Connection target for that provider |
Supported provider types today
Bridge currently recognizes these provider types:| Type | Accepted URI forms | Notes |
|---|---|---|
filesystem | file://./path, file:///absolute/path | Must point to an existing directory |
sqlite | sqlite://./local.db, sqlite:///absolute/path.db, sqlite://:memory: | Used for listing tables and reading rows from a local SQLite database |
postgres | postgres://..., postgresql://... | Used for listing tables and reading rows |
bridge connect with a literal URI, Bridge infers the type from the URI scheme automatically.
Examples:
bridge connect with an environment variable name, Bridge requires --type and writes the placeholder into bridge.yaml for you:
bridge connect also verifies the provider before it saves the config. Use --no-verify if you want to keep a provider definition before the backend is reachable, and use --force if you want to replace an existing provider name.
Filesystem URIs
Filesystem providers usefile:// URIs.
Relative paths
bridge.yaml lives.
Absolute paths
Postgres URIs
Postgres providers use standard connection strings:SQLite URIs
SQLite providers usesqlite:// URIs.
Relative paths
Absolute paths
Modes
- use
?mode=roto open an existing database in read-only mode - use
?mode=rwcto allow SQLite to create the database file on first connection - use
sqlite://:memory:for an in-memory database
Environment variable expansion
Bridge expands environment variables inside strings using the exact${VAR_NAME} syntax.
Bridge writes that ${VAR_NAME} form automatically when you connect with a bare env var name such as DATABASE_URL.
Example:
- a single variable in a full string like
${DATABASE_URL} - multiple variables inside one URI
bridge status, bridge ls, and bridge read fail with env_var_not_set. bridge connect is slightly different: when it cannot verify because a required variable is missing in your current shell, it saves the placeholder and marks the provider as unverified.
How Bridge updates the file
bridge init
- creates
bridge.yamlif it does not exist - uses the current directory name as
name - initializes
providersas an empty map - returns
"already_exists"instead of overwriting an existing file
bridge connect
- loads the existing config
- accepts either a literal URI or a bare environment variable name as
<target> - infers the provider type from a literal URI scheme when possible
- requires
--typewhen<target>is an environment variable name - refuses to overwrite an existing provider name unless you pass
--force - verifies the target by default before saving
- writes the updated
bridge.yamlback to disk after successful verification - can save an unverified provider if you pass
--no-verify, or if a placeholder variable is not set in the current shell during verification
provider_already_exists unless you pass --force.
bridge remove
- deletes the named provider from
providers - writes the updated file back to disk
Common mistakes
Missing config file
Missing config file
If you run a Bridge command in a directory without
bridge.yaml, Bridge returns config_not_found. Run bridge init first, or change into the project directory that already contains the config file.Invalid or unsupported URI
Invalid or unsupported URI
Bridge currently understands
file://, sqlite://, postgres://, and postgresql:// schemes. A value like redis://localhost will fail with invalid_uri.Invalid connect target
Invalid connect target
A
bridge connect target must be either a full URI such as postgres://localhost:5432/mydb or a bare environment variable name such as DATABASE_URL. Placeholder syntax like ${DATABASE_URL} is for bridge.yaml, not for the CLI input.Missing environment variable
Missing environment variable
If your config references
${DATABASE_URL} and that variable is not set, runtime commands fail fast with env_var_not_set rather than guessing or continuing with a partial value. During bridge connect, Bridge can still save the placeholder as unverified if it cannot verify in the current shell.Duplicate provider name
Duplicate provider name
If you try to connect
db twice, Bridge now returns provider_already_exists instead of silently replacing the existing provider. Re-run with --force when you intend to overwrite it.Filesystem path points to the wrong thing
Filesystem path points to the wrong thing
A filesystem provider must point to an existing directory. If the directory does not exist,
bridge connect fails verification unless you pass --no-verify. If the path resolves outside the configured root during reads, Bridge returns a provider error.Configuration philosophy
Bridge keeps configuration intentionally narrow:- one project-local file
- explicit named providers
- URI-based backend selection
- environment variables for secrets
Next steps
Providers
Learn exactly how each provider behaves at runtime.
Quickstart
Start with the minimal Bridge workflow and connect your first provider.
CLI interface
See how Bridge turns configuration into structured JSON commands and output.