From c4fafb1e13d1c1758428acb9dd219c93a20e79f5 Mon Sep 17 00:00:00 2001 From: Tomer Li Ran Date: Tue, 14 Apr 2026 16:11:12 +0200 Subject: [PATCH] Changed content to any storage any agent one CLI and sqlite content --- Cargo.toml | 2 +- LICENSE | 2 +- README.md | 14 ++++++++++---- src/cli.rs | 4 ++-- src/commands/connect.rs | 2 +- src/commands/init.rs | 2 +- src/commands/ls.rs | 2 +- src/commands/mod.rs | 2 +- src/commands/read.rs | 2 +- src/commands/remove.rs | 2 +- src/commands/status.rs | 2 +- src/config.rs | 2 +- src/context.rs | 2 +- src/error.rs | 2 +- src/main.rs | 2 +- src/provider/filesystem.rs | 2 +- src/provider/mod.rs | 2 +- src/provider/postgres.rs | 2 +- tests/cli_test.rs | 2 +- tests/filesystem_test.rs | 2 +- tests/postgres_test.rs | 2 +- 21 files changed, 31 insertions(+), 25 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4772b67..6c045e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "bridge-cli" version = "1.0.3" edition = "2021" rust-version = "1.94.1" -description = "One CLI. Any storage. Every agent." +description = "Any storage. Any agent. One CLI" license = "AGPL-3.0-only" repository = "https://github.com/usebridgeai/cli" homepage = "https://bridge.ls" diff --git a/LICENSE b/LICENSE index c1dca56..bf9bc7e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Bridge CLI - One CLI. Any storage. Every agent. +Bridge CLI - Any storage. Any agent. One CLI Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran This program is free software: you can redistribute it and/or modify diff --git a/README.md b/README.md index 0a44864..69d778c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Website

-**One CLI. Any storage. Every agent.** +**Any storage. Any agent. One CLI** Bridge gives AI agents a single interface to read structured context from any storage backend. One config file, one binary, JSON on stdout. The missing layer between your agent framework and your data. @@ -135,6 +135,7 @@ See [ARCHITECTURE.md](ARCHITECTURE.md) for the full design. | Provider | URI | `ls` returns | `read` returns | | ---------- | ------------------------- | --------------------- | --------------------------------------------- | | Filesystem | `file://./path` | Files and directories | File contents (text, JSON, or base64) | +| SQLite | `sqlite://./local.db` | Tables | All rows (`users`) or single row (`users/42`) | | Postgres | `postgres://host:port/db` | Tables | All rows (`users`) or single row (`users/42`) | ## Commands @@ -159,6 +160,9 @@ providers: files: type: filesystem uri: file://./docs + localdb: + type: sqlite + uri: sqlite://./local.db?mode=rwc db: type: postgres uri: ${DATABASE_URL} @@ -171,15 +175,17 @@ Bridge supports two setup patterns: - For quick local setup, pass a literal URI such as `postgres://localhost:5432/mydb`. - For safer shared or production setups, pass a bare environment variable name such as `DATABASE_URL` together with `--type postgres`. Bridge writes `uri: ${DATABASE_URL}` into `bridge.yaml` and resolves the real value at runtime. +SQLite is also supported through literal URIs such as `sqlite://./local.db`, or `sqlite://./local.db?mode=rwc` when you want SQLite to create the file on first use. + Bridge reads environment variables from the process environment when commands run. It does not automatically load a `.env` file for you. ## Security - **Path traversal protection:** Filesystem provider uses `canonicalize()` + `starts_with()` to block directory escape -- **SQL injection protection:** Postgres provider validates identifiers with strict regex and uses parameterized queries +- **SQL injection protection:** SQLite and Postgres providers validate identifiers with strict regex and use parameterized row reads - **Credential redaction:** URIs with passwords are redacted in all user-facing output - **Supply chain:** GitHub Actions pinned to SHA hashes -- **Testing:** 56 tests across CLI integration, filesystem, and Postgres (including Docker-based Postgres tests in CI) +- **Testing:** Integration coverage across the CLI, filesystem, SQLite, and Postgres providers (including Docker-based Postgres tests in CI) ## Roadmap @@ -189,8 +195,8 @@ Bridge reads environment variables from the process environment when commands ru - [x] Shell completions (bash, zsh, fish, PowerShell) - [x] Structured JSON output with metadata - [x] Environment variable expansion in config +- [x] SQLite provider - [ ] Write support (`bridge write`) -- [ ] SQLite provider - [ ] S3 provider - [ ] Vector store providers (Qdrant, Pinecone) diff --git a/src/cli.rs b/src/cli.rs index 78f2425..70ad08e 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify @@ -20,7 +20,7 @@ use clap_complete::Shell; #[command( name = "bridge", version, - about = "One CLI. Any storage. Every agent.", + about = "Any storage. Any agent. One CLI", long_about = "Bridge is a unified CLI that lets AI agents read context from any data source through a single interface." )] pub struct Cli { diff --git a/src/commands/connect.rs b/src/commands/connect.rs index 331dae1..d8e2491 100644 --- a/src/commands/connect.rs +++ b/src/commands/connect.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/commands/init.rs b/src/commands/init.rs index dfd75de..6710614 100644 --- a/src/commands/init.rs +++ b/src/commands/init.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/commands/ls.rs b/src/commands/ls.rs index 5c6a6af..dec53f4 100644 --- a/src/commands/ls.rs +++ b/src/commands/ls.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 931d6a1..ecd1c27 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/commands/read.rs b/src/commands/read.rs index 2be07f4..b73ad26 100644 --- a/src/commands/read.rs +++ b/src/commands/read.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/commands/remove.rs b/src/commands/remove.rs index e711bd4..c4ef44e 100644 --- a/src/commands/remove.rs +++ b/src/commands/remove.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/commands/status.rs b/src/commands/status.rs index 49ef978..3dba9fc 100644 --- a/src/commands/status.rs +++ b/src/commands/status.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/config.rs b/src/config.rs index 1baa2eb..747bdf7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/context.rs b/src/context.rs index 381defb..0fbb6bc 100644 --- a/src/context.rs +++ b/src/context.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/error.rs b/src/error.rs index 8c9fae8..7d0e38b 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/main.rs b/src/main.rs index a52d852..1d84aeb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/provider/filesystem.rs b/src/provider/filesystem.rs index 2d6e678..d7b5dce 100644 --- a/src/provider/filesystem.rs +++ b/src/provider/filesystem.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/provider/mod.rs b/src/provider/mod.rs index 81f74a7..b1b5e4f 100644 --- a/src/provider/mod.rs +++ b/src/provider/mod.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/src/provider/postgres.rs b/src/provider/postgres.rs index 3c5a03a..0da3f56 100644 --- a/src/provider/postgres.rs +++ b/src/provider/postgres.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/tests/cli_test.rs b/tests/cli_test.rs index 7a9c0e0..b427416 100644 --- a/tests/cli_test.rs +++ b/tests/cli_test.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/tests/filesystem_test.rs b/tests/filesystem_test.rs index 26494a9..f42b211 100644 --- a/tests/filesystem_test.rs +++ b/tests/filesystem_test.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify diff --git a/tests/postgres_test.rs b/tests/postgres_test.rs index 8a2c948..8e7762d 100644 --- a/tests/postgres_test.rs +++ b/tests/postgres_test.rs @@ -1,4 +1,4 @@ -// Bridge CLI - One CLI. Any storage. Every agent. +// Bridge CLI - Any storage. Any agent. One CLI // Copyright (c) 2026 Gabriel Beslic & Tomer Li Ran // // This program is free software: you can redistribute it and/or modify