{"id":18448243,"url":"https://github.com/mergestat/scribe","last_synced_at":"2025-04-08T01:32:12.313Z","repository":{"id":65749895,"uuid":"594832060","full_name":"mergestat/scribe","owner":"mergestat","description":"Command line interface for translating natural language prompts into SQL queries using the OpenAI API","archived":false,"fork":false,"pushed_at":"2023-01-29T21:27:55.000Z","size":40,"stargazers_count":36,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-23T03:51:14.648Z","etag":null,"topics":["cli","database","openai","sql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mergestat.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}},"created_at":"2023-01-29T19:17:06.000Z","updated_at":"2025-02-03T02:15:38.000Z","dependencies_parsed_at":"2023-02-16T01:15:26.014Z","dependency_job_id":null,"html_url":"https://github.com/mergestat/scribe","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mergestat%2Fscribe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mergestat%2Fscribe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mergestat%2Fscribe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mergestat%2Fscribe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mergestat","download_url":"https://codeload.github.com/mergestat/scribe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247760474,"owners_count":20991497,"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","database","openai","sql"],"created_at":"2024-11-06T07:15:23.005Z","updated_at":"2025-04-08T01:32:11.007Z","avatar_url":"https://github.com/mergestat.png","language":"Go","readme":"# Scribe 📝\n\n`scribe` is a command line interface for translating natural language prompts into SQL.\nIt makes use of the [OpenAI codex models](https://beta.openai.com/docs/models/codex) (via API) to execute translations.\n\nThe user is expected to supply a database connection to the `scribe` command, so that the underlying SQL database may be introspected to supply tables, views, column names and column types to the prompt context.\n\nAdditional examples can be supplied from a SQL file to improve the quality of the generations.\n\n![Demo GIF](docs/demo.gif)\n\n## Usage\n\nYou will need to set the `OPENAI_API_KEY` environment variable.\n\n```sh\nscribe \"all users with first name patrick\" --connection \"pg://postgres:password@localhost/?sslmode=disable\"\nSELECT * FROM users WHERE first_name = 'patrick'\n```\n\nThe `--connection` flag is used to supply a connection string to the SQL database.\nIt can also be set with the `SCRIBE_CONNECTION` environment variable.\n\nYou may also supply **additional SQL examples** from a local file to improve the quality of translations.\nThis is not required, but can be valueable for supporting more complex query generation.\nUse the `--examples` flag to point to a local SQL file, which could look something like this:\n\n```sql\n-- select all git commits in the last 30 days\nSELECT * FROM git_commits WHERE author_when \u003e (now() - '30 days'::interval)\n```\n\n## Installation\n\n### Homebrew\n\n```sh\nbrew install mergestat/scribe/scribe\n```\n\n## Roadmap\n- Additional SQL database support (today only `postgres` is supported)\n- Interactive \"REPL\" like terminal experience\n- Option to execute queries on the underlying database and return results\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmergestat%2Fscribe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmergestat%2Fscribe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmergestat%2Fscribe/lists"}