{"html_url": "https://github.com/simonw/datasette/issues/2133#issuecomment-1671628602", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2133", "id": 1671628602, "node_id": "IC_kwDOBm6k_c5jowc6", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-09T15:28:42Z", "updated_at": "2023-08-09T15:28:42Z", "author_association": "OWNER", "body": "Neat idea! We already have this command:\r\n\r\n datasette install -r requirements.txt\r\n\r\nSo maybe `datasetet plugins --requirements` could generate a `requirements.txt` file which could be used there.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1841501975, "label": "[feature request]`datasette install plugins.json` options"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2133#issuecomment-1671634654", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2133", "id": 1671634654, "node_id": "IC_kwDOBm6k_c5jox7e", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-09T15:32:14Z", "updated_at": "2023-08-09T15:32:14Z", "author_association": "OWNER", "body": "```diff\r\ndiff --git a/datasette/cli.py b/datasette/cli.py\r\nindex 32266888..370b722c 100644\r\n--- a/datasette/cli.py\r\n+++ b/datasette/cli.py\r\n@@ -223,15 +223,22 @@ pm.hook.publish_subcommand(publish=publish)\r\n \r\n @cli.command()\r\n @click.option(\"--all\", help=\"Include built-in default plugins\", is_flag=True)\r\n+@click.option(\r\n+ \"--requirements\", help=\"Output requirements.txt of installed plugins\", is_flag=True\r\n+)\r\n @click.option(\r\n \"--plugins-dir\",\r\n type=click.Path(exists=True, file_okay=False, dir_okay=True),\r\n help=\"Path to directory containing custom plugins\",\r\n )\r\n-def plugins(all, plugins_dir):\r\n+def plugins(all, requirements, plugins_dir):\r\n \"\"\"List currently installed plugins\"\"\"\r\n app = Datasette([], plugins_dir=plugins_dir)\r\n- click.echo(json.dumps(app._plugins(all=all), indent=4))\r\n+ if requirements:\r\n+ for plugin in app._plugins():\r\n+ click.echo(\"{}=={}\".format(plugin[\"name\"], plugin[\"version\"]))\r\n+ else:\r\n+ click.echo(json.dumps(app._plugins(all=all), indent=4))\r\n \r\n \r\n @cli.command()\r\n```\r\nOutput:\r\n```\r\n% datasette plugins --requirements \r\ndatasette-codespaces==0.1.1\r\ndatasette-graphql==2.2\r\ndatasette-json-html==1.0.1\r\ndatasette-pretty-json==0.2.2\r\ndatasette-x-forwarded-host==0.1\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1841501975, "label": "[feature request]`datasette install plugins.json` options"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2133#issuecomment-1671649530", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2133", "id": 1671649530, "node_id": "IC_kwDOBm6k_c5jo1j6", "user": {"value": 54462, "label": "HaveF"}, "created_at": "2023-08-09T15:41:14Z", "updated_at": "2023-08-09T15:41:14Z", "author_association": "NONE", "body": "Yes, using this approach(`datasette install -r requirements.txt`) will result in more consistency. \r\n\r\nI'm curious about the results of the `datasette plugins --all` command. Where will we use the output of this command? Will it include configuration information for these plugins in the future? If so, will we need to consider the configuration of these plugins in addition to installing them on different computers?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1841501975, "label": "[feature request]`datasette install plugins.json` options"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2133#issuecomment-1671720761", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2133", "id": 1671720761, "node_id": "IC_kwDOBm6k_c5jpG85", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-09T16:05:33Z", "updated_at": "2023-08-09T16:05:33Z", "author_association": "OWNER", "body": "Honestly the `--all` option isn't particularly useful - it's really more of a debugging tool for myself than something that I expect anyone else to use.\r\n\r\nThe purpose of `datasette plugins` generally is to help people confirm that plugins installed correctly. It's effectively the CLI alternative to hitting https://datasette.io/-/plugins", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1841501975, "label": "[feature request]`datasette install plugins.json` options"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2133#issuecomment-1671722482", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2133", "id": 1671722482, "node_id": "IC_kwDOBm6k_c5jpHXy", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-09T16:06:28Z", "updated_at": "2023-08-09T16:06:28Z", "author_association": "OWNER", "body": "Plugin configuration itself currently lives in `metadata.json` which I don't like - that file was supposed to be for metadata about your databases, it's a bit of an accident that it grew configuration options as well.\r\n\r\nI'm hoping to fix that for Datasette 1.0, but I'm still figuring out how to do that.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1841501975, "label": "[feature request]`datasette install plugins.json` options"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2133#issuecomment-1672076284", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2133", "id": 1672076284, "node_id": "IC_kwDOBm6k_c5jqdv8", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-09T20:09:12Z", "updated_at": "2023-08-09T20:09:12Z", "author_association": "OWNER", "body": "Problem - if there are plugins in the plugins directory it was returning this:\r\n```\r\nmessages_output_renderer.py==None\r\nmy_plugin.py==None\r\nmy_plugin_2.py==None\r\nregister_output_renderer.py==None\r\nsleep_sql_function.py==None\r\nview_name.py==None\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1841501975, "label": "[feature request]`datasette install plugins.json` options"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2133#issuecomment-1672076671", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2133", "id": 1672076671, "node_id": "IC_kwDOBm6k_c5jqd1_", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-09T20:09:31Z", "updated_at": "2023-08-09T20:09:31Z", "author_association": "OWNER", "body": "I'm going to have it only return plugins with a version other than `None`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1841501975, "label": "[feature request]`datasette install plugins.json` options"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2133#issuecomment-1672224611", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2133", "id": 1672224611, "node_id": "IC_kwDOBm6k_c5jrB9j", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-09T22:07:43Z", "updated_at": "2023-08-09T22:07:43Z", "author_association": "OWNER", "body": "Documentation: https://docs.datasette.io/en/latest/plugins.html#seeing-what-plugins-are-installed", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 1, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1841501975, "label": "[feature request]`datasette install plugins.json` options"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2133#issuecomment-1672360472", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2133", "id": 1672360472, "node_id": "IC_kwDOBm6k_c5jrjIY", "user": {"value": 54462, "label": "HaveF"}, "created_at": "2023-08-10T00:31:24Z", "updated_at": "2023-08-10T00:31:24Z", "author_association": "NONE", "body": "It looks very nice now.\r\nFinally, no more manual installation of plugins one by one. Thank you, Simon! \u2764\ufe0f \r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1841501975, "label": "[feature request]`datasette install plugins.json` options"}, "performed_via_github_app": null}