{"id":13594778,"url":"https://github.com/martineausimon/nvim-bard","last_synced_at":"2025-08-03T08:05:57.141Z","repository":{"id":181621867,"uuid":"667049264","full_name":"martineausimon/nvim-bard","owner":"martineausimon","description":"A minimal plugin to interact with Google Bard in Neovim","archived":false,"fork":false,"pushed_at":"2023-08-29T15:17:09.000Z","size":35,"stargazers_count":29,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T01:51:25.577Z","etag":null,"topics":["ai","bard","bard-api","google-bard","neovim"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/martineausimon.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}},"created_at":"2023-07-16T13:26:43.000Z","updated_at":"2024-08-28T19:13:08.000Z","dependencies_parsed_at":"2024-01-14T16:58:56.446Z","dependency_job_id":"13c5977c-5d1d-4608-80a5-9486069cab8d","html_url":"https://github.com/martineausimon/nvim-bard","commit_stats":null,"previous_names":["martineausimon/nvim-bard"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/martineausimon/nvim-bard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martineausimon%2Fnvim-bard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martineausimon%2Fnvim-bard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martineausimon%2Fnvim-bard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martineausimon%2Fnvim-bard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martineausimon","download_url":"https://codeload.github.com/martineausimon/nvim-bard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martineausimon%2Fnvim-bard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268512159,"owners_count":24261887,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","bard-api","google-bard","neovim"],"created_at":"2024-08-01T16:01:39.022Z","updated_at":"2025-08-03T08:05:57.122Z","avatar_url":"https://github.com/martineausimon.png","language":"Lua","funding_links":[],"categories":["Lua","Conversation-focused"],"sub_categories":[],"readme":"# nvim-bard\n\n**nvim-bard** is a minimal plugin to interact with [Bard](https://bard.google.com) using [bardapi](https://github.com/dsdanielpark/Bard-API) python package.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/89019438/253833546-ecf7830b-c235-4cc8-9dad-9bf2615a0f41.png\"\u003e\n\u003c/p\u003e\n\n\u003e [!Important]\n\u003e Writing this plugin was a lot of fun, but I don't recommend using it for anything other than experimentation.  \n\u003e It works with bardapi which is not an official API and which can stop working at the slightest change in Bard's policy.\n\u003e Since August, it seems that it is necessary to update the cookie values regularly.  \n\u003e Also, this AI is quite slow and seems to me less efficient than ChatGPT for coding.\n\n## Requirements\n\nThis plugin requires `bardapi`\n\n```bash\npip install bardapi\n```\n\n## Bard API key\n\n1. Go to [bard.google.com](https://bard.google.com)\n2. Open developer tools\n3. Go to Application\n4. Go to Cookies\n5. Copy the content of `__Secure-1PSID` in `nvim-bard` config (`bard_api_key`)\n\n## Installation with config\n\n### [lazy.nvim](https://github.com/folke/lazy.nvim)\n\n```lua\n{\n  'martineausimon/nvim-bard',\n  dependencies = 'MunifTanjim/nui.nvim', -- only for \"popup\" mode\n  config = function()\n    require('nvim-bard').setup({\n      bard_api_key = \"\", --required\n      display_mode = \"popup\", -- \"popup\", \"vsplit\" or \"tabnew\"\n      mappings = {\n        toggle_bard = \"\u003cleader\u003eb\",\n        hide_bard = { \"q\", \"\u003cesc\u003e\" },\n        send_bard = \"\u003ccr\u003e\",\n        new_chat = \"\u003cc-n\u003e\"\n      },\n      options = {\n        ui = {\n          question = {\n            signs = {\n              sign = \"\",\n              hi = \"Function\",\n              style = \"single\" -- \"double\", \"none\", \"rounded\", \"solid\"\n            },\n            border = { -- only for \"popup\" mode\n              style = \"single\", -- \"double\", \"none\", \"shadow\", \"rounded\", \"solid\"\n              text = {\n                top = \"[Prompt]\"\n              }\n            },\n            winhighlight = \"Normal:Normal,FloatBorder:Normal\"\n          },\n          bard = {\n            signs = {\n              sign = \"🟆\",\n              hi = \"Statement\",\n              style = \"single\"\n            },\n            border = {\n              style = \"single\",\n              text = {\n                top = \"[Bard]\"\n              }\n            },\n            winhighlight = \"Normal:Normal,FloatBorder:Normal\"\n          }\n        },\n        buffer_options = {\n          signcolumn = 'yes:1',\n          filetype = 'markdown',\n          conceallevel = 3,\n          buftype = \"nofile\",\n        },\n      }\n    })\n  end\n}\n```\n\nSince august, Bard has updated it's policy and settings for different regions and you may need to set bard_api_key this way, retrieving the values from `Secure-1PSID`, `Secure-1PSIDCC`, et `Secure-1PSIDTS` :\n\n```lua\nrequire('nvim-bard').setup({\n  bard_api_key = {\n    psid   = \"xxxx\",\n    psidcc = \"xxxx\",\n    psidts = \"xxxx\"\n  },\n}\n```\n\n**⚠ `__Secure-1PSID` is private !** If you don't want to write this Bard API key in your config directly, you can store it in a local file (e.g. `$HOME/.bard_api_key`), and use the following function:\n\n```lua\nlocal api_key\nlocal file = io.open('/home/user/.bard_api_key', 'r')\nif file then\n  api_key = file:read()\n  file:close()\nend\n\n{\n  'martineausimon/nvim-bard',\n  dependencies = 'MunifTanjim/nui.nvim',\n  config = function()\n    require('nvim-bard').setup({\n      bard_api_key = api_key,\n    })\n  end\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartineausimon%2Fnvim-bard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartineausimon%2Fnvim-bard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartineausimon%2Fnvim-bard/lists"}