{"id":29190814,"url":"https://github.com/firebolt-db/fb-cli","last_synced_at":"2025-07-02T00:11:49.778Z","repository":{"id":299464342,"uuid":"1002910725","full_name":"firebolt-db/fb-cli","owner":"firebolt-db","description":"Firebolt CLI \u0026 REPL","archived":false,"fork":false,"pushed_at":"2025-06-16T17:15:12.000Z","size":36,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-16T18:30:36.089Z","etag":null,"topics":["cli","core","firebolt","repl","sql"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firebolt-db.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-16T10:32:36.000Z","updated_at":"2025-06-16T11:04:41.000Z","dependencies_parsed_at":"2025-06-16T18:31:52.396Z","dependency_job_id":null,"html_url":"https://github.com/firebolt-db/fb-cli","commit_stats":null,"previous_names":["firebolt-db/fb-cli"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/firebolt-db/fb-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebolt-db%2Ffb-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebolt-db%2Ffb-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebolt-db%2Ffb-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebolt-db%2Ffb-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firebolt-db","download_url":"https://codeload.github.com/firebolt-db/fb-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebolt-db%2Ffb-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263052434,"owners_count":23406106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","core","firebolt","repl","sql"],"created_at":"2025-07-02T00:11:46.026Z","updated_at":"2025-07-02T00:11:49.758Z","avatar_url":"https://github.com/firebolt-db.png","language":"Rust","readme":"# fb-cli\n\nFirebolt CLI; work with [Firebolt](https://www.firebolt.io/) and [Firebolt Core](https://github.com/firebolt-db/firebolt-core).\n\n## Examples\n\n```\n➤  fb select 42\n ?column?\n---------\n       42\n\nTime: 41.051ms\n```\n\n### REPL\n\n```\n➤  fb\n=\u003e select 42\n ?column?\n---------\n       42\n\nTime: 40.117ms\n\n=\u003e create table t (a int);\nTable 't' already exists.\n\nTime: 87.747ms\n\n=\u003e insert into t select * from generate_series(1, 100000000);\n/\n```\n\nAlso support history + search in it (`CTRL+R`).\n\n## Help\n\n```\n➤ fb --help\nUsage: fb [OPTIONS]\n\nPositional arguments:\n  query                    Query command(s) to execute. If not specified, starts the REPL\n\nOptional arguments:\n  -c, --command COMMAND    Run a single command and exit\n  -C, --core               Preset of settings to connect to Firebolt Core\n  -h, --host HOSTNAME      Hostname (and port) to connect to\n  -d, --database DATABASE  Database name to use\n  -f, --format FORMAT      Output format (e.g., TabSeparatedWithNames, PSQL, JSONLines_Compact, Vertical, ...)\n  -e, --extra EXTRA        Extra settings in the form --extra \u003cname\u003e=\u003cvalue\u003e\n  -l, --label LABEL        Query label for tracking or identification\n  -j, --jwt JWT            JWT for authentication\n  --sa-id SA-ID            Service Account ID for OAuth authentication\n  --sa-secret SA-SECRET    Service Account Secret for OAuth authentication\n  --jwt-from-file          Load JWT from file (~/.firebolt/jwt)\n  --bearer BEARER          Firebolt bearer token for authentication\n  --oauth-env OAUTH-ENV    OAuth environment to use (e.g., 'app' or 'staging'). Used for Service Account authentication (default: staging)\n  -v, --verbose            Enable extra verbose output\n  --concise                Suppress time statistics in output\n  --hide-pii               Hide URLs that may contain PII in query parameters\n  --no-spinner             Disable the spinner in CLI output\n  --update-defaults        Update default configuration values\n  -V, --version            Print version\n  --help                   Show help message and exit\n```\n\n## Install\n\n1) Install `cargo`: https://doc.rust-lang.org/cargo/getting-started/installation.html \n    1) Add `source \"$HOME/.cargo/env\"` to your `~/.bashrc` (or `~/.zshrc`).\n2) Install `pkg-config`: `sudo apt install pkg-config` (a default dependency for Ubuntu)\n3) Install `openssl`: `sudo apt install libssl-dev` (a default dependency for Ubuntu)\n4) Clone \u0026 Build \u0026 Install:\n```\ngit clone git@github.com:firebolt-db/fb-cli.git\ncd fb-cli\ncargo install --path . --locked\n```\n4) That's it: you should be able to run `fb` // or at least `~/.cargo/bin/fb` if cargo env isn't caught up.\n\n## Shortcuts\n\nMost of them from https://github.com/kkawakam/rustyline:\n\n| Keystroke             | Action                                                                      |\n| --------------------- | --------------------------------------------------------------------------- |\n| Enter                 | Finish the line entry                                                       |\n| Ctrl-R                | Reverse Search history (Ctrl-S forward, Ctrl-G cancel)                      |\n| Ctrl-U                | Delete from start of line to cursor                                         |\n| Ctrl-W                | Delete word leading up to cursor (using white space as a word boundary)     |\n| Ctrl-Y                | Paste from Yank buffer                                                      |\n| Ctrl-\\_               | Undo                                                                        |\n\nSome of them specific to `fb`:\n| Keystroke             | Action                                                                      |\n| --------------------- | --------------------------------------------------------------------------- |\n| Ctrl-C                | Cancel current input.                                                       |\n| Ctrl-O                | Insert a newline                                                            |\n\n\n## Defaults\n\nCan update defaults one and for all by specifying `--update-defaults`: during this application old defaults are **not** applied.\n\nNew defaults are going to be stored at `~/.firebolt/fb_config`.\n\n\n```\n~ ➤  fb select 42\n ?column?\n---------\n       42\n\nTime: 40.342ms\n\n~ ➤  fb select 42 --format CSVWithNames --concise --update-defaults\n\"?column?\"\n42\n\n~ ➤  fb select 42\n\"?column?\"\n42\n\n~ ➤  fb select 42 --verbose # defauls are merged with new args\nURL: http://localhost:8123/?database=local_dev_db\u0026mask_internal_errors=1\nQUERY: select 42\n\"?column?\"\n42\n```\n\n## Queries against FB 2.0 using Service Account\n\nSpecify:\n- Service Account ID;\n- Service Account Secret;\n- Environment\n\nNote: The token is saved in `~/.firebolt/fb_sa_token/` and will be reused if the account ID and secret match and the token is less than half an hour old.\n\n\n```\n➤  fb --sa-id=${SA_ID} --sa-secret=${SA_SECRET} --oauth-env=app \\\n  -h ${ACCOUNT_ID}.api.us-east-1.app.firebolt.io -d ${DATABASE_NAME}\n```\n\nRead more about getting service accounts [here](https://docs.firebolt.io/guides/managing-your-organization/service-accounts).\n\n## Queries against FB 2.0\n\nSpecify:\n- host;\n- account_id;\n- bearer token (take it from browser);\n\n```\n➤  fb --host api.us-east-1.app.firebolt.io --verbose --extra account_id=12312312312 --bearer 'eyJhbGciOiJSUzI1NiI...'\n\n=\u003e show engines\nURL: https://api.us-east-1.app.firebolt.io/?database=db_1\u0026account_id=12312312\u0026output_format=JSON\u0026advanced_mode=1\nQUERY: show engines\n┌─engine_name─────────────┬─engine_owner────────────────┬─type─┬─nodes─┬─clusters─┬─status───────────────┬─auto_start─┬─auto_stop─┬─initially_stopped─┬─url────────────────────────────────────────────────────────────────────────────────────────────────────┬─default_database───────────────────┬─version─┬─last_started──────────────────┬─last_stopped──────────────────┬─description─┐\n│ pre_demo_engine1        │ user@firebolt.io            │ S    │     2 │        1 │ ENGINE_STATE_STOPPED │          t │        20 │                 f │ api.us-east-1.app.firebolt.io?account_id=1321231\u0026engine=pre_demo_engine1                               │                                    │ latest  │ 2024-02-07 01:19:19.81689+00  │ 2024-02-07 01:44:15.930845+00 │             │\n│ pre_demo_engine2        │ user@firebolt.io            │ S    │     2 │        1 │ ENGINE_STATE_STOPPED │          t │        20 │                 f │ api.us-east-1.app.firebolt.io?account_id=1321231\u0026engine=pre_demo_engine2                               │        pre_demo_validation_testdb1 │ latest  │ 2024-02-07 01:21:36.274962+00 │ 2024-02-07 02:32:05.403539+00 │             │\n└─────────────────────────┴─────────────────────────────┴──────┴───────┴──────────┴──────────────────────┴────────────┴───────────┴───────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────────────────────────┴─────────┴───────────────────────────────┴───────────────────────────────┴─────────────┘\n\n=\u003e set engine=user5_engine_1\nURL: https://api.us-east-1.app.firebolt.io/?database=db_1\u0026engine=user5_engine_1\u0026account_id=1321231\u0026output_format=JSON\u0026advanced_mode=1\n\n=\u003e select 42\nURL: https://api.us-east-1.app.firebolt.io/?database=db_1\u0026engine=user5_engine_1\u0026account_id=1321231\u0026output_format=JSON\u0026advanced_mode=1\nQUERY: select 42\n ?column?\n---------\n       42\n\nTime: 275.639ms\n```\n\n## Set and Unset\n\nIn interactive mode one can dynamically update extra arguments:\n- `set key=value;` to set the argument;\n- `unset key;` to unset it.\n\n```\n=\u003e select E'qqq';\nURL: http://localhost:8123/?database=local_dev_db\nQUERY: select E'qqq';\n ?column?\n---------\n      qqq\n\nTime: 40.745ms\n\n=\u003e set format = Vertical;\n=\u003e select E'qqq';\nURL: http://localhost:8123/?database=local_dev_db\nQUERY: select E'qqq';\nRow 1:\n──────\n?column?: qqq\n\nTime: 38.888ms\n\n=\u003e set cool_mode=disabled;\n=\u003e select E'qqq';\nURL: http://localhost:8123/?database=local_dev_db\u0026cool_mode=disabled\nQUERY: select E'qqq';\nUnknown setting cool_mode\n\nTime: 36.802ms\n\n=\u003e unset cool_mode\n=\u003e select E'qqq';\nURL: http://localhost:8123/?database=local_dev_db\nQUERY: select E'qqq';\nRow 1:\n──────\n?column?: qqq\n\nTime: 39.395ms\n\n=\u003e set enable_result_cache=disabled;\n=\u003e select E'qqq';\nURL: http://localhost:8123/?database=local_dev_db\u0026enable_result_cache=disabled\nQUERY: select E'qqq';\nRow 1:\n──────\nqqq: qqq\n\nTime: 41.671ms\n\n=\u003e unset enable_result_cache;\n=\u003e select E'qqq';\nURL: http://localhost:8123/?database=local_dev_db\nQUERY: select E'qqq';\nRow 1:\n──────\n?column?: qqq\n\nTime: 39.453ms\n\n=\u003e \n```\n\n## License\n\nSee [LICENSE](LICENSE.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebolt-db%2Ffb-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirebolt-db%2Ffb-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebolt-db%2Ffb-cli/lists"}