{"id":14959669,"url":"https://github.com/aquasecurity/gobard","last_synced_at":"2025-10-24T18:30:24.698Z","repository":{"id":183139370,"uuid":"669669218","full_name":"aquasecurity/gobard","owner":"aquasecurity","description":"Unofficial Golang API for Bard Chat.","archived":false,"fork":false,"pushed_at":"2024-02-05T10:14:59.000Z","size":29,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-28T13:44:14.023Z","etag":null,"topics":["ai","bard","chatgpt","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","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/aquasecurity.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}},"created_at":"2023-07-23T03:39:49.000Z","updated_at":"2024-05-17T03:33:30.000Z","dependencies_parsed_at":"2024-09-22T10:01:02.213Z","dependency_job_id":null,"html_url":"https://github.com/aquasecurity/gobard","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.25,"last_synced_commit":"80a30fb690c78d305055856d58dcf1be88723750"},"previous_names":["aquasecurity/gobard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquasecurity%2Fgobard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquasecurity%2Fgobard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquasecurity%2Fgobard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquasecurity%2Fgobard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aquasecurity","download_url":"https://codeload.github.com/aquasecurity/gobard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219868210,"owners_count":16555876,"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":["ai","bard","chatgpt","golang"],"created_at":"2024-09-24T13:20:33.836Z","updated_at":"2025-10-24T18:30:24.288Z","avatar_url":"https://github.com/aquasecurity.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GOBARD\n\nUnofficial Golang API for Google BARD ChatBOT.\n\n## OBTAIN A BARD COOKIE\n\n1. Visit https://bard.google.com/ (login with your account).\n2. F12 for console.\n3. Session: Application → Cookies → `__Secure-1PSID` and `__Secure-1PSIDTS` cookie value.\n\n\u003e ATTENTION: Do not share your auth cookie.\n\n## HOWTO\n\n- Create a GOBARD object.\n- `.Ask(\"something\")`\n- `.GetAnswer()`\n- Did not like this answer ? `.Next()` and `.GetAnswer()` (or `.NextAnswer()`)\n- Want to go back to previous answer ? `.Prev()` and `.GetAnswer()` (or `.PrevAnswer()`)\n- Next question (`.Ask()`) will keep Chat reference until `.Reset()` is called.\n- `.Ask()` will use the \"current answer\" as a reference for the question.\n- Have Fun!\n\n## QUICK EXAMPLE\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/aquasecurity/gobard\"\n\t\"github.com/charmbracelet/glamour\"\n)\n\nvar render *glamour.TermRenderer\n\nfunc init() {\n\trender, _ = glamour.NewTermRenderer(\n\t\tglamour.WithAutoStyle(),\n\t\tglamour.WithWordWrap(80),\n\t)\n}\n\nfunc main() {\n\tPSID := os.Getenv(\"__Secure-1PSID\")\n\tif PSID == \"\" {\n\t\tmt.Fprintf(os.Stderr, \"__Secure-1PSID is not set\\n\")\n\t\tos.Exit(1)\n\t}\n\n\tPSIDTS := os.Getenv(\"__Secure-1PSIDTS\")\n\tif PSIDTS == \"\" {\n\t\tmt.Fprintf(os.Stderr, \"__Secure-1PSIDTS is not set\\n\")\n\t\tos.Exit(1)\n\t}\n\n\tbard01 := gobard.New(PSID, PSIDTS)\n\n\terr := bard01.Ask(\"Act as a simple calculator and calculate 2 + 2. Give the result only, no more words.\")\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Error: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n\tfor i := 0; i \u003c bard01.GetNumOfAnswers(); i++ {\n\t\tanswerMD, _ := render.Render(bard01.GetAnswer())\n\t\tfmt.Printf(\"%s\\n\", answerMD)\n\t\tbard01.Next()\n\t}\n\n\tbard01.Next() // will continue the conversation using the first answer as a base\n\n\terr = bard01.Ask(\"What if I add 3 to the result ?\")\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Error: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n\tfor i := 0; i \u003c bard01.GetNumOfAnswers(); i++ {\n\t\tanswerMD, _ := render.Render(bard01.GetAnswer())\n\t\tfmt.Printf(\"%s\\n\", answerMD)\n\t\tbard01.Next()\n\t}\n}\n```\n\n## NOTES\n\n1. Each Bard object, from `gobard.new()`, will have its own context until `Reset()` is called:\n\n```\nBard01: Act as a simple calculator and calculate 2 + 2. Give the result only, no more words.\n\n  Sure, I can help you with that.                                             \n                                                                              \n  2 + 2 = 4                                                                   \n                                                                              \n  I hope this is helpful. Let me know if you have any other questions.        \n\nBard02: Act as a simple calculator and calculate 4 + 8. Give the result only, no more words.\n\n  Sure, I can help you with that.                                             \n                                                                              \n  4 + 8 = 12                                                                  \n                                                                              \n  Is there anything else I can help you with?                                 \n\nBard01: What if I add 5 to the result ?\n\n  If you add 5 to the result of 2 + 2, you get 4 + 5 = 9.                     \n                                                                              \n  Is there anything else I can help you with today?                           \n\nBard02: What if I add 5 to the result ?\n\n  If you add 5 to the result of 4 + 8, you get 12 + 5 = 17.                   \n                                                                              \n  Is there anything else I can help you with?                   \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquasecurity%2Fgobard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faquasecurity%2Fgobard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquasecurity%2Fgobard/lists"}